Actually this rule should just ref RULE_REF:

> ruleref
>    :  
>       (       ^((ROOT|BANG) r=RULE_REF ARG_ACTION?)
>           |   ^(r=RULE_REF ARG_ACTION?)
>           )
>           {
>           if ( gtype==LEXER_GRAMMAR && 
> Character.isLowerCase($r.text.charAt(0)) ) {
>               ErrorManager.grammarError(ErrorType.PARSER_RULES_NOT_ALLOWED,
>                                                             fileName, 
> $r.token, $r.text);
>               }
>               }
>    ;

like this:

ruleref
    :   RULE_REF
        {BasicSemanticChecks.checkInvalidRuleRef(gtype, fileName, 
$RULE_REF.token);}
    ;

That's all we care about. the beauty of tree pattern matcher!

Ter
_______________________________________________
antlr-dev mailing list
[email protected]
http://www.antlr.org/mailman/listinfo/antlr-dev

Reply via email to