[antlr-interest] Grammar not detecting extraneous input at end

Karim Chichakly karimc17 at gmail.com
Thu Jun 3 11:38:19 PDT 2010


Hi,

I have a grammar that does not give an error (in ANTLR 3.2) if there are
extraneous characters at the end of the input.  For example, I would expect
"(a+b))" to generate an error, but it does not.  "(a+b)" is parsed fine and
the extra ")" at the end is just ignored.

I enclose a small sample grammar that demonstrates this problem.  I am using
the C runtime, but the problem is not there.  The error is not detected in
ANTLRWorks 1.4 either.

Any help anyone can give me would be greatly appreciated.

Thank you,

Karim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test.g
Type: application/octet-stream
Size: 2056 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20100603/a091434c/attachment.obj 


More information about the antlr-interest mailing list