[antlr-interest] rules that takes rules as arguments

Bart Kiers bkiers at gmail.com
Thu May 5 11:42:24 PDT 2011


Both parser- and lexer rules can take parameters of any (Java) type.
However, rules in ANTLR are "translated" to methods, and methods aren't
first class objects in Java. So providing a rule (read: method) to another
rule as parameter is not possible.

Perhaps you can elaborate a bit and explain what problem you're trying to
solve?

Regards,

Bart.


On Tue, May 3, 2011 at 7:29 PM, Vladimir VG <gordeev.vladimir.v at gmail.com>wrote:

> I'm defining some grouping rule ( '(' value ')' ) for operator precedence,
> and it will be helpful if I would use rules that takes other rules as
> arguments.
>
> Is that possible?
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>


More information about the antlr-interest mailing list