2. %{ #include int yylex(void); void yyerror (char *); }% %token INTEGER %left '+ '-' %left '* '/' %% program: program expr '\n' {printf(%d\n",$a2);} | ; expr: INTEGER{$$=$1;) | expr '+'expr{$$=$1+$3;)} | expr '-'expr{$$=$1-$3;)} | expr '*'expr{$$=$1*$3;)} | expr '\'expr{if ($3==0){yyerror("Getting zero");} ; %% void yyerror (char *s) { fprintf(student,"s\n",s); }