Skip to content
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

Prediction can return incorrect results when alts are partially predicated #7

Closed
sharwell opened this issue Feb 9, 2012 · 0 comments

Comments

@sharwell
Copy link
Member

sharwell commented Feb 9, 2012

The following example grammar is used for the TestSemPredEvalParser.testUnpredicatedPathsInAlt unit test.

When started at rule s with the input x 4, it should predict alt 1.

grammar T;
s : a {System.out.println("alt 1");}
  | b {System.out.println("alt 2");}
  ;
a : {false}? ID INT
  | ID INT
  ;
b : ID ID
  ;
ID : 'a'..'z'+ ;
INT : '0'..'9'+;
WS : (' '|'\n') {skip();} ;
sharwell referenced this issue in sharwell/antlr4 Feb 10, 2012
…7076a3a

Small fixes, plus ability to copy LexerATNSimulator state from one simulator to another
parrt pushed a commit that referenced this issue Jun 30, 2015
parrt pushed a commit that referenced this issue Jun 30, 2015
factor common char encoding into main Target; version set to 4.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant