-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fail to parse nature
terminated by ;
#39
Comments
An optional semicolon is also valid after an identifier in a discipline declaration. Both first appeared in VAMS-LRM-2.3. |
This was actually easier to solve than I thought it would be.
|
Version 2.3.0 of the Verilog-AMS Language Reference Manual introduced an optional semicolon after a nature and discipline identifier in a nature and discipline declaration, respectively; e.g., nature identifier; ... endnature and discipline identifier; ... enddiscipline are now also legal syntax. ADMS behaves the same as when the semicolon is absent. This brings ADMS one step closer to being able to parse the most recent Accellera standard disciplines header files. This commit fixes GitHub issue Qucs#39.
Version 2.3.0 of the Verilog-AMS Language Reference Manual introduced an optional semicolon after a nature and discipline identifier in a nature and discipline declaration, respectively; e.g., nature identifier; ... endnature and discipline identifier; ... enddiscipline are now also legal syntax. ADMS behaves the same as when the semicolon is absent. This brings ADMS one step closer to being able to parse the most recent Accellera standard disciplines header files. This commit fixes GitHub issue #39.
I am very embarrassed. This doesn't do what I thought it did! The code is getting assigned to the new rules, meaning the versions without the semicolons are not longer valid, which is certainly not what we want. I was able to get it to work by duplicating the code and putting it with each rule, but this is definitely not the best way of doing this. My limited knowledge of bison means I cannot suggest a better solution right now. |
On Tue, Jan 04, 2022 at 11:05:42AM -0800, Neal wrote:
I am very embarrassed.
Don't worry about it. I'm glad you are trying at all.
This doesn't do what I thought it did! The code
is getting assigned to the new rules, meaning the versions without the
semicolons are not longer valid, which is certainly not what we want.
I was able to get it to work by duplicating the code and putting it
with each rule, but this is definitely not the best way of doing this.
My limited knowledge of bison means I cannot suggest a better solution
right now.
I was wondering if we can have a maybe_semicolon token that matches ';'
or nothing. And then do
- | tk_discipline R_discipline_name R_l.discipline_assignment tk_enddiscipline
+ | tk_discipline R_discipline_name maybe_semicolon R_l.discipline_assignment tk_enddiscipline
?
I am not a grammar expert, and I dont know what it takes to define
maybe_semicolon.
Also, I did not spot the mistake. Maybe I/we/adms should require (simple
end-to-end) tests before anything gets in. But this will only raise the
bar for contributions. :/
|
Success!
My book on Flex/Bison is still in the post! I just wanted this fixed for the next release. I created a new rule for an optional semicolon. Then I added this in place of the previous change. I've tested with Accellera 2.2 (no semicolons) and Accellera 2.3.1 (semicolons) |
On Tue, Jan 04, 2022 at 11:33:31AM -0800, Neal wrote:
Success!
[..]
I created a new rule for an optional semicolon. There I added this in place of the previous change.
Thanks. merged.
|
nature [name];
--> parser fails at;
The text was updated successfully, but these errors were encountered: