help-bison
[Top][All Lists]
Advanced

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

Re: accessing yyval outside lex and yacc


From: Akim Demaille
Subject: Re: accessing yyval outside lex and yacc
Date: 20 Jul 2001 10:28:43 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Academic Rigor)

>>>>> "Manju" == Manju James <address@hidden> writes:

Manju> Hi - i am a realtively new user of Flex and Bison - was
Manju> wondering if sumone could clear a doubt for me.

Manju> Is it possible to access yyval externally (from another file -
Manju> for instance)?  I would like to gain access to the $$ value of
Manju> the last non-terminal/terminal that yyparse() builds.

Your question is not clear to me.  Are you asking how to get the
_last_ $$, i.e., the result of your semantic actions?

Then just use a global, say `ast', and in your axiom, write

%%
axiom: sentence { ast = $$ };
...


And you're done.



reply via email to

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