[antlr-interest] #include mechanism for grammar files?
g4 at novadsp.com
g4 at novadsp.com
Sun Mar 13 07:48:53 PDT 2011
Hi Bart
Just the ticket. Thanks.
On 13/03/2011 14:37, Bart Kiers wrote:
> Hi Jerry,.
>
> On Sun, Mar 13, 2011 at 3:33 PM, g4 at novadsp.com <mailto:g4 at novadsp.com>
> <g4 at novadsp.com <mailto:g4 at novadsp.com>> wrote:
>
> Sorry! Must remember to post plain-text only.
>
> It would be useful to be able to #include a file in a grammar. use case:
> grammar is generated by another tool but the lexer definitions are not.
>
> i.e.
>
> grammar auto
> ...
>
> #include auto_lexer.g
>
> Is there a way to do this with the grammar spread over 2 files?
>
>
> Yes, in ANTLR this is called "composite grammars".
> Have a look at: http://www.antlr.org/wiki/display/ANTLR3/Composite+Grammars
>
> Regards,
>
> Bart.
>
More information about the antlr-interest
mailing list