cubesatlab / cubedos

A flight software framework in SPARK/Ada
48 stars 5 forks source link

Child packages should be handled properly #61

Closed pchapin closed 4 months ago

pchapin commented 4 months ago

Right now, Mercury assumes every module it processes is a direct child of package CubedOS. Of course, this is only true for packages in the CubedOS core module library and not at all true for application packages. This needs to be fixed.

Following the GNAT compiler, Mercury could use the file name as a hint about the full name of the package it is processing. It could then use that name in the generated code and as the basis of the file names holding the generated code. Unlike GNAT, I suggest Mercury honors the casing used in the names. For example, a file named "DTN-CFDP.mxdr" would generate code into package DTN.CFDP.API, but use names like dtn-cfdp-api.ads and dtn-cfdp-api.adb for the generated Ada files (following GNAT's expectations). That is, the casing of the MXDR file should be preserved when writing Ada, but the casing should be pushed to lowercase when naming output files.