BiGNoRm6969 wrote:
> During a string validation, I receive this message "line 1:20 extraneous
> input 'f' expecting ASA" in the console. This is printed by the
> "getErrorMessage" function, initiated by the "match" function. I understanrd
> why this message is displayed.
>
> My problem is that I want to catch the error generated by the parser. I
> include this code in my .g:
>
> @rulecatch {
> catch ( RecognitionException testing ) {
> throw testing;
> }
> }
>
> I also include a try/catch block in my Java code that use my parser, to
> catch the RecognitionException exception. However, it never catch it. So, my
> program is unable to know if the validation succeed or not.
>
> What I am missing?
>
>
>
Try overriding either the emitErrorMessage or the
displayRecognitionError method in org.antlr.runtime.BaseRecognizer. You
can do that with an @member section in your grammar, or in a separate
superclass.
Ron
--
Ron Hunter-Duvar | Software Developer V | 403-272-6580
Oracle Service Engineering
Gulf Canada Square 401 - 9th Avenue S.W., Calgary, AB, Canada T2P 3C5
All opinions expressed here are mine, and do not necessarily represent
those of my employer.
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
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.