[antlr-interest]Skipping a Lexer Rule

Nijesh Panchratna, Noida nijesh at noida.hcltech.com
Tue Dec 16 03:10:00 PST 2003


Hi !!

My rule in lexer ignores/skip $Role and doesn't pass it to parser.but it
seems it does pass something else.

The rule is :--
ROLE
:("$Role")+
 (' '|'\t'|'\n' {count++; newline();}|'\r')+
{$setType(Token.SKIP);}
;

Also, I am not clear what happens if my file(parsing file) doesn't contain
this $Role word
i.e I want this rule to execute if there is a $Role word in the file else
skip this rule.How can I achieve this??

thanks in advance.

Rg
~Nijesh


 

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