[antlr-interest] Getting mismatched input error - 'find' expecting 'find' !!

Sumanto Biswas sumanto at gmail.com
Fri Oct 26 10:26:39 PDT 2007


Hi,


We were using Antlr 2.77, but are migrating to Antlr 3.0. We had three
sections for lexer, parser and tree-walker but have merged all that now. I
am getting the exception "line 1:0 mismatched input 'find' expecting 'find'"
when executing debugging via ANTLRWorks 1.1.3. The same grammar when run
with a test program just chokes up and doesn't finish.

My grammar file is attached. The input I used is : "find{$name}".

The exception I got in ANTLRWorks 1.1.3 is pasted below:
-------------------------------------------------------------------------
recoverFromMismatchedToken
BR.recoverFromMismatchedToken
line 1:0 mismatched input 'find' expecting 'find'
Exception in thread "main"
org.antlr.runtime.tree.RewriteEmptyStreamException: rule searchSpec
        at org.antlr.runtime.tree.RewriteRuleElementStream._next(
RewriteRuleElementStream.java:158)
        at org.antlr.runtime.tree.RewriteRuleElementStream.next(
RewriteRuleElementStream.java:145)
        at testParser.sosl(testParser.java:183)
        at __Test__.main(__Test__.java:14)
-------------------------------------------------------------------------

I am stumped where it says "mismatched input 'find' expecting 'find'". How
can it not match find with find?

Any help would be appreciated.

Regards,
Sumanto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20071026/c568401d/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.g
Type: application/octet-stream
Size: 4960 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20071026/c568401d/attachment.obj 


More information about the antlr-interest mailing list