Skip to content

domain.y

RukNdf edited this page Mar 12, 2021 · 2 revisions

Parser file, contains the grammar and allows the modification of the Parser.java file.

Modifying

The file uses the Yacc programming language to define the grammar, with some parts that allow custom Java code to be inserted.

The section between "%{" and "}%" allows for java code to be inserted before the class declaration. (e.g. imports)

The section beneath the last "%%" allows for code to be inserted within the Parser class.

Compiling

The Yacc code can be compiled to java with the use of BYACC. It will generate two java files, Parser.java and ParserVal.java. The current ParserVal file shouldn't be replaced unless needed.

Clone this wiki locally