Even though Bison is a bottom up parser, if I need to pass a variable's
content top-down, what are the possible ways (except using global
variable)?
Register_decl
: REGISTER IDENTIFIER Register_decl_contd
{
Char * register_name = $2;
// $2 has the 'register_name' now. I wanted that
name to be communicated down to the scope of the non-terminal
'Register_decl_contd'
}
;
Register_decl_contd
: '.' IDENTIFIER ...something...
{ ... }
| '=' IDENTIFIER ...something...
{ ... }
| '[' IDENTIFIER ...something...
{
// I want to use get the content of
'register_name' here to be able to print user friendly error messages,
if required.
// How can I get that info since register_name
is defined in a top level scope in the non-terminal hierarchy? Any help?
}
;
Thanks
Arijit
_______________________________________________
[email protected] http://lists.gnu.org/mailman/listinfo/help-bison