Add an optional 4th section to grammar files. The 4th section will be populated by Python semantics. When a grammar files is written with four section, its structure is as follows:
lexical specification
%
syntactic specification
%
syntactic checks/helpers written in Java
%
semantics written in Python
Existing 3-section grammars should function normally.
When a 4th section is detected (even when empty), it will generate the Java code needed to generate JSON ASTs. Note that the 3rd section could also be empty, and it would behave the same.
Parent issue: https://github.com/ourPLCC/plcc/issues/52
Add an optional 4th section to grammar files. The 4th section will be populated by Python semantics. When a grammar files is written with four section, its structure is as follows:
lexical specification % syntactic specification % syntactic checks/helpers written in Java % semantics written in Python Existing 3-section grammars should function normally.
When a 4th section is detected (even when empty), it will generate the Java code needed to generate JSON ASTs. Note that the 3rd section could also be empty, and it would behave the same.