bison-patches
[Top][All Lists]
Advanced

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

Re: [Main] Copy user definitions.


From: Pascal Bart
Subject: Re: [Main] Copy user definitions.
Date: Tue, 28 Aug 2001 12:39:29 +0000 (GMT)

On Tue, 28 Aug 2001, marc-alexandre autret wrote:

>Date: Tue, 28 Aug 2001 12:24:59 +0000 (GMT)
>From: marc-alexandre autret <address@hidden>
>To: Pascal Bart <address@hidden>
>Cc: Bison patches <address@hidden>
>Subject: Re: [Main] Copy user definitions.
>
>According to Pascal Bart:
>> Hi,
>>
>>      I send you the patch, which copies the user definitions %{...%} in
>> the bison.simple. Robert tell me what do you think about ?
>>
>> Index: src/bison.simple
>> ===================================================================
>> RCS file: /cvsroot/bison/bison/src/bison.simple,v
>> retrieving revision 1.57
>> diff -u -r1.57 bison.simple
>> --- src/bison.simple 2001/08/27 17:24:34     1.57
>> +++ src/bison.simple 2001/08/28 10:02:48
>> @@ -33,6 +33,9 @@
>>
>>  #include <stdio.h>
>>
>> +/* Copy the user declarations.  */
>> +%%definitions
>> +
>>  #ifndef __cplusplus
>>  # ifndef __STDC__
>>  #  define const
>
>I'm not sure it's a good location.

Probably, I'll see that.

>> 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.

Pascal Bart (address@hidden)




reply via email to

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