2010-04-30
Görel Hedin
Lund University, Sweden
This is an implementation of the state machine example
in my tutorial:
An Introductory Tutorial on JastAdd Attribute Grammars
To be published during 2010 in the Springer Verlag LNCS postproceedings of GTTSE 2009.
Directories and files:
To run the examples, you need the following programs installed:
The build file supports the following targets:
Try it out using the following command:
ant test
This should trigger generation and compilation of Java code, and running all the JUnit test cases. A window should appear showing that all the tests pass.
Or, run the example main program:
java -cp .:tools/beaver-rt.jar exampleprogs/MainProgram
This should print out reachability information about the state machine in Fig. 3 in the tutorial.
Or, run the "compiler" main program:
java -cp .:tools/beaver-rt.jar exampleprogs/Compiler exampleprogs/test.sm
which runs a "compiler" for the state machine language that prettyprints the program in file test.sm, and prints out reachability and cycles information for it.
Some notes about the parser: