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

Move report* callbacks from ANTLRErrorStrategy to ANTLRErrorListener #40

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

Comments

@sharwell
Copy link
Member

sharwell commented Mar 8, 2012

The following calls are made from within ParserATNSimulator for reporting purposes only. The results of the call do not have any direct impact on parsing.

  • ANTLRErrorStrategy.reportError This one can't be moved. Generated code calls this method and the error strategy determines what/when to report to the listener.
  • ANTLRErrorStrategy.reportAmbiguity
  • ANTLRErrorStrategy.reportAttemptingFullContext
  • ANTLRErrorStrategy.reportContextSensitivity
  • ANTLRErrorStrategy.reportInsufficientPredicates

These methods are more appropriate as part of the ANTLRErrorListener interface.

If someone does need an error strategy where behavior is dependent on these callbacks, it would be easy to simply implement both ANTLRErrorStrategy and ANTLRErrorListener on the same object.

@sharwell
Copy link
Member Author

Fixed in 3f1f76d

parrt pushed a commit that referenced this issue Jun 30, 2015
parrt pushed a commit that referenced this issue Jun 30, 2015
Fix string.Format syntax (fixes #40)
parrt pushed a commit that referenced this issue Jun 30, 2015
no need to escape with Python
parrt pushed a commit that referenced this issue Jun 30, 2015
parrt pushed a commit that referenced this issue Nov 7, 2016
sharwell added a commit to sharwell/antlr4 that referenced this issue Dec 23, 2018
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