Closed eymre closed 8 years ago
Found the issue: sum
output is detected as a keyword (SV sum method?) and that confuses the parser. Is there an easy workaround for this?
Updated the issue title.
Thank you.
Oops, sorry, I completely missed your bug report! Much appreciated though! I think this should be an easy fix.
Thanks @eymre, you nailed it :) Sorry it took so long to notice the bug report; I need to fix the git notification settings it seems.
Btw, the keyword vs identifier thing might be a bit surprising. Basically the LRM has special grammar for certain constructs (such as the builtin array methods), and the ANLTR grammar is much easier to write if, say, the builtin method names are both special tokens and identifiers. So the lexer creates special tokens for many non-keywords and defers to the parser to decide whether it is a keyword or an identifier in that particular context. The problem here was just that the rule bypassed the identifier rule that handles this stuff.
Fixed my github notification settings :)
Thank you for the fix :)
Hello svstuff,
First of all thanks for putting this together. I'm trying to parse a simple SV code but having trouble with the assign with the lvalue in curly braces:
Relevant parts from the debug output:
I.e. the sum wire:
variable_lvalue rule has
LCURLY variable_lvalue (COMMA variable_lvalue)* RCURLY
pattern which should parse this construct but isn't.I'm a completely newbie in antlr grammar so any help would be very appreciated.
Thanks,