If there are questions regarding the exercise, please refer to Johannes Mey at [email protected]. However, before asking questions, please read the JastAdd reference manual:
This exercise uses gradle to get dependencies and build and test its solutions.
Gradle is bundled for Linux/Mac and Windows and the bundled version should be
used with ./gradlew
or gradlew.bat
, respectively.
The following gradle tasks are helpful to solve the tasks:
run
runs the main method in classde.tudresden.inf.st.most.ExerciseMain
test
runs the tests. There are tests that should succeed after a particular task has been solved.DrAST
is an editor that displays syntax trees. It can be used to load and displayjson
orexp
files. Attribute values and reference attribute references are shown.RagDoll
is a javadoc variant for JastAdd.
All JastAdd files that must be edited are in the src/main/jastadd
folder. The contents are as follows:
expressions.ast
is the grammarexpressions.flex
contains the jflex lexer specificationexpressions.parser
contains the beaver parser specificationPrinting.jrag
contains the pretty-printerNameResolution.jrag
should contain the name resolutionEvaluation.jrag
should contain an evaluation attributeOptimization.jrag
should contain the rewrites and their helper attributesAnalysis.jrag
should contain the unused definitions attributeASTPrinting.jadd
contains helper methods to display the AST
Additionally, the main class de.tudresden.inf.st.most.ExerciseMain
can be
modified to test the code. Please be careful when editing, because DrAST
relies on a certain structure (in particular, on field DrAST_root_node
containing an AST root node).
No additional help is given for editing the lexer and parser specifications as this is more or less trivial copy-and-paste. If more help is required, please refer to the websites:
Please submit src/main/
and its subfolders.