Top Methods
org.python.antlr

pack-priv Interface ErrorHandler

Known Direct Implementers
org.python.antlr.FailFastHandler, org.python.antlr.ListErrorHandler, org.python.antlr.RecordingErrorHandler
Imports
org.antlr.runtime.BaseRecognizer, .BitSet, .IntStream, .Lexer, .RecognitionException, org.python.antlr.base.expr, .mod, .slice, .stmt

Method Summary

Modifier and TypeMethod and Description
public default void
error(String
text to include.
message
,
PythonTree
not null, root of the PythonTree provoking the error.
t
,
boolean
true if we cannot recover with more input.
definite
)

Handle (normally throw a ParseException) specifying whether to treat as a final decision.

public void
error(String
text to include.
message
,
PythonTree
not null, root of the PythonTree provoking the error.
t
)

Handle (normally throw a ParseException) possibly recoverable by waiting for further input.

public expr
public mod
public slice
public stmt
public boolean

Returns:

True if the caller should handle the mismatch
mismatch
(BaseRecognizer br, IntStream input, int ttype, BitSet follow)

public void
public void
public Object

Returns:

null if the caller should handle the mismatch
recoverFromMismatchedToken
(BaseRecognizer br, IntStream input, int ttype, BitSet follow)

public void

Method Detail

errorback to summary
public default void error(String message, PythonTree t, boolean definite)

Handle (normally throw a ParseException) specifying whether to treat as a final decision. In the REPL, when definite=true, Jython will signal a definite syntax or semantic error, not recoverable by waiting for further input.

Parameters
message:String

text to include.

t:PythonTree

not null, root of the PythonTree provoking the error.

definite:boolean

true if we cannot recover with more input.

errorback to summary
public void error(String message, PythonTree t)

Handle (normally throw a ParseException) possibly recoverable by waiting for further input.

Parameters
message:String

text to include.

t:PythonTree

not null, root of the PythonTree provoking the error.

errorExprback to summary
public expr errorExpr(PythonTree t)
errorModback to summary
public mod errorMod(PythonTree t)
errorSliceback to summary
public slice errorSlice(PythonTree t)
errorStmtback to summary
public stmt errorStmt(PythonTree t)
mismatchback to summary
public boolean mismatch(BaseRecognizer br, IntStream input, int ttype, BitSet follow) throws RecognitionException
Returns:boolean

True if the caller should handle the mismatch

recoverback to summary
public void recover(BaseRecognizer br, IntStream input, RecognitionException re)
recoverback to summary
public void recover(Lexer lex, RecognitionException re)
recoverFromMismatchedTokenback to summary
public Object recoverFromMismatchedToken(BaseRecognizer br, IntStream input, int ttype, BitSet follow) throws RecognitionException
Returns:Object

null if the caller should handle the mismatch

reportErrorback to summary
public void reportError(BaseRecognizer br, RecognitionException re)