-
Notifications
You must be signed in to change notification settings - Fork 48
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
Collision between token ID and token lexeme #20
Comments
This error was encountered while implementing a Gocc BNF for LLVM IR, the relevant extract of which is presented below. // ## Identifiers
_name : _letter { _letter | _decimal_digit } ;
_quoted_name : _quoted_string ;
_id : _decimals ;
// ### Global Identifiers
global
: _global_name
| _global_id
;
_global_name : '@' ( _name | _quoted_name ) ;
_global_id : '@' _id ;
// # Declarations
GlobalVarDecl : global "=" "global" Type Value ; The I seem to have a memory of you guys mentioning that this was fixed in Gocc 3. If so, how did you fix it? |
@goccmack I think you should answer this one. |
@goccmack and @awalterschulze Have you gained any further insight into the cause of this issue? It seems to still be present in the latest version of gocc (rev e7acd08). The example below uses the same grammar for
|
The reason for this error is that the gocc2 symbol table is not sophisticated enough to distinguish between an explicitly declared symbol (e.g. foo : ...) and and implicitly declared symbol (e.g.: "foo"). It looks like gocc3 RC3 still had the same problem. |
Oh, I see. Thank you Marius for providing some insight into this. I may try to tackle the issue within the months to come : ) Cheerful regards from a snow-filled Sweden. |
Contents of
x.bnf
:Gocc revision c7163b5.
The text was updated successfully, but these errors were encountered: