Gioele Barabucci wrote:
Is it possible to access the input char stream from lexer's
displayRecognitionError(String[] tokenNames, RecognitionException e)?

Following the error chapter on the ANTLR book I managed to get Token names
and other grammar information. Yet, I don't see how to access the input char
stream to display the characters preceding and following the error.

  
Use:

e.input from the Exception, on a CommonToken you can use getInputStream() (sometimes the input stream for the token may not be the same as the exception, for instance if you handle include processing etc).

JIm

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to