[antlr-interest] line 0:-1 mismatched input '<EOF>' expecting PACKAGE

William H. Schultz whschultz at cedrus.com
Mon Apr 13 10:17:39 PDT 2009


On Apr 7, 2009, at 3:18 PM, YINGAnnie wrote:

>
>
> Hi all,
>
> Everytime when I run the program, I got this error. Here is the  
> grammar of packageDeclaration
>
> packageDeclaration
> @init {
>     tokens = (ASTokenRewriteStream)input;
>     Token start = input.LT(1);
> }
>     :   PACKAGE   type? '{' packageElement*   
> '}'                                       -> ^(PACKAGE_DECL type?  
> packageElement* )
>     ;
>
>
> Is there something wrong?
>
> A

I've seen this a few times, too, but I'm still a little bit of a  
Newbie.  I've run into times where simply renaming a rule fixes an  
issue.  I ran into this last week, but I don't remember what the  
actual issue wound up being.  Anyway, my hunch is that you might need  
to rename "type."  Maybe it conflicts with something else in the  
namespace.


-------------------------------
Hank Schultz
Cedrus Corporation
http://www.cedrus.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090413/37c2fcfc/attachment.html 


More information about the antlr-interest mailing list