bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Main] Copy user definitions.


From: marc-alexandre autret
Subject: Re: [Main] Copy user definitions.
Date: Tue, 28 Aug 2001 14:22:43 +0000 (GMT)

According to Robert Anisko:
> 
> > >> Index: src/output.c
> > >> ===================================================================
> > >> RCS file: /cvsroot/bison/bison/src/output.c,v
> > >> retrieving revision 1.44
> > >> diff -u -r1.44 output.c
> > >> --- src/output.c 2001/08/27 14:55:39 1.44
> > >> +++ src/output.c 2001/08/28 10:02:48
> > >> @@ -1078,6 +1078,15 @@
> > >>    MACRO_INSERT_INT ("verbose", 0);
> > >>
> > >>    MACRO_INSERT_STRING ("filename", infile);
> > >> +  {
> > >> +    size_t size = obstack_object_size (&attrs_obstack);
> > >> +    char *definitions;
> > >> +
> > >> +    definitions = XMALLOC (char, size + 1);
> > >> +    bcopy (obstack_finish (&attrs_obstack), definitions, size);
> > >> +
> > >> +    MACRO_INSERT_STRING ("definitions", definitions);
> > >> +  }
> > >>
> > >>    MACRO_INSERT_INT ("nnts", nvars);
> > >>    MACRO_INSERT_INT ("nrules", nrules);
> > >
> > >I do not agree with doing it in prepare ().
> >
> > This is easy, tell why you are disagree.
> 
> And I don't understand why do you need to copy the
> definitions in a malloc'ed place: you malloc definitions,
> you finish attrs_obstack, copy its content to definitions,
> and put it back to another obstack. Hey, this is hairy.

I undertand now.
In files.c, we use attrs_obstack...

BTW, I would like to keep all the macros stuff in output.c in order
to group it.

-- 
Autret Marc (address@hidden)
Eleve Ingenieur en Informatique.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]