Ada Examples
Items indicated with (*) can be compiled as main programs.
For example, to compile the scanner test driver, use "gnatmake scantest".
- hello.adb simple main program (*)
- math_functions.ads,
math_functions.adb a simple example of a package
- mathtest.adb test driver for package math_functions (*)
- exceptions.adb example of exception handling (*)
- getest.adb use of get and skip_line (*)
- looktest.adb use of get_line and look_ahead (*)
- enums.adb legal use of enumeration types (*)
- enums2.adb illegal uses of enumeration types (*)
- fruits.adb more illegal uses of enumeration types (*)
- generic programming
- compilation techniques: scanning, recursive descent parsing, tree walking, symbol table
- simple scanner and test driver
- first version of recursive descent parser and evaluator
- same as the above, but with runtime execution trace of all calls and returns
- alternate version of scanner and calculator, as basis for programming exercise
- alternate version of calculator, modified to build abstract syntax tree (AST)
-
- another version of the above, using controlled type and reference count
for storage recovery
-
- yet another version of the above, using controlled type and reference count
for storage recovery, but only for the exported type (reduces overhead due to
calls to finalize and adjust)
-
- checkpres.adb an ad hoc tool to create the
Web page listing which student has signed up for which presentation topic and time slot (*)