Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Just a minor change to the document name and the setting the status to dormant.

...

Ada ANTLR v3 Target

Author

Luke A. Guest (Archeia)

Status

Currently dormant.

Old stuff that is no longer relevant, maybe ;)

I currently have a very basic Ada95Target.java file which produces package bodies and specifications using the GNAT filename convention. In conjunction with this, I've taken the Java.stg file from codegen/templates/Java and started to modify this to produce a lexical analyser package.

...

As I'm currently learning ANTLR and StringTemplate, this will probably take some time to achieve.

Runtime

  • Ada95 is strongly typed and the runtime has been implemented in such a way to try to take the Java
    code and enforce restrictions upon the types rather than using int's all over the place.

...

  • Also, Ada95 doesn't have support for interfaces, so mix-in inheritance will be used where appropriate.

Package differences from Java to Ada95

Java

Ada95

Comment

IntStream

ANTLR.Stream

Modified to be a generic abstract type so that type checking can
be used on the actual type in the stream.

BaseRecognizer

ANTLR.Root_Recogniser

The word "Root" is more consistent with the Ada runtime library

Method differences from Java to Ada95

Java

Ada95

Comment

LA

Look_Ahead

For reasons of readability

Usage

Compilation

TODO Show how to compile the runtime.

Example

TODO Provide a quick an easy example grammar.

Future work

Ada 2005

I decided not to target Ada 2005 as there is only 1 compiler that support the new standard, and as it's so new, it doesn't do it very well (yet). Ada 2005 would've made the runtime easier to port, as it would be possible to provide an almost 1:1 correlation from Java to Ada.

...