gnatprep
Ada source file preprocessor
TLDR
Preprocess an Ada source file
$ gnatprep [input.adb] [output.adb]
Preprocess with symbol definitions file$ gnatprep [input.adb] [output.adb] [defs.txt]
Define a symbol on command line$ gnatprep -DDEBUG=True [input.adb] [output.adb]
Replace preprocessor lines with blanks$ gnatprep -b [input.adb] [output.adb]
Retain preprocessor lines as comments$ gnatprep -c [input.adb] [output.adb]
List defined symbols$ gnatprep -s [input.adb] [output.adb] [defs.txt]
SYNOPSIS
gnatprep inputfile outputfile [definitionsfile] [switches_]
DESCRIPTION
gnatprep is a preprocessor for Ada programs. It processes conditional compilation directives (#if, #elsif, #else, #end if) and symbol substitutions ($symbol) in Ada source files. While designed for GNAT, it is not dependent on GNAT-specific features and can be used independently.
PARAMETERS
-b
Replace preprocessor and deleted lines with blank lines.-c
Retain preprocessor and deleted lines as comments.-Dsymbol=value
Define symbol on command line.-s
List symbol names and values to stdout.-u
Treat undefined symbols as FALSE.-r
Generate source reference pragmas.
CAVEATS
Neither -b nor -c preserves original line numbers. If both are absent, preprocessor and deleted lines are removed entirely unless -r is specified.

