Package processing.mode.java.preproc
Class PdeIssueEmitter
java.lang.Object
org.antlr.v4.runtime.BaseErrorListener
processing.mode.java.preproc.PdeIssueEmitter
- All Implemented Interfaces:
org.antlr.v4.runtime.ANTLRErrorListener
public class PdeIssueEmitter
extends org.antlr.v4.runtime.BaseErrorListener
ANTLR error listener to inform a preprocess issue listener when syntax errors are encountered.
A {BaseErrorListener} which looks for syntax errors reported by ANTLR and converts them to {PdePreprocessIssue}s that are consumable by a {PdePreprocessIssueListener}. It does this by running the {PreprocessIssueMessageSimplifier} to generate a more user-friendly error message before informing the provided listener.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classData structure describing where an issue occurred.static classUtility that can help clean up where in source an issue should be reported.static classData structure describing an issue simplification or explanation.static interfaceInterface for listener that responds to issues reported by the preprocessor.static interfaceSimple interface for strategy which can emit the full body of a processing sketch. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new issue emitter.PdeIssueEmitter(PdeIssueEmitter.PdePreprocessIssueListener newListener, PdeIssueEmitter.SourceEmitter newSourceEmitter) Create a new issue emitter. -
Method Summary
Modifier and TypeMethodDescriptionvoidsyntaxError(org.antlr.v4.runtime.Recognizer<?, ?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, org.antlr.v4.runtime.RecognitionException e) Methods inherited from class org.antlr.v4.runtime.BaseErrorListener
reportAmbiguity, reportAttemptingFullContext, reportContextSensitivity
-
Constructor Details
-
PdeIssueEmitter
Create a new issue emitter.Create a new issue emitter when access to the processing sketch source is not available. Note that this will not allow some error beautification and, if sketch source is available, use other constructor.
- Parameters:
newListener- The listener to inform when encountering a syntax error.
-
PdeIssueEmitter
public PdeIssueEmitter(PdeIssueEmitter.PdePreprocessIssueListener newListener, PdeIssueEmitter.SourceEmitter newSourceEmitter) Create a new issue emitter.- Parameters:
newListener- The listener to inform when encountering a syntax error.newSourceEmitter- The sketch source to use when helping beautify certain syntax error messages.
-
-
Method Details
-
syntaxError
public void syntaxError(org.antlr.v4.runtime.Recognizer<?, ?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, org.antlr.v4.runtime.RecognitionException e) - Specified by:
syntaxErrorin interfaceorg.antlr.v4.runtime.ANTLRErrorListener- Overrides:
syntaxErrorin classorg.antlr.v4.runtime.BaseErrorListener
-