-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
'tree' as name of a parser rule causes syntax error. #1960
Comments
It expects a Workarounds:
|
Indeed:
Actually, if I read correctly, this rule is only used to throw a relevant error message when the user writes antlr4/tool/src/org/antlr/v4/parse/ANTLRParser.g Lines 200 to 210 in 432022f
Still, I don't understand why using a prefix ( |
Remove backward compatibility exception v3TreeGrammarException
Remove backward compatibility exception v3TreeGrammarException
Remove backward compatibility exception v3TreeGrammarException
A simple grammar ('g.g4'):
causes the following error
Removing the space between 'tree' and ':' or changing 'tree' to other rule name helps.
I've found that 'tree' was a keyword in antlr v3. But the reference book of v4 doesn't list it any more.
If 'tree' is a reserved keyword, the error message is confusing.
The text was updated successfully, but these errors were encountered: