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

Using updated SV/Verilog, VHDL Grammars #178

Open
AmeyaVS opened this issue Apr 17, 2023 · 2 comments
Open

Using updated SV/Verilog, VHDL Grammars #178

AmeyaVS opened this issue Apr 17, 2023 · 2 comments

Comments

@AmeyaVS
Copy link
Contributor

AmeyaVS commented Apr 17, 2023

While working on #176 , and the issue I faced with dummy module missing instance name not generating a parse error seems to be related to the existing grammar being used.

Would it make sense to update the grammar for SV/Verilog, and VHDL from the official ANTLR4 repo: https://github.com/antlr/grammars-v4

I would like to know if it makes sense.

@Nic30
Copy link
Owner

Nic30 commented Apr 17, 2023

It may be beneficial for ANTLR4 repo, there were people asking for this hdlConvertor grammar because it is much faster. But I never had the time to actually commit it to that repo.

But there is a problem. Grammars in hdlConvertor do have inlined c++ peredicates. Although they are mostly not necessary and it is possible to write grammar without them they are present mostly from performance reasons.
https://github.com/Nic30/hdlConvertor/blob/master/grammars/sv2017Lexer.g4#L37
They are also often tied to some small code which is stored in the repo and my guess is that people from ANTLR4 do accept only pure ANTLR4 grammars. But I did not ask so I do not know.

So, yes, it makes sense but it requires consultation with someone from https://github.com/antlr/grammars-v4/ what to do about inlined C++ predicates.

@AmeyaVS
Copy link
Contributor Author

AmeyaVS commented Apr 18, 2023

I think it would be best if we can get some feedback from the ANTLR4 Grammar Community.
Let me see if I can spend some updating some part of the grammar, but there is no guarantee it would be ready any time soon, as I am quite new to ANTLR.

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

No branches or pull requests

2 participants