home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d1xx
/
d105
/
bison.lha
/
Bison
/
calc.action.c
< prev
next >
Wrap
Text File
|
1987-10-25
|
1KB
|
71 lines
switch (yyn) {
case 1:
#line 25 "calc.y"
{ val = yyvsp[0]; printflag = 1; ;
break;}
case 2:
#line 27 "calc.y"
{ regs[yyvsp[-2]] = yyvsp[0]; ;
break;}
case 3:
#line 29 "calc.y"
{ exit(0); ;
break;}
case 4:
#line 33 "calc.y"
{ yyval = yyvsp[-1]; ;
break;}
case 5:
#line 35 "calc.y"
{ if (yyvsp[-2] == 69)
{
yyval = 2;
printf ("$1 became %d\n", yyvsp[-2]);
yyvsp[-2] = 69;
}
yyval = yyvsp[-2] + yyvsp[0]; ;
break;}
case 6:
#line 43 "calc.y"
{ yyval = yyvsp[-2] - yyvsp[0]; ;
break;}
case 7:
#line 45 "calc.y"
{ yyval = yyvsp[-2] * yyvsp[0]; ;
break;}
case 8:
#line 47 "calc.y"
{ yyval = yyvsp[-2] / yyvsp[0]; ;
break;}
case 9:
#line 49 "calc.y"
{ yyval = yyvsp[-2] % yyvsp[0]; ;
break;}
case 10:
#line 51 "calc.y"
{ yyval = yyvsp[-2] | yyvsp[0]; ;
break;}
case 11:
#line 53 "calc.y"
{ yyval = yyvsp[-2] & yyvsp[0]; ;
break;}
case 12:
#line 55 "calc.y"
{ yyval = - yyvsp[0]; ;
break;}
case 13:
#line 57 "calc.y"
{ yyval = regs[yyvsp[0]]; ;
break;}
case 15:
#line 64 "calc.y"
{ yyval = yyvsp[0]; base = (yyvsp[0] == 0) ? 8 : 10; ;
break;}
case 16:
#line 66 "calc.y"
{ yyval = base * yyvsp[-1] + yyvsp[0]; ;
break;}
}