[antlr-interest] current rule name

Mark Volkmann r.mark.volkmann at gmail.com
Wed Dec 19 07:39:42 PST 2007


Is there an easy way to determine the name of the rule that is
currently being processed? In my case I'm overriding the
getErrorMessage method in BaseRecognizer and need to know the current
rule name in order to create a good error message. I looked at the API
for RecognitionException and don't see a way to get the rule name. I
know I could use the "paraphrase mechanism" discussed in the book in
section 10.3, but I thought maybe there was an easier way.

-- 
R. Mark Volkmann
Object Computing, Inc.


More information about the antlr-interest mailing list