bug-bison
[Top][All Lists]
Advanced

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

Re: Problems with multithreading and slow compilation


From: Paul Eggert
Subject: Re: Problems with multithreading and slow compilation
Date: Fri, 09 Sep 2005 16:21:03 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

address@hidden writes:

> Re: Problems with multithreading and slow compilation
>
>       From: Laurence Finston
>    Subject: Re: Problems with multithreading and slow compilation
>       Date: Wed, 7 Jul 2004 19:43:19 +0200 (MEST)
>
> On Wed, 7 Jul 2004, Paul Eggert wrote:
>
>> > Would the Bison developers have any interest in implementing
>> > the following features?
>> >
>> > 1) making it possible to redirect the debugging output to files,
>> >    one for each invocation of `yyparse()'.
>> >
>> > 2) Protecting `stdout' and `stderr' with mutexes, to keep
>> >    writes to these streams from being interrupted
>> >    (unless they are already, of course).
>>
>> These both sound like worthy features.  Can you get the effect that
>> you want by defininig YYFPRINTF?  If so, then perhaps we just need to
>> make this sort of thing easier (since not everyone will think of doing
>> that).
>
> See gdb-6.1 gdb/f-exp.y for example of redirecting bison output
> to files using re-defining the YYFPRINTF macro to a routine().
>
> to make this sort of thing easier is to mention it on bison
> maillist or in the manual. no need to patch the yacc.c/glr.c
>
> maybe something like this should be in the manual:
>
> /* Bison debug output to stdout redefining YYFPRINTF */
> #define YYFPRINTF parser_fprintf
> void parser_fprintf (FILE *f, const char *fmt, ...)
> {
>       char buffer[1024];
>       int n=0;
>       va_list args;
>       memset(buffer,0,1024);
>       va_start (args, fmt);
>       n=vsnprintf(buffer,1024,fmt,args);
>       va_end(args);
>       if (n>0) {
>               fprintf(stdout,"%s",buffer);
>               fflush(stdout);
>       }
>       return;
> }
>
> Thanks.
>
>
> [had same problem, and noticed it is not in the manual/maillist]


Thanks for this suggestion.  I'm inclined to leave it undocumented for
now, as YYFPRINTF isn't supported with all the skeletons.  The area is
a bit messy now, I'm afraid, and I'd rather get 2.1 out the door
rather than document the mess.

I'll CC: this to bug-bison so that it gets archived, though.




reply via email to

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