-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable JSON ASTs when 4th grammar section detected #95
Labels
Comments
StoneyJackson
changed the title
Add new semantics section to grammar files
Enable JSON ASTs when 4th grammar section detected
Jan 28, 2024
reedeveris
added a commit
that referenced
this issue
Apr 11, 2024
This is in anticipation of a new hybrid Java/Python mode in which the parser runs in Java and the semantics rep-loop runs in Python. In this commit, when an optional 4th section is detected, plcc.py generates ParseJsonAst.json. Thus allowing the parser to to generate JSON ASTs when the `--json_ast` flag is passed. It also generates experimental Python files. --- Closes #95 Co-authored-by: Reed Everis <[email protected]> Co-authored-by: Akshar Patel <[email protected]> Co-authored-by: Stoney Jackson <[email protected]>
StoneyJackson
added a commit
that referenced
this issue
Apr 20, 2024
This is in anticipation of a new hybrid Java/Python mode in which the parser runs in Java and the semantics rep-loop runs in Python. In this commit, when an optional 4th section is detected, plcc.py generates ParseJsonAst.json. Thus allowing the parser to to generate JSON ASTs when the `--json_ast` flag is passed. It also generates experimental Python files. --- Closes #95 Co-authored-by: Reed Everis <[email protected]> Co-authored-by: Akshar Patel <[email protected]> Co-authored-by: Stoney Jackson <[email protected]>
🎉 This issue has been resolved in version 6.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Parent issue: #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.
The text was updated successfully, but these errors were encountered: