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

Aterm #4083

Merged
merged 135 commits into from
May 14, 2024
Merged

Aterm #4083

merged 135 commits into from
May 14, 2024

Conversation

teverett
Copy link
Member

@teverett teverett commented May 5, 2024

No description provided.

github-actions bot and others added 30 commits October 26, 2022 01:11
@teverett
Copy link
Member Author

teverett commented May 5, 2024

@kaby76 I seem to have something not quite right in this commit. I see errors like " expected". Would you mind taking a look?

Test.java:187: error: <identifier> expected
        ParseTree tree = parser.();

@kaby76
Copy link
Contributor

kaby76 commented May 5, 2024

Trgen tries to find a start rule but it cannot because it is not an EOF-terminated start rule. The grammar should be augmented with a rule like start_ : term_ EOF ;. Not only does this help trgen find the start rule in the grammar but it forces the parser to read all input to the end of file instead of prematurely stopping at an error, backing up, and reporting success. For an example, see #2405 and specifically the exercise of modifying the "calculator" grammar and parsing input "1 2". In other words, even if one sets the start symbol in the pom.xml, it may not always parse correctly.

@teverett teverett added aterm new-grammar New grammar issue or pull request example New example of file(s) parsed by grammar-generated parser labels May 14, 2024
@teverett teverett merged commit dbaf02e into antlr:master May 14, 2024
16 checks passed
@teverett teverett deleted the aterm branch May 14, 2024 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aterm example New example of file(s) parsed by grammar-generated parser new-grammar New grammar issue or pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants