Lex part :
%%
[0-9]+ { yyval = atoi (yytext); return num; }
%%
Yacc part :
%token num
%%
exp:num '+' num ; {$$ = $1 + $3;}
%%
- In this part of the code what do
$$
,$1
and$2
stand for? - How can I print
$$
now? - And if I send
5+9
as input to this program5
and9
are identified by the lex program, but what about the+
? Is the symbol+
sent to lex or not?