Hi all again,
I've discovered a strange behavior with imports and headers.
Considering the two following grammars:
- - - - - - - - - - - - -
parser grammar P1 ;
...
- - - - - - - - - - - - -
grammar P2 ;
import P1 ;
@parser::header {
package acme ;
}
...
- - - - - - - - - - - - -
As expected, ANTLR generates three java files:
P2.java: header present.
P2_P1.java: header present.
P1.java: missing header!
If I add the missing header to P1.g then ANTLR doesn't like it:
>> error(144): P1.g:27:10: redefinition of header action
I guess that two possibly different headers make the choice hard for
generating the P2_P1.java file. Would it be reasonable to "propagate"
the header of the root grammar to all the imported ones?
ANTLR rocks,
c.
List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org:8080/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
-~----------~----~----~----~------~----~------~--~---