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

Terence Parr parrt at cs.usfca.edu
Wed Mar 17 14:53:08 PST 2004


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. :)

Ter

--
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!
Cofounder, http://www.peerscope.com pure link sharing





 
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