[antlr-interest] Bad grammar?

Jim Idle jimi at temporal-wave.com
Fri Jul 18 11:36:50 PDT 2008


On Fri, 2008-07-18 at 11:22 -0700, rkevinburton at charter.net wrote:

> I am relatively new to ANTLR so as suggested I am starting with one of the "known" grammars. I decided to start with the JavaScript grammar by Chris Lambrou. It failed to parse what I think is valid JavaScript. So I decided to try to debug the problem and I found (in ANTLRWorks) that the following rule is not right:
> 
> formalParameterList
> 	: '(' (LT!* Identifier ( ',' LT!* Identifier)*)?  ')'
> 	;
> 
> If in ANTLRWorks I start at that rule and with the interpreter try '(a,b)' I get:
> 
> '(' FailedPredicateException(formalParameterList, {synpred16}?)
> 
> I am not able right now to debug it further. What is wrong with this rule?


I am afraid that that grammar isn't very complete (trying to be
respectful here). I think it would be better for you to start with the
Java one or the C one to be honest.

JIm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080718/93fdb048/attachment.html 


More information about the antlr-interest mailing list