[antlr-interest] Parser stops, returns partial tree sometimes correctly so.

Ted Villalba ted.villalba at gmail.com
Tue Oct 16 15:10:15 PDT 2007


Hi,

I have created a parser that stops parsing my input string and returns an
AST, when instead, I expected it to throw a recognition exception.
Testing in ANTLRWorks I get a NullPointerException, i think because of some
code that sets the token type.

boolTerm : b=BOOL_OP|WOK_OP { $b.setType(WCHAR); }  ;

Is there a way to force the parser to either parse an entire string or throw
an exception?
I have a similar( i think) issue where when I add an extra parenthesis to my
input, or intentionally remove a required parenthesis from the input,the
parser does not throw an exception, but determines instead the best course
of action to take.
Although generally correct in its assumptions, the requirement is that an
exception be thrown. Not sure if there is a switch that will force this
behavior?

Thank you,
Ted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20071016/64fa1aca/attachment.html 


More information about the antlr-interest mailing list