[antlr-interest] NoViableAltException

meenachan meenachan at yahoo.com
Wed Oct 27 04:55:01 PDT 2004




I am getting a NoViableAltException in the ANTLR . But I want to get 
the full string from the place where it occurs . For example:

The input is :
create antlr antlrname=antlr1 antlrype=type1 

where the lexer definition is as follows:
CREATE:"create ";
ANTLR:"antlr";
ANTLRNAME:"antlrn"('a' ('m' ('e')?)?)?;
ANTLRTYPE:"antlrt"('y' ('p'('e')?)?)?;

In the above example since  it was not able to identify the 
token "antlrype=type1" it throws NoViableAltException with the LT(1) 
as "antlr". But I need to display the whole string "antlrype=type1 " 
as invalid. 

My question is : How to get the string (antlrype=type1 )from the 
place where the NoViableAltException occurs??

Thanks in advance
Meena








 
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