[antlr-interest] Error: rule classDef trapped

Benhur krupa_gadde at yahoo.com
Wed Oct 16 01:34:38 PDT 2002


Hi all,

Whenever I compile grammar where MyParser which extends TreeParser, 
I get the following error. Any pointers why is it so? I am also 
attaching the sub-rule at which this error is occuring.

---------------------------------------------------------------------
ANTLR Parser Generator   Version 2.7.1   1989-2000 jGuru.com
error: Token stream error reading grammar
(s):antlr.TokenStreamRecognitionException: expecting ''', found '{'
BenhurPLSQL.g: error: rule classDef trapped: BenhurPLSQL.g:229: 
unexpected token: (
error: aborting grammar 'BenhurPLSqlParser' due to errors
TokenStreamException: unexpected char: %
---------------------------------------------------------------------

Code --- I am getting error at the line	#( (START_LABEL label_name 
END_LABEL)?. I defined START_LABEL and END_LABEL as tokens and also 
defined them in MyLexer

plsql_block:
	#( (START_LABEL label_name END_LABEL)?
	(("declare")? (declare_spec)+)? 
	("begin")?
     	seq_of_statements
     	("exception" exception_handler (exception_handler)*)? 
     	("end" (label_name)? SEMI!)? )
        ;

Thanks
Benhur


 

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



More information about the antlr-interest mailing list