X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fexpr.h;h=12912565954c79b059556080392662e88ebc1856;hb=3e66793381d0eaee26bd980c9a5479129fa44386;hp=909cf87f1761606857a5480897e9271bde43ff45;hpb=bc963dae9be291ea0a7cccf189d13e00d3797cfd;p=pspp-builds.git diff --git a/src/expr.h b/src/expr.h index 909cf87f..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 *, 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 */