Lines Matching refs:op

62 #define ARITH_PRECEDENCE(op, prec) [op - ARITH_BINOP_MIN] = prec
111 static inline int arith_prec(int op)
113 return prec[op - ARITH_BINOP_MIN];
121 static arith_t do_binop(int op, arith_t a, arith_t b)
124 switch (op) {
132 return op == ARITH_REM ? a % b : a / b;
166 static arith_t primary(int token, union yystype *val, int op, int noeval)
173 result = assignment(op, noeval);
179 last_token = op;
182 last_token = op;
185 token = op;
187 op = yylex();
191 return -primary(op, val, yylex(), noeval);
194 return !primary(op, val, yylex(), noeval);
197 return ~primary(op, val, yylex(), noeval);
203 static arith_t binop2(arith_t a, int op, int precedence, int noeval)
218 higher_prec(op2, op)) {
219 b = binop2(b, op2, arith_prec(op), noeval);
223 a = noeval ? b : do_binop(op, a, b);
229 op = op2;
233 static arith_t binop(int token, union yystype *val, int op, int noeval)
235 arith_t a = primary(token, val, op, noeval);
237 op = last_token;
238 if (op < ARITH_BINOP_MIN || op >= ARITH_BINOP_MAX)
241 return binop2(a, op, ARITH_MAX_PREC, noeval);
244 static arith_t and(int token, union yystype *val, int op, int noeval)
246 arith_t a = binop(token, val, op, noeval);
249 op = last_token;
250 if (op != ARITH_AND)
261 static arith_t or(int token, union yystype *val, int op, int noeval)
263 arith_t a = and(token, val, op, noeval);
266 op = last_token;
267 if (op != ARITH_OR)
278 static arith_t cond(int token, union yystype *val, int op, int noeval)
280 arith_t a = or(token, val, op, noeval);
303 int op = yylex();
308 return cond(var, &val, op, noeval);
310 if (op != ARITH_ASS && (op < ARITH_ASS_MIN || op >= ARITH_ASS_MAX))
311 return cond(var, &val, op, noeval);
317 if (op != ARITH_ASS)
318 result = do_binop(op - 11, arith_lookupvarint(val.name), result);