I have created a simple grammar that parses a set of IF/THEN statements. I can get the various recognition exceptions (MissingTokenException, NoViableAltException, etc).
Now I need to go a step beyond and make my processing a bit more fine-grained.
For example, the following rule is missing a THEN:
IF CODE="1"
DATE < TODAY
ELSE
DATE >= TODAY
ENDIF
Here's another one (missing a left paren):
IF CODE="1" OR CODE="2") THEN
DATE < TODAY
ENDIF
Another (missing quotes around a String):
IF CODE=1" THEN
DATE < TODAY
ENDIF
Can anyone make any suggestions? The only idea I have is a regex-based post processor where if the statement isn't properly parsed, it's compared to a series of regular expressions to determine what went wrong.
Jason