[antlr-interest] Re: Redifinition of token in tokens {...}: CTAGBEGIN

Jerry Dy jerrydy at sbcglobal.net
Thu Mar 18 09:19:08 PST 2004


--- In antlr-interest at yahoogroups.com, Terence Parr <parrt at c...> 
wrote:
> 
> On Mar 17, 2004, at 2:29 PM, Jerry Dy wrote:
> 
> > Hi,
> > Why do I get an error "Redifinition of token in tokens {...}:
> > CTAGBEGIN" for the following grammar?
> >
> > Below parser with token reference to CTAGBEGIN seem to be causing 
the
> > problem. Thanks!
> >
> > -Jerry
> >
> > options { language="Cpp"; }
> > class PageParser extends Parser;
> > test: CTAGBEGIN
> >         ;
> >
> > class PageLexer extends Lexer;
> > tokens { CTAGBEGIN; }
> > OTAGBEGIN: '<' ('/' {$setType(CTAGBEGIN)})?
> >         ;
> 
> Hi Jerry,
> 
> Because the CTAGBEGIN is implicitly defined in the parser. :)
> 

Am I not simply referencing the token CTAGBEGIN in the parser, not 
defining it? The cpp files where generated without errors when I 
removed CTAGBEGIN from the tokens section... in this case, where is 
the CTAGBEGIN token defined??

-Jerry



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list