[antlr-interest] Re: Bug#206489: antlr: AST nodes improperly initialized (2.7.2)

John Leuner eland_at_jleuner at yahoo.com
Thu Sep 4 09:09:21 PDT 2003


Thanks for the confirmation. I will apply this patch
to the Debian package (until a new upstream release is
packaged).

John Leuner

--- parrt2000 <parrt at cs.usfca.edu> wrote:
> Yes, this patch is correct.  I have updated the main
> line code.
> 
> Terence
> PS   I've missed that last weeks email due to mail
> problems caused by damn 
> overflowed mailbox from virus.  I get hit with about
> 50M each day or so. :(
> 
> --- In antlr-interest at yahoogroups.com, John Leuner
> <eland_at_jleuner at y...> wrote:
> > Hello,
> > 
> > I received this bug report via the Debian Bug
> Tracking
> > System. It
> > describes an undesirable change in behaviour from
> > antlr 2.7.1 to 2.7.2.
> > 
> > I would like to know whether this is a "correct"
> fix
> > and whether this
> > change will be included in future releases of
> antlr.
> > 
> > Thanks
> > John Leuner
> > 
> > > > On Thu, 2003-08-21 at 02:00, Kristian G.
> Kvilekval
> > wrote:
> > > > > Package: antlr
> > > > > Version: 2.7.2-1
> > > > > Severity: important
> > > > > Tags: patch
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > After upgrading 2.7.1 -> 2.7.2 , I noticed
> that
> > my grammar
> > > > > trees had changed.  I tracked this down to a
> new
> > style of
> > > > > AST node creation.   In the past the parser
> > would call
> > > > > "new MyASTNode(token)" if the user had
> specified
> > a token.   
> > > > > The  current parser uses a factory method
> for
> > node construction 
> > > > > and  though it calls the constructor it also
> > re-initializes
> > > > > the newly created node.   The patch below
> only
> > initializes
> > > > > the AST node if the old style constructor
> was
> > not found.
> > > > > 
> > > > > --- antlr-2.7.2/antlr/ASTFactory.java  
> > 2003-01-19 16:37:58.000000000 
> > > > > -0800
> > > > > +++ antlr-2.7.2.mod/antlr/ASTFactory.java   
>   
> > 2003-08-12 
> > > > > 18:53:37.000000000 -0700
> > > > > @@ -208,9 +208,6 @@
> > > > >          */
> > > > >         public AST create(Token tok, String
> > className) {
> > > > >          AST t =
> createUsingCtor(tok,className);
> > > > > -        if ( t!=null ) {
> > > > > -                       t.initialize(tok);
> > > > > -               }
> > > > >          return t;
> > > > >      }
> > > > >   
> > > > > @@ -245,6 +242,9 @@
> > > > >                                 // just do
> the
> > regular thing if you 
> > > > > can't find the ctor
> > > > >                                 // Your AST
> must
> > have default ctor to 
> > > > > use this.                                t =
> > create(c);
> > > > > +                if ( t!=null ) {
> > > > > +                    t.initialize(token);
> > > > > +                }
> > > > >                         }
> > > > >                 }
> > > > >                 catch (Exception e) {
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > -- System Information:
> > > > > Debian Release: testing/unstable
> > > > > Architecture: i386
> > > > > Kernel: Linux shawsheen 2.4.20k7-smp #1 SMP
> Thu
> > Apr 3 15:38:22 PST 2003 i686
> > > > > Locale: LANG=C, LC_CTYPE=C
> > > > > 
> > > > > Versions of packages antlr depends on:
> > > > > ii  gij-3.2 [java-virtual-mac 1:3.2.3-2     
> The
> > GNU Java bytecode interpreter
> > > > > ii  gij-3.3 [java-virtual-mac 1:3.3.2-0pre1 
> The
> > GNU Java bytecode interpreter
> > > > > ii  j2re1.3 [java-virtual-mac 1.3.1.02b-2   
> > Blackdown Java(TM) 2 Runtime Envir
> > > > > ii  j2re1.4 [java-virtual-mac 1.4.0.99beta-1
> > Blackdown Java(TM) 2 Runtime Envir
> > > > > ii  kaffe [java-virtual-machi 1:1.0.7-3     
> A
> > JVM to run Java bytecode
> > > > > ii  sablevm [java-virtual-mac 1.0.8-4       
> > Free implementation of Java Virtua
> > > > > 
> > > > > -- no debconf information
> > -- 
> > John Leuner <jewel at p...>
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site
> design software
> > http://sitebuilder.yahoo.com
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list