1*7979Srrh /* 2*7979Srrh * @(#)cpy.y 1.1 08/30/82 3*7979Srrh */ 4*7979Srrh %term number stop DEFINED 5*7979Srrh %term EQ NE LE GE LS RS 6*7979Srrh %term ANDAND OROR 7*7979Srrh %left ',' 8*7979Srrh %right '=' 9*7979Srrh %right '?' ':' 10*7979Srrh %left OROR 11*7979Srrh %left ANDAND 12*7979Srrh %left '|' '^' 13*7979Srrh %left '&' 14*7979Srrh %binary EQ NE 15*7979Srrh %binary '<' '>' LE GE 16*7979Srrh %left LS RS 17*7979Srrh %left '+' '-' 18*7979Srrh %left '*' '/' '%' 19*7979Srrh %right '!' '~' UMINUS 20*7979Srrh %left '(' '.' 21*7979Srrh %% 22*7979Srrh S: e stop ={return($1);} 23*7979Srrh 24*7979Srrh 25*7979Srrh e: e '*' e 26*7979Srrh ={$$ = $1 * $3;} 27*7979Srrh | e '/' e 28*7979Srrh ={$$ = $1 / $3;} 29*7979Srrh | e '%' e 30*7979Srrh ={$$ = $1 % $3;} 31*7979Srrh | e '+' e 32*7979Srrh ={$$ = $1 + $3;} 33*7979Srrh | e '-' e 34*7979Srrh ={$$ = $1 - $3;} 35*7979Srrh | e LS e 36*7979Srrh ={$$ = $1 << $3;} 37*7979Srrh | e RS e 38*7979Srrh ={$$ = $1 >> $3;} 39*7979Srrh | e '<' e 40*7979Srrh ={$$ = $1 < $3;} 41*7979Srrh | e '>' e 42*7979Srrh ={$$ = $1 > $3;} 43*7979Srrh | e LE e 44*7979Srrh ={$$ = $1 <= $3;} 45*7979Srrh | e GE e 46*7979Srrh ={$$ = $1 >= $3;} 47*7979Srrh | e EQ e 48*7979Srrh ={$$ = $1 == $3;} 49*7979Srrh | e NE e 50*7979Srrh ={$$ = $1 != $3;} 51*7979Srrh | e '&' e 52*7979Srrh ={$$ = $1 & $3;} 53*7979Srrh | e '^' e 54*7979Srrh ={$$ = $1 ^ $3;} 55*7979Srrh | e '|' e 56*7979Srrh ={$$ = $1 | $3;} 57*7979Srrh | e ANDAND e 58*7979Srrh ={$$ = $1 && $3;} 59*7979Srrh | e OROR e 60*7979Srrh ={$$ = $1 || $3;} 61*7979Srrh | e '?' e ':' e 62*7979Srrh ={$$ = $1 ? $3 : $5;} 63*7979Srrh | e ',' e 64*7979Srrh ={$$ = $3;} 65*7979Srrh | term 66*7979Srrh ={$$ = $1;} 67*7979Srrh term: 68*7979Srrh '-' term %prec UMINUS 69*7979Srrh ={$$ = -$1;} 70*7979Srrh | '!' term 71*7979Srrh ={$$ = !$2;} 72*7979Srrh | '~' term 73*7979Srrh ={$$ = ~$2;} 74*7979Srrh | '(' e ')' 75*7979Srrh ={$$ = $2;} 76*7979Srrh | DEFINED '(' number ')' 77*7979Srrh ={$$= $3;} 78*7979Srrh | DEFINED number 79*7979Srrh ={$$ = $2;} 80*7979Srrh | number 81*7979Srrh ={$$= $1;} 82*7979Srrh %% 83*7979Srrh # include "yylex.c" 84