help-bison
[Top][All Lists]
Advanced

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

Re: init code for yyparse


From: Hans Aberg
Subject: Re: init code for yyparse
Date: Wed, 3 Dec 2003 19:15:41 +0100

At 16:23 +0000 2003/12/03, Nosnos wrote:
>I could not found in the manual the way to execute initial code when we
>enter in yyparse ... (I want to malloc and init a structure)
>
>Is there a solution ?

Unless later versions with new support for that, there is no way to do that
directly, but you have to write a new function that invokes yyparse. If you
put the definition of that function in the .y file, it neds up in the same
file as the parser code. If it needs to access a yyparse object, then it
has to be done via an argument of the yyparse function.

  Hans Aberg
                  * Email: Hans Aberg <mailto:address@hidden>
                  * Home Page: <http://www.math.su.se/~haberg/>
                  * AMS member listing: <http://www.ams.org/cml/>






reply via email to

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