[antlr-interest] compilation error on grammar

Kay Roepke kroepke at classdump.org
Thu Aug 2 18:02:32 PDT 2007


On Aug 3, 2007, at 2:56 AM, Randall R Schulz wrote:

>> Definitely, I know I've seen the option for declaring a package in
>> the grammar in one of the examples, but have been unable to find it
>> to correct that particular issue.
>
> @header {
> package			this.that.thenextthing;
>
> ...
> }

while that is the correct usage, it doesn't answer the question :\

the answer: you can't name parser rules the same as reserved words in  
Java,
as the rule name is used as a method name. So anything like return,  
if, package
and the like are out.

cheers,
-k
-- 
Kay Röpke
http://classdump.org/






More information about the antlr-interest mailing list