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

Update grammar to be closer to p4c implementation 2025 feb #1365

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jafingerhut
Copy link
Collaborator

This PR intentionally has 2 commits, in hopes of making it slightly easier to review.

The first commit only reorders some definitions of nonterminal symbols in the grammar, without changing their contents at all in any other way, to make the order the same as the p4c implementation grammar, for easier diff'ing. OK, that plus fixing one typo in a nonterminal name, and updating an example command in scripts/README.md for running that can help with easier diff'ing of the spec grammar vs. the p4c implementation grammar.

The second commit only updates the definitions of nonterminals related to the new for loops, to make them closer to the p4c implementation grammar. Those are the ones that require closer scrutiny on review, I think.

The first commit only makes these changes:

+ Reorder a few things to be more like the p4c implementation grammar.
  There are no functional changes in this reordering.
+ Fix a typo: "erxpression" -> "expression".
+ Update the name of the grammar file from grammar.mdk to grammar.adoc
  in the scripts/README.md file.

Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
…ation

Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
Copy link
Contributor

@ChrisDodd ChrisDodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget exactly why the .y file ended up different -- probably a refactoring to avoid an LALR(1) conflict in the grammar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants