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

P4_14 parser exceptions are not recognized by bison parser #489

Closed
antoninbas opened this issue Apr 17, 2017 · 3 comments
Closed

P4_14 parser exceptions are not recognized by bison parser #489

antoninbas opened this issue Apr 17, 2017 · 3 comments
Assignees
Labels
enhancement This topic discusses an improvement to existing compiler code. fixed This topic is considered to be fixed.

Comments

@antoninbas
Copy link
Member

parser exceptions have never been used much in P4_14 AFAIK, however people are complaining that p4c is rejecting valid (according to the current spec) P4_14 programs that use parser exceptions

@mihaibudiu
Copy link
Contributor

I have assigned @ChrisDodd; but he can probably only help with the grammar; we should discuss about how to represents exceptions in P4-16. It would be nice to have at least one test example with exceptions.
I never understood clearly their semantics personally.

@ChrisDodd
Copy link
Contributor

The P4_14 frontend has support for parser exceptions, so any legal program that uses them should be accepted. They're just dropped before conversion to P4_16, however, so they won't be visible in the midend or backend, which might result in problems there.

@mihaibudiu mihaibudiu added the enhancement This topic discusses an improvement to existing compiler code. label Nov 8, 2017
mihaibudiu pushed a commit to mihaibudiu/p4c-clone that referenced this issue Feb 28, 2018
@mihaibudiu mihaibudiu added the fixed This topic is considered to be fixed. label Feb 28, 2018
@mihaibudiu
Copy link
Contributor

I have pushed a "fix" for this issue which only consists in emitting a warning when a parser exception is encountered. I suggest to close this issue - which seems to be about parsing programs with parser exceptions. If we want to implement properly a translation to P4-16 we should probably file a different issue. If someone can explain exactly how a parser exception is triggered then we can attempt to implement the translation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This topic discusses an improvement to existing compiler code. fixed This topic is considered to be fixed.
Projects
None yet
Development

No branches or pull requests

3 participants