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 12:28:55 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Academic Rigor)

| main()
| {
| 
| int return_value = ::yyparse();  /* which works fine */
| 
| Constraint* root = yyval.constraint;  /* hoping to gain access to string1 -
| but i */
|                                                         /* actually get a
| null pointer instead*/
| 
| }

Constraint *root;

int
main ()
{
  int return_value = ::yyparse();
  // Use root
  exit (0);
}

and in the axiom of your grammar, write what I wrote (i.e., root = $$,
with some extern Constraint *root in the preamble).



reply via email to

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