[antlr-interest] Request enhancement ANTLR

John Allen Green greenj at ix.netcom.com
Thu Jun 20 01:04:01 PDT 2002


Sorry, no, I didn't have to deal with this. My parser is for working with
"good" code - stuff that goes cleanly through the language's compiler. So,
because of that, receiving a syntax error from my parser is rare.

John
www.joanju.com



--On 20/06/2002 9:25 AM +0200 Silvain Piree wrote:

> John,
> 
>> I've had to implement the same thing by using custom
>>  tokens and custom AST. 
> 
> I've considered this and it should work for most situations,
> but there is one problem: in case of a syntax error the
> parser throws a NoViableAltException where it calls
> the getFilename() of the parser which could be different
> than the filename for the token:
> 
>  throw new NoViableAltException(LT(1), getFilename())
> 
> which should be somthing like:
> 
>  throw new NoViableAltException(LT(1), LT(1).getFilename())
> 
> Did you encounter this problem? Any solution there?
> (I guess this is caused by the fact that have 
> "defaultErrorHandler=true")
> 
> Silvain
> 
> 
> 
> 
>  
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
>  



 

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



More information about the antlr-interest mailing list