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

If/If/Else can lead to no viable alt at EOF #41

Closed
sharwell opened this issue Mar 11, 2012 · 1 comment
Closed

If/If/Else can lead to no viable alt at EOF #41

sharwell opened this issue Mar 11, 2012 · 1 comment

Comments

@sharwell
Copy link
Member

Here is a simplified grammar demonstrating the problem:

grammar T;
s : a | 'x';
a : 'a' s ('b' s)?;

No output for input axbx (correct)
No output for input x (correct)

Output for input ax (unexpected)

line 1:2 no viable alternative at input '<EOF>'

Output for input aaxbx (unexpected)

line 1:5 no viable alternative at input '<EOF>'
@parrt
Copy link
Member

parrt commented Jul 21, 2012

EOF cannot follow s. would need s' : s EOF ; for that. updating unit test TestParserExec.testOptional

@parrt parrt closed this as completed Jul 21, 2012
@sharwell sharwell reopened this Jul 31, 2012
@parrt parrt closed this as completed in 8c03dba Sep 8, 2012
parrt pushed a commit that referenced this issue Jun 30, 2015
Fixed typo: self._buildParseTrees --> self.buildParseTrees
parrt pushed a commit that referenced this issue Nov 7, 2016
cpp runtime: updated the vs2013 project reflecting the last changes
@ericvergnaud ericvergnaud mentioned this issue Nov 8, 2016
sharwell added a commit to sharwell/antlr4 that referenced this issue Dec 28, 2020
Update the code generator for ANTLR XPath lexer
KvanTTT pushed a commit to KvanTTT/antlr4 that referenced this issue Jan 22, 2024
Implement Kotlin/native variant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants