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

Improve the performance of the new parser #6

Closed
daniellansun opened this issue Oct 5, 2016 · 0 comments
Closed

Improve the performance of the new parser #6

daniellansun opened this issue Oct 5, 2016 · 0 comments

Comments

@daniellansun
Copy link
Owner

@sharwell provided a useful advice:

"You can save a great deal of time on correct inputs by using a two-stage parsing strategy.

  1. Attempt to parse the input using BailErrorStrategy and PredictionMode.SLL. If no exception is thrown, you know the answer is correct.
  2. If a ParseCancellationException is thrown, retry the parse using the default settings (DefaultErrorStrategy and PredictionMode.LL)."

antlr/antlr4#192

daniellansun added a commit that referenced this issue Oct 6, 2016
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

1 participant