X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fexpr.h;h=12912565954c79b059556080392662e88ebc1856;hb=97d6c6f6b1922621ca013668eba9a9a9f71d60fe;hp=30824966cd46f09c50de278471efdf284637df96;hpb=4944c86a9318bc5b5578ab145a95c116ffd2c9fd;p=pspp diff --git a/src/expr.h b/src/expr.h index 30824966cd..1291256595 100644 --- a/src/expr.h +++ b/src/expr.h @@ -21,24 +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 *, struct ccase *, 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 */