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: Manju James
Subject: Re: accessing yyval outside lex and yacc
Date: Fri, 20 Jul 2001 15:39:12 +0200

Thank u Akim and Hans for ur prompt responses.

Ur initial suggestion is what i used Akim, and it works fine - thank u very
much .

Initially, i had had a brief look at YYPARSE_PARAM - but it seemed a bit
complicated and i wasnt very keen on using it.  it seems that one has to be
really clued up on Bison to use it - and i am far from it.

i am thinking of using the wrapper function u suggested,  later, though -
(when i get all the bugs out of my buggy code ;-}).

Another puzzle to me though, Hans is the fact that u use a class definition
for YYSTYPE - i was under the impression that one had to use %union to
define YYSTPE?

Regards
Manju James
Telecommunications Research Group (CeTAS)
Department of Electrical and Information Engineering
University of the Witwatersrand
e-mail: address@hidden
http://www.satina.ee.wits.ac.za




----- Original Message -----
From: Akim Demaille <address@hidden>
To: Hans Aberg <address@hidden>
Cc: Manju James <address@hidden>; <address@hidden>
Sent: Friday, July 20, 2001 2:18 PM
Subject: Re: accessing yyval outside lex and yacc


>
> | A good approximation simply consists in a wrapper around yyparse, in
> | the preamble, or the postamble of your .y:
> |
> | Constraint *
> | constraint_parse ()
>
> constraint_parse (const char *filename)
>
>
> | {
> |   Constraint *res = 0
> |   // Set up yyin
> |   if (yyparse ())
> |     return root;
> |   else
> |     return NULL;
> | }
> |
> | and keep root static.
>
> _______________________________________________
> Help-bison mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/help-bison
>




reply via email to

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