[antlr-interest] Rule return type limitations?

Randall R Schulz rschulz at sonic.net
Sun Oct 14 17:56:41 PDT 2007


On Sunday 14 October 2007 17:37, Rick Mann wrote:
> I would like to return an arbitrary object type from one of my rules
> (an object I've defined outside of the grammar):
>
> ...
>
>
> Can I do this? What are the limitations on the return types?

Try this:

sendCommand
    :   'send' bytes Semicolon
        {
            System.out.println("Sending " + $bytes.outBytes.toString());
        }
    ;


Randall Schulz


More information about the antlr-interest mailing list