X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fexpr.h;h=12912565954c79b059556080392662e88ebc1856;hb=f1c9e6126217fbb47aefa3f6360cafb3e15976e1;hp=5a1da2aef94f9b9ff28cf2b0f2dac6378af0ebd7;hpb=37597beca4a11edba50b847932fdfeca3a648fa2;p=pspp-builds.git diff --git a/src/expr.h b/src/expr.h index 5a1da2ae..12912565 100644 --- a/src/expr.h +++ b/src/expr.h @@ -21,25 +21,26 @@ #define expr_h 1 /* Expression parsing flags. */ -enum +enum expr_type { - PXP_NONE = 000, /* No flags. */ - PXP_DUMP = 001, /* Dump postfix representation to screen; - only for use by EVALUATE. */ - - /* Specify expression type. */ - PXP_BOOLEAN = 002, /* Coerce return value to Boolean. */ - PXP_NUMERIC = 004, /* Must be numeric result type. */ - PXP_STRING = 010 /* Must be string result type. */ + EXPR_ANY = 0, /* Any type. */ + EXPR_BOOLEAN = 1, /* Must be numeric; coerce to Boolean. */ + EXPR_NUMERIC = 2, /* Must be numeric result type. */ + EXPR_STRING = 3, /* Must be string result type. */ + EXPR_ERROR = 4, /* Indicates an error. */ + EXPR_NO_OPTIMIZE = 0x1000 /* May be set in expr_parse() + argument to disable optimization. */ }; struct expression; struct ccase; union value; -struct expression *expr_parse (int flags); -double expr_evaluate (struct expression *, const struct ccase *, int case_num, - union value *); +struct expression *expr_parse (enum expr_type); +enum expr_type expr_get_type (const struct expression *); +double expr_evaluate (const struct expression *, const struct ccase *, + int case_num, union value *); void expr_free (struct expression *); +void expr_debug_print_postfix (const struct expression *); #endif /* expr.h */