Hi All,

I have a rule with multiple choices.

Do I have to add a predicate to all choices or can I add just the predicates
that I want, ie: leaving the more complicated choice without a predicate?

For example:

primary returns [Primary n]
    :    ('(') => l = '(' expression {$n = new PrimaryExpression($expression.n, 
$l.line);} ')'
    |    (NAME) => variable {$n = $variable.n;}
    |    (OPEN_BLOCK) => block {$n = $block.n;}
    |    literal {$n = $literal.n;}
    |    ('{') => array {$n = $array.n;}
    ;


Also, is it possible to add multiple choices to a predicate?

eg: ( this | that | thing ) => xxxx

Rgs, James.

                                          

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to