help-bison
[Top][All Lists]
Advanced

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

passing down value of terminal


From: vlad florentino
Subject: passing down value of terminal
Date: Wed, 22 Nov 2006 13:05:35 -0500

In gnu bison:

I have a couple of productions of this type:
ID '.' complex
 : {...}
 ;

complex
 : FOOBAR  {...}
 ;

How can I pass the value of ID, a terminal, down to the production
'complex', a non terminal. I would like to determine what's the value of ID
and take actions based on that, i.e.:
complex
 : FOOBAR
 {
   if( strcmp(ID.value,"this") == 0)
     doThis();
   else
     doThat();
  }

thanks
vlad

PS: This is my first time posting. I don't know where to read the response.
I hope that i get a copy of the response to this email address.


reply via email to

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