-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
ANTLRv4 grammar does not work correctly #3959
Comments
Have you tried the following grammar? grammar Hello;
r : 'hello' ID;
HELLO: 'hello';
ID : [a-z]+ ;
WS : [ \t\r\n]+ -> skip ; |
This does not change anything :/ The problem is that the ANTLRv4 grammar should parse this given example grammar and fails on the grammar type already. |
This grammar works fine using a generated CSharp target driver from template.
It also works for a generated Java target driver.
And, it also works using "testrig" (see https://github.com/kaby76/g4-scripts/blob/main/testrig.sh)
You did not say how you test the grammar. We need more information. |
When using the ANTLRv4 grammar defined here with
antlr4-4.13.1
and the following file (from the example directory) to parse:I get the following error(s):
followed by
With the antlr tool I can see that 'Hello' gets identified as ID. Not sure why.
The text was updated successfully, but these errors were encountered: