I want to make some variables I generate in b available in c:
a : b c { ...some code...}
A simple example:
b : X { int result = 0; } | Y { int result = 1; }
so I can, later on in c say:
c : D { printf(result + 1); } | E { printf(result + 2); }
Is there any chance to do that? Any help would really be appreciated!
resultshould be a global variable. You can do this by includingat the top of your YACC file. Of course, you should also replace
int result = 0andint result = 1withresult = 0andresult = 1respectively.