added uniq error codes

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9426]
This commit is contained in:
parrt 2011-11-22 14:29:06 -08:00
parent 31c24292cd
commit 0d691db980
1 changed files with 109 additions and 115 deletions

View File

@ -41,118 +41,113 @@ package org.antlr.v4.tool;
* @since 4.0 * @since 4.0
*/ */
public enum ErrorType { public enum ErrorType {
INVALID("<INVALID>", ErrorSeverity.ERROR), INVALID(0, "<INVALID>", ErrorSeverity.ERROR),
CANNOT_WRITE_FILE("cannot write file <arg>: <arg2>", ErrorSeverity.ERROR), CANNOT_WRITE_FILE(1, "cannot write file <arg>: <arg2>", ErrorSeverity.ERROR),
CANNOT_CLOSE_FILE("", ErrorSeverity.ERROR), // CANNOT_CLOSE_FILE(2, "cannot close file <arg>", ErrorSeverity.ERROR),
CANNOT_FIND_TOKENS_FILE("cannot find tokens file <arg>", ErrorSeverity.ERROR), CANNOT_FIND_TOKENS_FILE(3, "cannot find tokens file <arg>", ErrorSeverity.ERROR),
ERROR_READING_TOKENS_FILE("cannot find tokens file <arg>: <arg2>", ErrorSeverity.ERROR), ERROR_READING_TOKENS_FILE(4, "cannot find tokens file <arg>: <arg2>", ErrorSeverity.ERROR),
DIR_NOT_FOUND("directory not found: <arg>", ErrorSeverity.ERROR), DIR_NOT_FOUND(5, "directory not found: <arg>", ErrorSeverity.ERROR),
OUTPUT_DIR_IS_FILE("output directory is a file: <arg>", ErrorSeverity.ERROR), OUTPUT_DIR_IS_FILE(6, "output directory is a file: <arg>", ErrorSeverity.ERROR),
CANNOT_OPEN_FILE("cannot find or open file: <arg><if(exception)>; reason: <exception><endif>", ErrorSeverity.ERROR), CANNOT_OPEN_FILE(7, "cannot find or open file: <arg><if(exception)>; reason: <exception><endif>", ErrorSeverity.ERROR),
FILE_AND_GRAMMAR_NAME_DIFFER("grammar name <arg> and file name <arg2> differ", ErrorSeverity.ERROR), FILE_AND_GRAMMAR_NAME_DIFFER(8, "grammar name <arg> and file name <arg2> differ", ErrorSeverity.ERROR),
// FILENAME_EXTENSION_ERROR("", ErrorSeverity.ERROR), // FILENAME_EXTENSION_ERROR("", ErrorSeverity.ERROR),
INTERNAL_ERROR("internal error: <arg> <arg2><if(exception)>: <exception><endif>\n" + INTERNAL_ERROR(20, "internal error: <arg> <arg2><if(exception)>: <exception><endif>\n" +
"<stackTrace; separator=\"\\n\">", ErrorSeverity.ERROR), "<stackTrace; separator=\"\\n\">", ErrorSeverity.ERROR),
INTERNAL_WARNING("", ErrorSeverity.ERROR), TOKENS_FILE_SYNTAX_ERROR(21, ".tokens file syntax error <arg>:<arg2>", ErrorSeverity.ERROR),
TOKENS_FILE_SYNTAX_ERROR("", ErrorSeverity.ERROR), // CANNOT_GEN_DOT_FILE("", ErrorSeverity.ERROR),
CANNOT_GEN_DOT_FILE("", ErrorSeverity.ERROR),
// Code generation errors // Code generation errors
MISSING_CODE_GEN_TEMPLATES("", ErrorSeverity.ERROR), MISSING_CODE_GEN_TEMPLATES(30, "can't find code generation templates: <arg>", ErrorSeverity.ERROR),
CANNOT_CREATE_TARGET_GENERATOR("cannot create target <arg> code generator: <exception>", ErrorSeverity.ERROR), CANNOT_CREATE_TARGET_GENERATOR(31, "cannot create target <arg> code generator: <exception>", ErrorSeverity.ERROR),
CODE_TEMPLATE_ARG_ISSUE("code generation template <arg> has missing, misnamed, or incomplete arg list; missing <arg2>", ErrorSeverity.ERROR), CODE_TEMPLATE_ARG_ISSUE(32, "code generation template <arg> has missing, misnamed, or incomplete arg list; missing <arg2>", ErrorSeverity.ERROR),
CODE_GEN_TEMPLATES_INCOMPLETE("missing code generation template <arg>", ErrorSeverity.ERROR), CODE_GEN_TEMPLATES_INCOMPLETE(33, "missing code generation template <arg>", ErrorSeverity.ERROR),
NO_MODEL_TO_TEMPLATE_MAPPING("no mapping to template name for output model class <arg>", ErrorSeverity.ERROR), NO_MODEL_TO_TEMPLATE_MAPPING(34, "no mapping to template name for output model class <arg>", ErrorSeverity.ERROR),
// Grammar errors // Grammar errors
SYNTAX_ERROR("<arg>", ErrorSeverity.ERROR), SYNTAX_ERROR(50, "<arg>", ErrorSeverity.ERROR),
RULE_REDEFINITION("rule <arg> redefinition", ErrorSeverity.ERROR), RULE_REDEFINITION(51, "rule <arg> redefinition", ErrorSeverity.ERROR),
LEXER_RULES_NOT_ALLOWED("lexer rule <arg> not allowed in parser", ErrorSeverity.ERROR), LEXER_RULES_NOT_ALLOWED(52, "lexer rule <arg> not allowed in parser", ErrorSeverity.ERROR),
PARSER_RULES_NOT_ALLOWED("parser rule <arg> not allowed in lexer", ErrorSeverity.ERROR), PARSER_RULES_NOT_ALLOWED(53, "parser rule <arg> not allowed in lexer", ErrorSeverity.ERROR),
REPEATED_PREQUEL("repeated grammar prequel spec (option, token, or import); please merge", ErrorSeverity.ERROR), REPEATED_PREQUEL(54, "repeated grammar prequel spec (option, token, or import); please merge", ErrorSeverity.ERROR),
NO_TOKEN_DEFINITION("no lexer rule corresponding to token: <arg>", ErrorSeverity.ERROR), NO_TOKEN_DEFINITION(55, "no lexer rule corresponding to token: <arg>", ErrorSeverity.ERROR),
UNDEFINED_RULE_REF("reference to undefined rule: <arg>", ErrorSeverity.ERROR), UNDEFINED_RULE_REF(56, "reference to undefined rule: <arg>", ErrorSeverity.ERROR),
UNDEFINED_RULE_IN_NONLOCAL_REF("reference to undefined rule in nonlocal ref: <arg>::<arg2>", ErrorSeverity.ERROR), UNDEFINED_RULE_IN_NONLOCAL_REF(57, "reference to undefined rule in nonlocal ref: <arg>::<arg2>", ErrorSeverity.ERROR),
LITERAL_NOT_ASSOCIATED_WITH_LEXER_RULE("", ErrorSeverity.ERROR), LITERAL_NOT_ASSOCIATED_WITH_LEXER_RULE(58, "", ErrorSeverity.ERROR),
CANNOT_ALIAS_TOKENS("can't assign string value to token name <arg> in non-combined grammar", ErrorSeverity.ERROR), CANNOT_ALIAS_TOKENS(59, "can't assign string value to token name <arg> in non-combined grammar", ErrorSeverity.ERROR),
TOKEN_NAMES_MUST_START_UPPER("token names must start with an uppercase letter: <arg>", ErrorSeverity.ERROR), TOKEN_NAMES_MUST_START_UPPER(60, "token names must start with an uppercase letter: <arg>", ErrorSeverity.ERROR),
ATTRIBUTE_REF_NOT_IN_RULE("", ErrorSeverity.ERROR), ATTRIBUTE_REF_NOT_IN_RULE(61, "", ErrorSeverity.ERROR),
INVALID_RULE_SCOPE_ATTRIBUTE_REF("", ErrorSeverity.ERROR), INVALID_RULE_SCOPE_ATTRIBUTE_REF(62, "", ErrorSeverity.ERROR),
UNKNOWN_SIMPLE_ATTRIBUTE("unknown attribute reference <arg> in <arg2>", ErrorSeverity.ERROR), UNKNOWN_SIMPLE_ATTRIBUTE(63, "unknown attribute reference <arg> in <arg2>", ErrorSeverity.ERROR),
INVALID_RULE_PARAMETER_REF("cannot access rule <arg>'s parameter: <arg2>", ErrorSeverity.ERROR), INVALID_RULE_PARAMETER_REF(64, "cannot access rule <arg>'s parameter: <arg2>", ErrorSeverity.ERROR),
UNKNOWN_RULE_ATTRIBUTE("unknown attribute <arg> for rule <arg2> in <arg3>", ErrorSeverity.ERROR), UNKNOWN_RULE_ATTRIBUTE(65, "unknown attribute <arg> for rule <arg2> in <arg3>", ErrorSeverity.ERROR),
UNKNOWN_ATTRIBUTE_IN_SCOPE("attribute <arg> isn't a valid property in <arg2>", ErrorSeverity.ERROR), UNKNOWN_ATTRIBUTE_IN_SCOPE(66, "attribute <arg> isn't a valid property in <arg2>", ErrorSeverity.ERROR),
ISOLATED_RULE_REF("missing attribute access on rule reference <arg> in <arg2>", ErrorSeverity.ERROR), ISOLATED_RULE_REF(67, "missing attribute access on rule reference <arg> in <arg2>", ErrorSeverity.ERROR),
SYMBOL_CONFLICTS_WITH_GLOBAL_SCOPE("symbol <arg> conflicts with global dynamic scope with same name", ErrorSeverity.ERROR), SYMBOL_CONFLICTS_WITH_GLOBAL_SCOPE(68, "symbol <arg> conflicts with global dynamic scope with same name", ErrorSeverity.ERROR),
LABEL_CONFLICTS_WITH_RULE("label <arg> conflicts with rule with same name", ErrorSeverity.ERROR), LABEL_CONFLICTS_WITH_RULE(69, "label <arg> conflicts with rule with same name", ErrorSeverity.ERROR),
LABEL_CONFLICTS_WITH_TOKEN("label <arg> conflicts with token with same name", ErrorSeverity.ERROR), LABEL_CONFLICTS_WITH_TOKEN(70, "label <arg> conflicts with token with same name", ErrorSeverity.ERROR),
LABEL_CONFLICTS_WITH_RULE_SCOPE_ATTRIBUTE("label <arg> conflicts with rule <arg2>'s dynamically-scoped attribute with same name", ErrorSeverity.ERROR), LABEL_CONFLICTS_WITH_RULE_SCOPE_ATTRIBUTE(71, "label <arg> conflicts with rule <arg2>'s dynamically-scoped attribute with same name", ErrorSeverity.ERROR),
LABEL_CONFLICTS_WITH_RULE_ARG_RETVAL("label <arg> conflicts with rule <arg2>'s return value or parameter with same name", ErrorSeverity.ERROR), LABEL_CONFLICTS_WITH_RULE_ARG_RETVAL(72, "label <arg> conflicts with rule <arg2>'s return value or parameter with same name", ErrorSeverity.ERROR),
ATTRIBUTE_CONFLICTS_WITH_RULE("rule <arg2>'s dynamically-scoped attribute <arg> conflicts with the rule name", ErrorSeverity.ERROR), ATTRIBUTE_CONFLICTS_WITH_RULE(73, "rule <arg2>'s dynamically-scoped attribute <arg> conflicts with the rule name", ErrorSeverity.ERROR),
ATTRIBUTE_CONFLICTS_WITH_RULE_ARG_RETVAL("rule <arg2>'s dynamically-scoped attribute <arg> conflicts with <arg2>'s return value or parameter", ErrorSeverity.ERROR), ATTRIBUTE_CONFLICTS_WITH_RULE_ARG_RETVAL(74, "rule <arg2>'s dynamically-scoped attribute <arg> conflicts with <arg2>'s return value or parameter", ErrorSeverity.ERROR),
LABEL_TYPE_CONFLICT("label <arg> type mismatch with previous definition: <arg2>", ErrorSeverity.ERROR), LABEL_TYPE_CONFLICT(75, "label <arg> type mismatch with previous definition: <arg2>", ErrorSeverity.ERROR),
ARG_RETVAL_CONFLICT("rule <arg2>'s argument <arg> conflicts a return value with same name", ErrorSeverity.ERROR), ARG_RETVAL_CONFLICT(76, "rule <arg2>'s argument <arg> conflicts a return value with same name", ErrorSeverity.ERROR),
NONUNIQUE_REF("arg> is a non-unique reference", ErrorSeverity.ERROR), NONUNIQUE_REF(77, "arg> is a non-unique reference", ErrorSeverity.ERROR),
FORWARD_ELEMENT_REF("", ErrorSeverity.ERROR), FORWARD_ELEMENT_REF(78, "", ErrorSeverity.ERROR),
MISSING_RULE_ARGS("missing parameter(s) on rule reference: <arg>", ErrorSeverity.ERROR), MISSING_RULE_ARGS(79, "missing parameter(s) on rule reference: <arg>", ErrorSeverity.ERROR),
RULE_HAS_NO_ARGS("rule <arg> has no defined parameters", ErrorSeverity.ERROR), RULE_HAS_NO_ARGS(80, "rule <arg> has no defined parameters", ErrorSeverity.ERROR),
ARGS_ON_TOKEN_REF("token reference <arg> may not have parameters", ErrorSeverity.ERROR), ARGS_ON_TOKEN_REF(81, "token reference <arg> may not have parameters", ErrorSeverity.ERROR),
RULE_REF_AMBIG_WITH_RULE_IN_ALT("", ErrorSeverity.ERROR), RULE_REF_AMBIG_WITH_RULE_IN_ALT(82, "", ErrorSeverity.ERROR),
ILLEGAL_OPTION("illegal option <arg>", ErrorSeverity.WARNING), ILLEGAL_OPTION(83, "illegal option <arg>", ErrorSeverity.WARNING),
ILLEGAL_OPTION_VALUE("illegal option value <arg>=<arg2>", ErrorSeverity.WARNING), ILLEGAL_OPTION_VALUE(84, "illegal option value <arg>=<arg2>", ErrorSeverity.WARNING),
LIST_LABEL_INVALID_UNLESS_RETVAL_STRUCT("", ErrorSeverity.ERROR), LIST_LABEL_INVALID_UNLESS_RETVAL_STRUCT(85, "", ErrorSeverity.ERROR),
REWRITE_ELEMENT_NOT_PRESENT_ON_LHS("reference to rewrite element <arg> not found to left of ->", ErrorSeverity.ERROR), REWRITE_ELEMENT_NOT_PRESENT_ON_LHS(86, "reference to rewrite element <arg> not found to left of ->", ErrorSeverity.ERROR),
UNDEFINED_TOKEN_REF_IN_REWRITE("token <arg> in rewrite is undefined", ErrorSeverity.ERROR), UNDEFINED_TOKEN_REF_IN_REWRITE(87, "token <arg> in rewrite is undefined", ErrorSeverity.ERROR),
///UNDEFINED_LABEL_REF_IN_REWRITE("", ErrorSeverity.ERROR), use previous ///UNDEFINED_LABEL_REF_IN_REWRITE(, "", ErrorSeverity.ERROR), use previous
NO_GRAMMAR_START_RULE("", ErrorSeverity.ERROR), NO_GRAMMAR_START_RULE(88, "", ErrorSeverity.ERROR),
EMPTY_COMPLEMENT("", ErrorSeverity.ERROR), EMPTY_COMPLEMENT(89, "empty complement", ErrorSeverity.ERROR),
UNKNOWN_DYNAMIC_SCOPE("unknown dynamic scope: <arg> in <arg2>", ErrorSeverity.ERROR), UNKNOWN_DYNAMIC_SCOPE(90, "unknown dynamic scope: <arg> in <arg2>", ErrorSeverity.ERROR),
UNKNOWN_DYNAMIC_SCOPE_ATTRIBUTE("unknown dynamically-scoped attribute for scope <arg>: <arg2> in <arg3>", ErrorSeverity.ERROR), UNKNOWN_DYNAMIC_SCOPE_ATTRIBUTE(91, "unknown dynamically-scoped attribute for scope <arg>: <arg2> in <arg3>", ErrorSeverity.ERROR),
ISOLATED_RULE_ATTRIBUTE("", ErrorSeverity.ERROR), ISOLATED_RULE_ATTRIBUTE(92, "", ErrorSeverity.ERROR),
INVALID_ACTION_SCOPE("", ErrorSeverity.ERROR), INVALID_ACTION_SCOPE(93, "", ErrorSeverity.ERROR),
ACTION_REDEFINITION("redefinition of <arg> action", ErrorSeverity.ERROR), ACTION_REDEFINITION(94, "redefinition of <arg> action", ErrorSeverity.ERROR),
SCOPE_REDEFINITION("scope <arg> redefinition", ErrorSeverity.ERROR), SCOPE_REDEFINITION(95, "scope <arg> redefinition", ErrorSeverity.ERROR),
INVALID_TEMPLATE_ACTION("invalid StringTemplate % shorthand syntax: '<arg>'", ErrorSeverity.ERROR), INVALID_TEMPLATE_ACTION(96, "invalid StringTemplate % shorthand syntax: '<arg>'", ErrorSeverity.ERROR),
ARG_INIT_VALUES_ILLEGAL("", ErrorSeverity.ERROR), ARG_INIT_VALUES_ILLEGAL(97, "", ErrorSeverity.ERROR),
REWRITE_OR_OP_WITH_NO_OUTPUT_OPTION("<if(arg)>rule <arg> uses <endif>rewrite syntax or operator with no output option", ErrorSeverity.ERROR), REWRITE_OR_OP_WITH_NO_OUTPUT_OPTION(98, "<if(arg)>rule <arg> uses <endif>rewrite syntax or operator with no output option", ErrorSeverity.ERROR),
NO_RULES("<if(arg2.implicitLexerOwner)>implicitly generated <endif>grammar <arg> has no rules", ErrorSeverity.ERROR), NO_RULES(99, "<if(arg2.implicitLexerOwner)>implicitly generated <endif>grammar <arg> has no rules", ErrorSeverity.ERROR),
WRITE_TO_READONLY_ATTR("", ErrorSeverity.ERROR), WRITE_TO_READONLY_ATTR(100, "", ErrorSeverity.ERROR),
MISSING_AST_TYPE_IN_TREE_GRAMMAR("", ErrorSeverity.ERROR), MISSING_AST_TYPE_IN_TREE_GRAMMAR(101, "", ErrorSeverity.ERROR),
REWRITE_FOR_MULTI_ELEMENT_ALT("with rewrite=true, alt <arg> not simple node or obvious tree element; text attribute for rule not guaranteed to be correct", ErrorSeverity.ERROR), REWRITE_FOR_MULTI_ELEMENT_ALT(102, "with rewrite=true, alt <arg> not simple node or obvious tree element; text attribute for rule not guaranteed to be correct", ErrorSeverity.ERROR),
RULE_INVALID_SET("", ErrorSeverity.ERROR), RULE_INVALID_SET(103, "", ErrorSeverity.ERROR),
HETERO_ILLEGAL_IN_REWRITE_ALT("alts with rewrites can't use heterogeneous types left of ->", ErrorSeverity.ERROR), HETERO_ILLEGAL_IN_REWRITE_ALT(104, "alts with rewrites can't use heterogeneous types left of ->", ErrorSeverity.ERROR),
NO_SUCH_GRAMMAR_SCOPE("reference to undefined grammar in rule reference: <arg>.<arg2>", ErrorSeverity.ERROR), NO_SUCH_GRAMMAR_SCOPE(105, "reference to undefined grammar in rule reference: <arg>.<arg2>", ErrorSeverity.ERROR),
NO_SUCH_RULE_IN_SCOPE("rule <arg2> is not defined in grammar <arg>", ErrorSeverity.ERROR), NO_SUCH_RULE_IN_SCOPE(106, "rule <arg2> is not defined in grammar <arg>", ErrorSeverity.ERROR),
TOKEN_STRING_REASSIGNMENT("cannot alias <arg>; string already assigned to <arg2>", ErrorSeverity.ERROR), TOKEN_STRING_REASSIGNMENT(107, "cannot alias <arg>; string already assigned to <arg2>", ErrorSeverity.ERROR),
TOKEN_NAME_REASSIGNMENT("cannot redefine <arg>; token name already <if(arg2)>assigned to <arg2><else>defined<endif>", ErrorSeverity.ERROR), TOKEN_NAME_REASSIGNMENT(108, "cannot redefine <arg>; token name already <if(arg2)>assigned to <arg2><else>defined<endif>", ErrorSeverity.ERROR),
//TOKEN_VOCAB_IN_DELEGATE("tokenVocab option ignored in imported grammar <arg>", ErrorSeverity.ERROR), //TOKEN_VOCAB_IN_DELEGATE(, "tokenVocab option ignored in imported grammar <arg>", ErrorSeverity.ERROR),
OPTIONS_IN_DELEGATE("options ignored in imported grammar <arg>", ErrorSeverity.WARNING), OPTIONS_IN_DELEGATE(109, "options ignored in imported grammar <arg>", ErrorSeverity.WARNING),
// TOKEN_ALIAS_IN_DELEGATE("can't assign string to token name <arg> to string in imported grammar <arg2>", ErrorSeverity.ERROR), // TOKEN_ALIAS_IN_DELEGATE(, "can't assign string to token name <arg> to string in imported grammar <arg2>", ErrorSeverity.ERROR),
CANNOT_FIND_IMPORTED_FILE("can't find or load grammar <arg> from <arg2>", ErrorSeverity.ERROR), CANNOT_FIND_IMPORTED_FILE(110, "can't find or load grammar <arg> from <arg2>", ErrorSeverity.ERROR),
INVALID_IMPORT("<arg.typeString> grammar <arg.name> cannot import <arg2.typeString> grammar <arg2.name>", ErrorSeverity.ERROR), INVALID_IMPORT(111, "<arg.typeString> grammar <arg.name> cannot import <arg2.typeString> grammar <arg2.name>", ErrorSeverity.ERROR),
IMPORTED_TOKENS_RULE_EMPTY("", ErrorSeverity.ERROR), IMPORTED_TOKENS_RULE_EMPTY(112, "", ErrorSeverity.ERROR),
IMPORT_NAME_CLASH("<arg.typeString> grammar <arg.name> and imported <arg2.typeString> grammar <arg2.name> both generate <arg2.recognizerName>", ErrorSeverity.ERROR), IMPORT_NAME_CLASH(113, "<arg.typeString> grammar <arg.name> and imported <arg2.typeString> grammar <arg2.name> both generate <arg2.recognizerName>", ErrorSeverity.ERROR),
AST_OP_WITH_NON_AST_OUTPUT_OPTION("AST operator with non-AST output option: <arg>", ErrorSeverity.ERROR), AST_OP_WITH_NON_AST_OUTPUT_OPTION(114, "AST operator with non-AST output option: <arg>", ErrorSeverity.ERROR),
AST_OP_IN_ALT_WITH_REWRITE("rule <arg> alt <arg2> uses rewrite syntax and also an AST operator", ErrorSeverity.ERROR), AST_OP_IN_ALT_WITH_REWRITE(115, "rule <arg> alt <arg2> uses rewrite syntax and also an AST operator", ErrorSeverity.ERROR),
WILDCARD_AS_ROOT("Wildcard invalid as root; wildcard can itself be a tree", ErrorSeverity.ERROR), WILDCARD_AS_ROOT(116, "Wildcard invalid as root; wildcard can itself be a tree", ErrorSeverity.ERROR),
CONFLICTING_OPTION_IN_TREE_FILTER("option <arg>=<arg2> conflicts with tree grammar filter mode", ErrorSeverity.ERROR), CONFLICTING_OPTION_IN_TREE_FILTER(117, "option <arg>=<arg2> conflicts with tree grammar filter mode", ErrorSeverity.ERROR),
ALL_OPS_NEED_SAME_ASSOC("all operators of alt <alt> of left-recursive rule must have same associativity", ErrorSeverity.WARNING), ALL_OPS_NEED_SAME_ASSOC(118, "all operators of alt <alt> of left-recursive rule must have same associativity", ErrorSeverity.WARNING),
LEFT_RECURSION_CYCLES(119, "The following sets of rules are mutually left-recursive <arg:{c| [<c:{r|<r.name>}; separator=\", \">]}; separator=\" and \">", ErrorSeverity.ERROR),
// these next 3 can happen in recursion-limited LL("", *) MODE_NOT_IN_LEXER(120, "lexical modes are only allowed in lexer grammars", ErrorSeverity.ERROR),
//RECURSION_OVERFLOW("", ErrorSeverity.ERROR),
LEFT_RECURSION_CYCLES("The following sets of rules are mutually left-recursive <arg:{c| [<c:{r|<r.name>}; separator=\", \">]}; separator=\" and \">", ErrorSeverity.ERROR),
MODE_NOT_IN_LEXER("lexical modes are only allowed in lexer grammars", ErrorSeverity.ERROR),
/** Documentation comment is unterminated */ /** Documentation comment is unterminated */
//UNTERMINATED_DOC_COMMENT("", ErrorSeverity.ERROR), //UNTERMINATED_DOC_COMMENT(, "", ErrorSeverity.ERROR),
// Dependency sorting errors // Dependency sorting errors
// //
/** t1.g -> t2.g -> t3.g ->t1.g */ /** t1.g -> t2.g -> t3.g ->t1.g */
CIRCULAR_DEPENDENCY("your grammars contain a circular dependency and cannot be sorted into a valid build order", ErrorSeverity.ERROR), CIRCULAR_DEPENDENCY(130, "your grammars contain a circular dependency and cannot be sorted into a valid build order", ErrorSeverity.ERROR),
// Simple informational messages // Simple informational messages
// //
@ -188,26 +183,25 @@ public enum ErrorType {
; ;
public String msg; public String msg;
public int code; // unique, deterministic unchanging error code once we release
public ErrorSeverity severity; public ErrorSeverity severity;
public Boolean abortsAnalysis; public Boolean abortsAnalysis;
public Boolean abortsCodegen; public Boolean abortsCodegen;
ErrorType(String msg) { ErrorType(int code, String msg, ErrorSeverity severity) {
this(msg, ErrorSeverity.ERROR); this.code = code;
}
ErrorType(String msg, ErrorSeverity severity) {
this(msg, severity, false);
}
ErrorType(String msg, ErrorSeverity severity, boolean abortsAnalysis) {
this(msg, severity, abortsAnalysis, false);
}
ErrorType(String msg, ErrorSeverity severity, boolean abortsAnalysis, boolean abortsCodegen) {
this.msg = msg; this.msg = msg;
this.severity = severity; this.severity = severity;
this.abortsAnalysis = abortsAnalysis;
this.abortsCodegen = abortsCodegen;
} }
// ErrorType(String msg, ErrorSeverity severity, boolean abortsAnalysis) {
// this(msg, severity, abortsAnalysis, false);
// }
// ErrorType(String msg, ErrorSeverity severity, boolean abortsAnalysis, boolean abortsCodegen) {
// this.msg = msg;
// this.severity = severity;
// this.abortsAnalysis = abortsAnalysis;
// this.abortsCodegen = abortsCodegen;
// }
} }