help-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: Laurence Finston
Subject: Re: Problems with multithreading and slow compilation
Date: Wed, 7 Jul 2004 13:31:21 +0200 (MEST)

On Wed, 7 Jul 2004, Frank Heckenbach wrote:

> Laurence Finston wrote:
>
> > I'm also having problems with having to wait a long time while the
> > C++ file generated by Bison compiles.  I've been meaning to try to put
> > more code for the actions into functions to see if this will help,
> > but since the return values of the functions must be tested in the rules,
> > it makes things more complicated and interferes with hacking.
>
> A bit (one temporary variable for each such result). OTOH, you can
> then use `return' in the middle of the function when useful.
> This is
> something you can't do in a bison action (AFAIK), at least not with
> the expected result.
>

Actually, it can be a bit more complicated than this.  I've also thought
it might not just be the actions that are taking so long to compile, but
rather the framework, i.e., the code that implements the states and the
possible paths through them.

`return()' from an action returns from `yyparse()'.
I often use `goto' to jump to the end of an action, when it's not
convenient to wrap the code in conditionals. I'd rather not use them,
because they might make it impossible for the compiler to perform certain
optimizations.  Since I've read that the actions are put into a `switch'
statement, I think that `break' might work, but I haven't tried it.  Does
anyone know if this would work?  I don't know where execution would continue in
this case, and it seems like using it would be relying on an implementation
detail.  I've often wished for a special Bison symbol that would exit an
action.

Laurence






reply via email to

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