X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fexpressions%2Fgenerate.pl;h=c8fdf4c1d3b7e265412686310946040147b1f698;hb=751d7694b0904b580fad3903205341c85c04d421;hp=9d753867cc1f72865e8d251d289748fa21e0926b;hpb=dcf9b154cbcaa35c3d8459a201b77eec8bcb30bd;p=pspp diff --git a/src/language/expressions/generate.pl b/src/language/expressions/generate.pl index 9d753867cc..c8fdf4c1d3 100644 --- a/src/language/expressions/generate.pl +++ b/src/language/expressions/generate.pl @@ -16,7 +16,7 @@ init_all_types (); # Parse input file. our (%ops); -our (@funcs, @opers); +our (@funcs, @opers, @order); parse_input (); # Produce output. @@ -66,9 +66,9 @@ our ($toktype); sub init_all_types { # Common user-visible types used throughout evaluation trees. init_type ('number', 'any', C_TYPE => 'double', - ATOM => 'number', MANGLE => 'n', HUMAN_NAME => 'num', + ATOM => 'number', MANGLE => 'n', HUMAN_NAME => 'number', STACK => 'ns', MISSING_VALUE => 'SYSMIS'); - init_type ('string', 'any', C_TYPE => 'struct fixed_string', + init_type ('string', 'any', C_TYPE => 'struct substring', ATOM => 'string', MANGLE => 's', HUMAN_NAME => 'string', STACK => 'ss', MISSING_VALUE => 'empty_string'); init_type ('boolean', 'any', C_TYPE => 'double', @@ -99,6 +99,9 @@ sub init_all_types { init_type ('str_var', 'leaf', C_TYPE => 'const struct variable *', ATOM => 'variable', MANGLE => 'Vs', HUMAN_NAME => 'string_variable'); + init_type ('var', 'leaf', C_TYPE => 'const struct variable *', + ATOM => 'variable', MANGLE => 'V', + HUMAN_NAME => 'variable'); # Vectors. init_type ('vector', 'leaf', C_TYPE => 'const struct vector *', @@ -111,6 +114,8 @@ sub init_all_types { FIXED_VALUE => 'c'); init_type ('case_idx', 'fixed', C_TYPE => 'size_t', FIXED_VALUE => 'case_idx'); + init_type ('dataset', 'fixed', C_TYPE => 'struct dataset *', + FIXED_VALUE => 'ds'); # One of these is emitted at the end of each expression as a sentinel # that tells expr_evaluate() to return the value on the stack. @@ -233,6 +238,7 @@ sub parse_input { $op{OPTIMIZABLE} = 1; $op{UNIMPLEMENTED} = 0; $op{EXTENSION} = 0; + $op{PERM_ONLY} = 0; for (;;) { if (match ('extension')) { $op{EXTENSION} = 1; @@ -240,6 +246,10 @@ sub parse_input { $op{OPTIMIZABLE} = 0; } elsif (match ('absorb_miss')) { $op{ABSORB_MISS} = 1; + } elsif (match ('perm_only')) { + $op{PERM_ONLY} = 1; + } elsif (match ('no_abbrev')) { + $op{NO_ABBREV} = 1; } else { last; } @@ -370,7 +380,7 @@ sub parse_input { $ops{$a}->{OPNAME} cmp $ops{$b}->{OPNAME}} @funcs; @opers = sort {$ops{$a}->{NAME} cmp $ops{$b}->{NAME}} @opers; - our (@order) = (@funcs, @opers); + @order = (@funcs, @opers); } # Reads the next token into $token, $toktype.