[antlr-interest] Can it be a bug in antlr 3?

Jose Ventura jose.ventura.roda at gmail.com
Thu Jun 29 01:54:13 PDT 2006


Ok, with b1 it work well.

Thank's


On 6/28/06, Terence Parr <parrt at cs.usfca.edu> wrote:
>
> oh, actually I think I fixed this...can you try b1?
> Ter
> On Jun 27, 2006, at 3:01 AM, Jose Ventura wrote:
>
> > I think the problem is the EOF token
> >
> > programa: (sentencia ';')+ EOF -> ^(PROGRAMA sentencia+); //this's
> > not ok
> >
> > programa: (sentencia ';')+ -> ^(PROGRAMA sentencia+); //this's ok
> >
> > ---------- Forwarded message ----------
> > From: Jose Ventura < jose.ventura.roda at gmail.com>
> > Date: Jun 27, 2006 11:24 AM
> > Subject: Fwd: [antlr-interest] Can it be a bug in antlr 3?
> > To: antlr-interest at antlr.org
> >
> >
> >
> > No, this is the error detected by java compiler.
> >
> > I think  "list_-1" is a bug in the java code generated by antlr, or
> > an error in my grammar ;-)
> >
> > ---------- Forwarded message ----------
> > From: Michiel Vermandel < Michiel_Vermandel at axi.be>
> > Date: Jun 27, 2006 11:20 AM
> > Subject: Re: [antlr-interest] Can it be a bug in antlr 3?
> > To: Jose Ventura < jose.ventura.roda at gmail.com>
> >
> >
> >
> > Is "list_-1" a valid variable name?
> >
> >
> >
> >
> > "Jose Ventura" <jose.ventura.roda at gmail.com >
> > Sent by: antlr-interest-bounces at antlr.org
> > 27/06/2006 11:14
> >
> > To
> > antlr-interest at antlr.org
> > cc
> > Subject
> > [antlr-interest] Can it be a bug in antlr 3?
> >
> >
> >
> >
> >
> >
> > I don't know if this is a bug or a error in my grammar. This occur
> > in a debug session of antlrworks with these version tools
> > ANTLRWorks 1.0ea9
> > ANTLR 3.0ea10
> > StringTemplate 2.3b7
> > XJLibrary 1.2.6
> > Java 1.5.0_02 (Sun Microsystems Inc.)
> >
> >
> > With this grammar
> >
> > grammar Transformer;
> > options {output=AST;}
> >
> > tokens {PROGRAMA;}
> >
> > programa: (sentencia ';')+ EOF -> ^(PROGRAMA sentencia+);
> > sentencia: setDir;
> > setDir : 'set' 'dir' LITERAL ;
> > LITERAL : '"'(options {greedy=false;}:.)* '"';
> >
> >
> > It generate this error
> >
> > [11:05:51] C:\Documents and Settings\JVR3651A\My Documents\java
> > \Transformer\Transformer.java:65: ';' expected
> > [11:05:51]         List list_-1=new ArrayList();
> > [11:05:51]                   ^
> >
> > because the java code generated is wrong
> >
> > [...]
> >
> >         List list_sentencia=new ArrayList();
> >        List list_-1=new ArrayList();
> >        List list_6=new ArrayList();
> >        Object char_literal2_tree=null;
> >        Object EOF3_tree=null;
> > [...]
> >
> > It's a bug?
> >
> > thank's in advance.
> >
> > José Ventura
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060629/90160f35/attachment.html


More information about the antlr-interest mailing list