Skip to content
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

Closed
StoneyJackson opened this issue Jan 24, 2024 · 1 comment · Fixed by #111
Closed

Enable JSON ASTs when 4th grammar section detected #95

StoneyJackson opened this issue Jan 24, 2024 · 1 comment · Fixed by #111
Labels

Comments

@StoneyJackson
Copy link
Member

StoneyJackson commented Jan 24, 2024

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.

@StoneyJackson StoneyJackson changed the title Add new semantics section to grammar files Enable JSON ASTs when 4th grammar section detected Jan 28, 2024
@StoneyJackson StoneyJackson reopened this Apr 11, 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]>
Copy link

🎉 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
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant