...
- FILE_AND_GRAMMAR_NAME_DIFFER
- LEXER_RULES_NOT_ALLOWED
- PARSER_RULES_NOT_ALLOWED
- CANNOT_ALIAS_TOKENS_IN_LEXER
- ARGS_ON_TOKEN_REF
- ILLEGAL_OPTION
- NO_RULES
- REWRITE_FOR_MULTI_ELEMENT_ALT
- HETERO_ILLEGAL_IN_REWRITE_ALT
- AST_OP_WITH_NON_AST_OUTPUT_OPTION
- AST_OP_IN_ALT_WITH_REWRITE
- CONFLICTING_OPTION_IN_TREE_FILTER
- WILDCARD_AS_ROOT
- INVALID_IMPORT
- TOKEN_VOCAB_IN_DELEGATE
- IMPORT_NAME_CLASH(arg,arg2) ::= "<arg.typeString> grammar <arg.name> and imported <arg2.typeString> grammar <arg2.name> both generate <arg2.recognizerName>" If we are importing a grammar into a combined grammar C and imported grammar I, I must not be CLexer or CParser
- REWRITE_OR_OP_WITH_NO_OUTPUT_OPTION
- new errors:
- REPEATED_PREQUEL; repeated options or tokens spec (since we allow in any order now)
- TOKEN_NAMES_MUST_START_UPPER
...
- NONUNIQUE_REF(arg) ::= "<arg> is a non-unique reference"
- FORWARD_ELEMENT_REF(arg) ::= "illegal forward reference: <arg>"
- ?? WRITE_TO_READONLY_ATTR(arg,arg2,arg3) ::= "cannot write to read only attribute: $<arg><if(arg2)>.<arg2><endif>"
- ?? RULE_REF_AMBIG_WITH_RULE_IN_ALT
Imported grammars
Put into symbols checker.
DONE 2/17/2010
- NO_SUCH_GRAMMAR_SCOPE(arg,arg2) ::= "reference to undefined grammar in rule reference: <arg>.<arg2>"
- NO_SUCH_RULE_IN_SCOPE(arg,arg2) ::= "rule <arg2> is not defined in grammar <arg>"
- IMPORTED_TOKENS_RULE_EMPTY(arg,arg2) ::= "no lexer rules contributed to <arg> from imported grammar <arg2>"
- IMPORT_NAME_CLASH(arg,arg2) ::= "<arg.typeString> grammar <arg.name> and imported <arg2.typeString> grammar <arg2.name> both generate <arg2.recognizerName>"
Unsure:
- RULE_INVALID_SET
- TOKEN_ALIAS_CONFLICT (In combined only. Need to compare tokens def in combined with lexer rule in implicit lexer)
- IMPORTED_TOKENS_RULE_EMPTY(arg,arg2) ::= "no lexer rules contributed to <arg> from imported grammar <arg2>" This is for unreachable alts when dfa is Tokens rule. This is more of an LL decision thing.
Implementation notes
I have to say: tree pattern matchers kick ass! Instead of specifying an entire tree grammar or tree visitor, you specify the patterns of interest and then an action to execute if they match. This is like using an awk script. I'm using two of them so far as I start to build this v4. The first thing I use it for is to do the basic semantic checking. BasicSemanticTriggers.g has rules like this
...