[antlr-interest] Re: How to locate errors?

xdjicn xdji at ustc.edu
Thu Oct 24 01:28:00 PDT 2002


Thank you,I have got the following results,but I cannot find where 
the error occurs in parser.g file,which is very large so I can hardly 
find the errors without any line information.
////////////////////////////////////////////////////
Exception occurred: antlr.TokenStreamRecognitionException (to be 
caught at: antlr.preprocessor.Hierarchy.readGrammarFile(), line=93, 
bci=59) thread="main", antlr.preprocessor.PreprocessorLexer.nextToken
(), line=177, bci=848




--- In antlr-interest at y..., "lgcraymer" <lgc at m...> wrote:
> What you are seeing is an example of cascaded exceptions--the first 
> exception had the line number set, but after that was caught and a 
> second exception thrown, the second exception did not have the line 
> info set.  Run antlr under a Java debugger and set it to catch 
ANTLR 
> exceptions, then look at the appropriate field in the Exception 
> instance.
> 
> --Loring
> 
> 
> --- In antlr-interest at y..., "xdjicn" <xdji at u...> wrote:
> > In compiling a parser file,ANTLR gives the following messages:
> > 
> > /////////////////////////////////////////////
> > ANTLR Parser Generator   Version 2.7.1   1989-2000 jGuru.com
> > error: Token stream error reading grammar
> > (s):antlr.TokenStreamRecognitionExcepti
> > on: expecting '*', found ' '
> > TokenStreamException: expecting '*', found ' '
> > /////////////////////////////////////////////
> > How can I get the line number where the error occurs?
> > Thanks!


 

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



More information about the antlr-interest mailing list