Compling ANTLR grammar files manually

If you do not use our branched ANTLR plugin, you need to compile the ANTLR 2.7.x *.g files containing the TTCN-3 grammar (The ANTLR plug-in for Eclipse hosted at sourceforge is supposed to do this automatically, but unfortunately it is not able to do this in the correct order; hence, you have to impose the right order manually.):

  • Navigate in the Package Explorer to de.ugoe.cs.swe.trex.core/src/de/ugoe/cs/swe/trex/core/analyzer/rfparser and apply the ANTLR tool to all of the *.g files: TTCN3Lexer.g, TTCN3Parser.g, TTCN3FormatterTreeParser.g, TTCN3SemanticAnalysisTreeParser.g, and TTCN3SymbolTableTreeParser.g by selecting Compile ANTLR Grammar from the Package Explorer context menu to each *.g file: source:web/wiki/pics/manualbuild/compile-grammar.png


Make sure that TTCN3Lexer.g is compiled first and TTCN3Parser.g is compiled second! Afterwards the tree parser files may by compiled in any order.

  • Afterwards, corresponding *.java (and further) files should have been created and the error markers should have disappeared.
    • If you cannot find the menu item Compile ANTLR grammar, you probably have to install the ANTLR plug-in first.
    • If after applying ANTLR to all *.g files, still errors remain, you probably have missed one *.g file or forgotten to enable Java 5 compiler settings.

Afterwards, you may continue with starting TRex.