I am making a translator with bison / flex, but I have a problem because when implementing the rules I cannot print in only one and I have not been able to send the text to print it in the main rule, this is the code of the rules is the following:
%%
initial: RES TEXT EOL RES RES TEXT BOP main BCL {printf("%s", $8);}
main: RES RES RES TEXT POP VAR RES TEXT PCL BOP content BCL {$$ = ("%s", $11);}
content: declaration {$$ = ("%s", $1);}
| operations {$$ = ("%s", $1);}
| print {$$ = ("%s", $1);}
| content content
;
declaration: VAR TEXT ASG TEXT EOL {aux = ("%s = %s\n", $2, $4); $$ = aux;}
operations: TEXT ASG TEXT OPE TEXT EOL {$$ = ("%s = %s %s %s\n", $1, $3, $4, $5);}
print: SOP POP TEXT PCL EOL {$$ = ("print(%s)", $3);}
%%