PowerAda aextract

From OC Systems Wiki!
< PowerAda:APPENDIX E. Tools Reference
Revision as of 00:34, 25 April 2019 by imported>WikiVisor (Text replacement - """ to """)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


aextract - extracts PowerAda source


aextract [-hFIU] [-L Library | -s Sublibrary | -x Executable ]


aextract extracts the ASCII source text for a compilation unit from an Ada library or sublibrary.

Source is saved in the library by the ada compiler by default. Source is not stored in the library if the -P command line option is specified.

As with other PowerAda tools, the specification or body of the unit is specified using "lib/unitname" or "sec/unitname", respectively.

The library in which to search for the unit is designated by specifying the library file (e.g., -L alib.list), or an executable file from which to extract the library (e.g,. -x a.out). One may instead search a specific sublibrary as well (e.g., -s adalib).

By default, the source text is written to standard output. The -F flag indicates that the source text is to be written to a local file which is the same as the basename of the file from which the unit was originally compiled. The -U flag indicates that the source text is to be written to a local file whose name is based on the unitname.

WARNING: There is no checking to see if this file created already exists, and files may be overwritten. If the -I flag is specified, unit names are read from standard input.


Writes output to base filename from which unit was compiled.
Gives this help.
Reads units from standard input.
Writes output to filename based on unitname.
-L Library
Specifies library to get units from.
-s Sublibrary
Specifies sublibrary to get units from.
'-x Executable
Specifies PowerAda executable to get library from.'


Specifies units to get source for.


$POWERADA/bin/aextract - the aextract program


This must be defined and indicate the powerada/ada95 directory in the PowerAda installation.
Names a baselines file identifying aliases for baseline projects.


cat > h.ada << EOF
with text_io;
procedure hello is 
   text_io.put_line("Hello World");
end hello;
ada h.ada
aextract sec/hello > xh.ada
diff h.ada xh.ada
areport -B | aextract -IU
diff hello.ada hello_.ada
rm h.ada
aextract -F sec/hello 
diff h.ada xh.ada


areport, ada, powerada