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

Semantic predicates prevent fallback to full-context parsing #32

Closed
sharwell opened this issue Mar 1, 2012 · 3 comments
Closed

Semantic predicates prevent fallback to full-context parsing #32

sharwell opened this issue Mar 1, 2012 · 3 comments

Comments

@sharwell
Copy link
Member

sharwell commented Mar 1, 2012

Currently full-context parsing is prevented when one or more configs contain semantic predicates. However, full-context parsing may eliminate one or more configs before the predicate evaluation stage which could change the predicted alternative.

@parrt
Copy link
Member

parrt commented Mar 4, 2012

If we have 3 alts with predicates and they are all ambig in local context but alt 1 is eliminated in full ctx parse. but, we choose first alt with local ctx. we don't check full ctx parse first. Not sure what to do. maybe just doc it ;)

@sharwell
Copy link
Member Author

sharwell commented Mar 4, 2012

Local/full context handling is independent of semantic context handling. If the presence of semantic contexts prevents the fallback to full context parsing, then using an LR rule in a grammar could turn an otherwise LL() parser into an SLL() parser, undoing one of ANTLR 4's most significant contributions.

@sharwell
Copy link
Member Author

sharwell commented Mar 8, 2012

This issue is simply not correct. The parser does fall back to full context parsing even when semantic predicates are present.

@sharwell sharwell closed this as completed Mar 8, 2012
parrt pushed a commit that referenced this issue Jun 30, 2015
parrt pushed a commit that referenced this issue Jun 30, 2015
parrt pushed a commit that referenced this issue Jun 30, 2015
Fix import statements under Python 3.2
parrt pushed a commit that referenced this issue Nov 7, 2016
Leave spaces alone unless escaped spaces requested
@ericvergnaud ericvergnaud mentioned this issue Nov 8, 2016
KvanTTT pushed a commit to KvanTTT/antlr4 that referenced this issue Jan 22, 2024
replaced CodePointCharStream with StringCharStream closes antlr#31
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