public class ErrorManager extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ErrorManager.ErrorState |
Constructor and Description |
---|
ErrorManager() |
Modifier and Type | Method and Description |
---|---|
static void |
analysisAborted(DecisionProbe probe) |
static void |
assertTrue(boolean condition,
String message) |
static void |
danglingState(DecisionProbe probe,
DFAState d) |
static boolean |
doNotAttemptAnalysis() |
static boolean |
doNotAttemptCodeGen() |
static void |
error(int msgID) |
static void |
error(int msgID,
Object arg) |
static void |
error(int msgID,
Object arg,
Object arg2) |
static void |
error(int msgID,
Object arg,
Throwable e) |
static void |
error(int msgID,
Throwable e) |
static boolean |
formatWantsSingleLineMessage() |
static ANTLRErrorListener |
getErrorListener() |
static ErrorManager.ErrorState |
getErrorState() |
static org.stringtemplate.v4.ST |
getLocationFormat()
Return a ST that refers to the current format used for
emitting messages.
|
static org.stringtemplate.v4.ST |
getMessage(int msgID)
Given a message ID, return a ST that somebody can fill
with data.
|
static org.stringtemplate.v4.ST |
getMessageFormat() |
static String |
getMessageType(int msgID) |
static int |
getNumErrors() |
static org.stringtemplate.v4.ST |
getReportFormat() |
static org.stringtemplate.v4.STErrorListener |
getSTErrorListener() |
static void |
grammarError(int msgID,
Grammar g,
Token token) |
static void |
grammarError(int msgID,
Grammar g,
Token token,
Object arg) |
static void |
grammarError(int msgID,
Grammar g,
Token token,
Object arg,
Object arg2) |
static void |
grammarWarning(int msgID,
Grammar g,
Token token) |
static void |
grammarWarning(int msgID,
Grammar g,
Token token,
Object arg) |
static void |
grammarWarning(int msgID,
Grammar g,
Token token,
Object arg,
Object arg2) |
static void |
info(String msg) |
protected static boolean |
initIdToMessageNameMapping() |
static void |
insufficientPredicates(DecisionProbe probe,
DFAState d,
Map<Integer,Set<Token>> altToUncoveredLocations) |
static void |
internalError(Object error) |
static void |
internalError(Object error,
Throwable e) |
static void |
leftRecursionCycles(Collection<? extends Set<? extends Rule>> cycles) |
static void |
nondeterminism(DecisionProbe probe,
DFAState d) |
static void |
nonLLStarDecision(DecisionProbe probe) |
static void |
panic()
I *think* this will allow Tool subclasses to exit gracefully
for GUIs etc...
|
static void |
recursionOverflow(DecisionProbe probe,
DFAState sampleBadState,
int alt,
Collection<String> targetRules,
Collection<? extends Collection<? extends NFAState>> callSiteStates) |
static void |
removeErrorListener() |
static void |
resetErrorState() |
static void |
setErrorListener(ANTLRErrorListener listener)
In general, you'll want all errors to go to a single spot.
|
static void |
setFormat(String formatName)
The format gets reset either from the Tool if the user supplied a command line option to that effect
Otherwise we just use the default "antlr".
|
static void |
setLocale(Locale locale)
We really only need a single locale for entire running ANTLR code
in a single VM.
|
static void |
setTool(Tool tool) |
static void |
syntaxError(int msgID,
Grammar grammar,
Token token,
Object arg,
RecognitionException re) |
static void |
unreachableAlts(DecisionProbe probe,
List<Integer> alts) |
protected static boolean |
verifyFormat()
Verify the message format template group
|
protected static boolean |
verifyMessages()
Use reflection to find list of MSG_ fields and then verify a
template exists for each one from the locale's group.
|
static void |
warning(int msgID,
Object arg) |
public static final int MSG_CANNOT_WRITE_FILE
public static final int MSG_CANNOT_CLOSE_FILE
public static final int MSG_CANNOT_FIND_TOKENS_FILE
public static final int MSG_ERROR_READING_TOKENS_FILE
public static final int MSG_DIR_NOT_FOUND
public static final int MSG_OUTPUT_DIR_IS_FILE
public static final int MSG_CANNOT_OPEN_FILE
public static final int MSG_FILE_AND_GRAMMAR_NAME_DIFFER
public static final int MSG_FILENAME_EXTENSION_ERROR
public static final int MSG_INTERNAL_ERROR
public static final int MSG_INTERNAL_WARNING
public static final int MSG_ERROR_CREATING_ARTIFICIAL_RULE
public static final int MSG_TOKENS_FILE_SYNTAX_ERROR
public static final int MSG_CANNOT_GEN_DOT_FILE
public static final int MSG_BAD_AST_STRUCTURE
public static final int MSG_BAD_ACTION_AST_STRUCTURE
public static final int MSG_MISSING_CODE_GEN_TEMPLATES
public static final int MSG_MISSING_CYCLIC_DFA_CODE_GEN_TEMPLATES
public static final int MSG_CODE_GEN_TEMPLATES_INCOMPLETE
public static final int MSG_CANNOT_CREATE_TARGET_GENERATOR
public static final int MSG_STRING_TEMPLATE_ERROR
public static final int MSG_SYNTAX_ERROR
public static final int MSG_RULE_REDEFINITION
public static final int MSG_LEXER_RULES_NOT_ALLOWED
public static final int MSG_PARSER_RULES_NOT_ALLOWED
public static final int MSG_CANNOT_FIND_ATTRIBUTE_NAME_IN_DECL
public static final int MSG_NO_TOKEN_DEFINITION
public static final int MSG_UNDEFINED_RULE_REF
public static final int MSG_LITERAL_NOT_ASSOCIATED_WITH_LEXER_RULE
public static final int MSG_CANNOT_ALIAS_TOKENS_IN_LEXER
public static final int MSG_ATTRIBUTE_REF_NOT_IN_RULE
public static final int MSG_INVALID_RULE_SCOPE_ATTRIBUTE_REF
public static final int MSG_UNKNOWN_ATTRIBUTE_IN_SCOPE
public static final int MSG_UNKNOWN_SIMPLE_ATTRIBUTE
public static final int MSG_INVALID_RULE_PARAMETER_REF
public static final int MSG_UNKNOWN_RULE_ATTRIBUTE
public static final int MSG_ISOLATED_RULE_SCOPE
public static final int MSG_SYMBOL_CONFLICTS_WITH_GLOBAL_SCOPE
public static final int MSG_LABEL_CONFLICTS_WITH_RULE
public static final int MSG_LABEL_CONFLICTS_WITH_TOKEN
public static final int MSG_LABEL_CONFLICTS_WITH_RULE_SCOPE_ATTRIBUTE
public static final int MSG_LABEL_CONFLICTS_WITH_RULE_ARG_RETVAL
public static final int MSG_ATTRIBUTE_CONFLICTS_WITH_RULE
public static final int MSG_ATTRIBUTE_CONFLICTS_WITH_RULE_ARG_RETVAL
public static final int MSG_LABEL_TYPE_CONFLICT
public static final int MSG_ARG_RETVAL_CONFLICT
public static final int MSG_NONUNIQUE_REF
public static final int MSG_FORWARD_ELEMENT_REF
public static final int MSG_MISSING_RULE_ARGS
public static final int MSG_RULE_HAS_NO_ARGS
public static final int MSG_ARGS_ON_TOKEN_REF
public static final int MSG_RULE_REF_AMBIG_WITH_RULE_IN_ALT
public static final int MSG_ILLEGAL_OPTION
public static final int MSG_LIST_LABEL_INVALID_UNLESS_RETVAL_STRUCT
public static final int MSG_UNDEFINED_TOKEN_REF_IN_REWRITE
public static final int MSG_REWRITE_ELEMENT_NOT_PRESENT_ON_LHS
public static final int MSG_UNDEFINED_LABEL_REF_IN_REWRITE
public static final int MSG_NO_GRAMMAR_START_RULE
public static final int MSG_EMPTY_COMPLEMENT
public static final int MSG_UNKNOWN_DYNAMIC_SCOPE
public static final int MSG_UNKNOWN_DYNAMIC_SCOPE_ATTRIBUTE
public static final int MSG_ISOLATED_RULE_ATTRIBUTE
public static final int MSG_INVALID_ACTION_SCOPE
public static final int MSG_ACTION_REDEFINITION
public static final int MSG_DOUBLE_QUOTES_ILLEGAL
public static final int MSG_INVALID_TEMPLATE_ACTION
public static final int MSG_MISSING_ATTRIBUTE_NAME
public static final int MSG_ARG_INIT_VALUES_ILLEGAL
public static final int MSG_REWRITE_OR_OP_WITH_NO_OUTPUT_OPTION
public static final int MSG_NO_RULES
public static final int MSG_WRITE_TO_READONLY_ATTR
public static final int MSG_MISSING_AST_TYPE_IN_TREE_GRAMMAR
public static final int MSG_REWRITE_FOR_MULTI_ELEMENT_ALT
public static final int MSG_RULE_INVALID_SET
public static final int MSG_HETERO_ILLEGAL_IN_REWRITE_ALT
public static final int MSG_NO_SUCH_GRAMMAR_SCOPE
public static final int MSG_NO_SUCH_RULE_IN_SCOPE
public static final int MSG_TOKEN_ALIAS_CONFLICT
public static final int MSG_TOKEN_ALIAS_REASSIGNMENT
public static final int MSG_TOKEN_VOCAB_IN_DELEGATE
public static final int MSG_INVALID_IMPORT
public static final int MSG_IMPORTED_TOKENS_RULE_EMPTY
public static final int MSG_IMPORT_NAME_CLASH
public static final int MSG_AST_OP_WITH_NON_AST_OUTPUT_OPTION
public static final int MSG_AST_OP_IN_ALT_WITH_REWRITE
public static final int MSG_WILDCARD_AS_ROOT
public static final int MSG_CONFLICTING_OPTION_IN_TREE_FILTER
public static final int MSG_ILLEGAL_OPTION_VALUE
public static final int MSG_ALL_OPS_NEED_SAME_ASSOC
public static final int MSG_RANGE_OP_ILLEGAL
public static final int MSG_GRAMMAR_NONDETERMINISM
public static final int MSG_UNREACHABLE_ALTS
public static final int MSG_DANGLING_STATE
public static final int MSG_INSUFFICIENT_PREDICATES
public static final int MSG_DUPLICATE_SET_ENTRY
public static final int MSG_ANALYSIS_ABORTED
public static final int MSG_RECURSION_OVERLOW
public static final int MSG_LEFT_RECURSION
public static final int MSG_UNREACHABLE_TOKENS
public static final int MSG_TOKEN_NONDETERMINISM
public static final int MSG_LEFT_RECURSION_CYCLES
public static final int MSG_NONREGULAR_DECISION
public static final int MSG_CIRCULAR_DEPENDENCY
public static final int MAX_MESSAGE_NUMBER
public static final BitSet ERRORS_FORCING_NO_ANALYSIS
public static final BitSet ERRORS_FORCING_NO_CODEGEN
public static org.stringtemplate.v4.STErrorListener getSTErrorListener()
public static void setLocale(Locale locale)
public static void setFormat(String formatName)
public static void setErrorListener(ANTLRErrorListener listener)
public static void removeErrorListener()
public static void setTool(Tool tool)
public static org.stringtemplate.v4.ST getMessage(int msgID)
public static String getMessageType(int msgID)
public static org.stringtemplate.v4.ST getLocationFormat()
public static org.stringtemplate.v4.ST getReportFormat()
public static org.stringtemplate.v4.ST getMessageFormat()
public static boolean formatWantsSingleLineMessage()
public static ANTLRErrorListener getErrorListener()
public static ErrorManager.ErrorState getErrorState()
public static int getNumErrors()
public static void resetErrorState()
public static void info(String msg)
public static void error(int msgID)
public static void error(int msgID, Throwable e)
public static void error(int msgID, Object arg)
public static void warning(int msgID, Object arg)
public static void nondeterminism(DecisionProbe probe, DFAState d)
public static void danglingState(DecisionProbe probe, DFAState d)
public static void analysisAborted(DecisionProbe probe)
public static void unreachableAlts(DecisionProbe probe, List<Integer> alts)
public static void insufficientPredicates(DecisionProbe probe, DFAState d, Map<Integer,Set<Token>> altToUncoveredLocations)
public static void nonLLStarDecision(DecisionProbe probe)
public static void recursionOverflow(DecisionProbe probe, DFAState sampleBadState, int alt, Collection<String> targetRules, Collection<? extends Collection<? extends NFAState>> callSiteStates)
public static void leftRecursionCycles(Collection<? extends Set<? extends Rule>> cycles)
public static void grammarError(int msgID, Grammar g, Token token, Object arg, Object arg2)
public static void grammarWarning(int msgID, Grammar g, Token token, Object arg, Object arg2)
public static void syntaxError(int msgID, Grammar grammar, Token token, Object arg, RecognitionException re)
public static void internalError(Object error)
public static boolean doNotAttemptAnalysis()
public static boolean doNotAttemptCodeGen()
public static void assertTrue(boolean condition, String message)
protected static boolean initIdToMessageNameMapping()
protected static boolean verifyMessages()
protected static boolean verifyFormat()
public static void panic()
Copyright © 1992–2015 ANTLR. All rights reserved.