[antlr-interest] protected weakness?

Ric Klaren klaren at cs.utwente.nl
Wed Apr 21 02:21:02 PDT 2004


On Fri, Apr 09, 2004 at 10:52:50PM -0000, idontwantanidwith2000init wrote:
> consider this: (taken from the faq}
> 
> ID_OR_NUM : DIGITS (ID {$setType(ID);} | {$setType(NUMBER);}) ;
> 
> where ID and NUMBER are protected... 
> 
> will the parser get ID or NUMBER?

Depends on the input ;) But both ID and NUMBER would be valid return tokens.

$setType() sets the token type regardless without any protected checking.

Cheers,

Ric
-- 
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
  Before they invented drawing boards, what did they go back to?



 
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