At 07:00 21/04/2009, Kumar Rangarajan wrote:
>> @parser::header {
>> package foo;
>> }
>> @lexer::header {
>> package foo;
>> }
>
>Sorry, missed replying for this reply. Thanks, Gavin for your
>suggestion. But I tried this, but this does seem to work as
>Antlr does seem to allow both @parser::header and @lexer::header
>sections in the composite grammar. By default it seems to treat
>the grammar as a parser grammar and adding '@lexer' triggers an
error.
Looks like you forgot a couple of "not"s... :)
What is the first line of your grammar file? It should be just
"grammar Foo;", not "parser grammar Foo;", if you want to include
lexer rules within it. (If you have a separate lexer grammar
anyway, then it's not an issue -- just define the package in both
the lexer and the parser separately.)
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
-~----------~----~----~----~------~----~------~--~---