[comp.lang.ada] ada file naming conventions

Judy.Bamberger@SEI.CMU.EDU (10/04/90)

Here is what we did for DARK (about 6000 lines, including some assembler):

	package spec:   <package-long-name>.ada
	package body:   <package-short-name>_body.ada
	assembler:	<package-short-name>_body_machine_code.<lang-id>

For example, for a package process_table, we had:

	process_table.ada		-- package spec
	PTB_body.ada			-- package body; each package was assigned
					-- a 2-3char unique short name; this was
					-- used in the code as well as for names
					-- of files; package short names were a
					-- project-wide, high-level configuration
					-- item
	PTB_body_machine_code.a68	-- motorola 68020 machine code

We went a bit further, and established "classes" of file names:

	<logical-contents>_types.ada	-- for packages collecting miscellaneous
					-- global types
		schedules_types.ada	-- for example
		ST_body.ada		-- corresponding body, doing elaboration-
					-- time initialisation or checking
	<package-short-name>_debug.ada  -- for specs with debug (print) routines
	<package-short-name>_debug_body.ada
					-- for the corresponding debug body
		PTB_debug.ada		-- for example
		PTB_debug_body.ada

	generic_<package-name>.ada	-- for the file containing a generic
					-- package, which also began with
					-- "generic_"
	G<package-short-name>.ada	-- for the corresponding generic body
	<package-name>.ada		-- for the spec instantiating the generic
		generic_process_table.ada
					-- the spec
		GPTB_body.ada		-- note G before standard 
					-- <package-short-name>
		process_table.ada	-- the instantiation

And to call out those packages that were hardware/implementation-dependent:

	hardware_interface.ada		-- encapsulation and renaming of
					-- primitive types (e.g., integer, float)
					-- [perhaps not the best choice of name,
					-- but the intention was good!]
	low_level_<package-name>.ada	-- spec for package getting very close to
					-- the hardware
	LL<package-name>_body.ada	-- corresponding body
	LL<package-name>_machine_code.<lang-id>
					-- corresponding machine code
		low_level_hardware.ada
		LLH_body.ada		-- note standard LL abbreviation
		LLH_body_machine_code.a68

We avoided subunits (too expensive compilation/link time), so we did not deal with
that.  People who have picked up our code have reported that our consistency and
"sanity" was very helpful to them.  In otherwords, whatever standard one adopts,
it should be consistent and reasonable ... and documented!