static enum token t_lex(char *s) { int num; if (s == NULL) { return EOI; } num = find_op(s); if (((TOKEN_TYPE(num) == UNOP || TOKEN_TYPE(num) == BUNOP) && isunopoperand()) || (num == LPAREN && islparenoperand()) || (num == RPAREN && isrparenoperand())) return OPERAND; return num; }
static enum token t_lex(char *s) { struct t_op const *op = ops; if (s == 0) { t_wp_op = NULL; return EOI; } while (*op->op_text) { if (strcmp(s, op->op_text) == 0) { if (((op->op_type == UNOP || op->op_type == BUNOP) && isunopoperand()) || (op->op_num == LPAREN && islparenoperand()) || (op->op_num == RPAREN && isrparenoperand())) break; t_wp_op = op; return op->op_num; } op++; } t_wp_op = NULL; return OPERAND; }