diff --git a/tools/qfcc/source/qc-lex.l b/tools/qfcc/source/qc-lex.l index 2acdd3818..1b4b9b84e 100644 --- a/tools/qfcc/source/qc-lex.l +++ b/tools/qfcc/source/qc-lex.l @@ -130,13 +130,13 @@ STRING \"(\\.|[^"\\])*\" qc_yylval.expr = new_integer_expr (i);//FIXME else qc_yylval.expr = new_integer_expr (i); - return CONST; + return VALUE; } {FLOAT} { float f = strtof (yytext, 0); qc_yylval.expr = new_float_expr (f); - return CONST; + return VALUE; } {ID} { @@ -162,7 +162,7 @@ STRING \"(\\.|[^"\\])*\" sscanf (yytext, "' %f %f %f '", &v[0], &v[1], &v[2]); qc_yylval.expr = new_vector_expr (v); - return CONST; + return VALUE; } '{s}*{m}?{FLOAT}{s}+{m}?{FLOAT}{s}+{m}?{FLOAT}{s}+{m}?{FLOAT}{s}*' { @@ -170,7 +170,7 @@ STRING \"(\\.|[^"\\])*\" sscanf (yytext, "' %f %f %f %f'", &q[0], &q[1], &q[2], &q[3]); qc_yylval.expr = new_quaternion_expr (q); - return CONST; + return VALUE; } '(\\[^xX0-7\r\n]|[^'\r\n]|\\[xX][0-9A-Fa-f]+|\\[0-7]+)*' { @@ -179,7 +179,7 @@ STRING \"(\\.|[^"\\])*\" if (str[1]) warning (0, "multibyte char constant"); qc_yylval.expr = new_integer_expr (*str); - return CONST; + return VALUE; } [+\-*/&|^%]= { @@ -230,7 +230,7 @@ STRING \"(\\.|[^"\\])*\" int ret = do_grab (yytext); if (ret >= 0) { qc_yylval.expr = new_integer_expr (ret); - return CONST; + return VALUE; } else { BEGIN (-ret); } diff --git a/tools/qfcc/source/qc-parse.y b/tools/qfcc/source/qc-parse.y index f2f6cd886..57f2bab93 100644 --- a/tools/qfcc/source/qc-parse.y +++ b/tools/qfcc/source/qc-parse.y @@ -141,7 +141,7 @@ int yylex (void); %left '.' '(' '[' %token CLASS_NAME NAME -%token CONST STRING +%token VALUE STRING %token LOCAL RETURN WHILE DO IF ELSE FOR BREAK CONTINUE ELLIPSIS %token NIL IFBE IFB IFAE IFA SWITCH CASE DEFAULT ENUM TYPEDEF @@ -1258,7 +1258,7 @@ arg_list ; const - : CONST + : VALUE | NIL { $$ = new_nil_expr (); } | string ; diff --git a/tools/qfcc/source/qp-lex.l b/tools/qfcc/source/qp-lex.l index e1c837c98..d35897297 100644 --- a/tools/qfcc/source/qp-lex.l +++ b/tools/qfcc/source/qp-lex.l @@ -111,13 +111,13 @@ FRAMEID {ID}(\.{ID})* {INTEGER} { int i = strtol (yytext, 0, 0); qp_yylval.expr = new_integer_expr (i); - return CONST; + return VALUE; } {FLOAT} { float f = strtof (yytext, 0); qp_yylval.expr = new_float_expr (f); - return CONST; + return VALUE; } {ID} return keyword_or_id (yytext); @@ -125,7 +125,7 @@ FRAMEID {ID}(\.{ID})* \"(\\.|[^"\\])*\" { const char *s = make_string (yytext, 0); qp_yylval.expr = new_string_expr (s); - return CONST; + return VALUE; } '{s}*{m}{FLOAT}{s}+{m}{FLOAT}{s}+{m}{FLOAT}{s}*' { @@ -133,7 +133,7 @@ FRAMEID {ID}(\.{ID})* sscanf (yytext, "' %f %f %f '", &v[0], &v[1], &v[2]); qp_yylval.expr = new_vector_expr (v); - return CONST; + return VALUE; } '{s}*{m}{FLOAT}{s}+{m}{FLOAT}{s}+{m}{FLOAT}{s}+{m}{FLOAT}{s}*' { @@ -141,7 +141,7 @@ FRAMEID {ID}(\.{ID})* sscanf (yytext, "' %f %f %f %f'", &q[0], &q[1], &q[2], &q[3]); qp_yylval.expr = new_quaternion_expr (q); - return CONST; + return VALUE; } {RELOP} { @@ -168,7 +168,7 @@ FRAMEID {ID}(\.{ID})* int ret = do_grab (yytext); if (ret >= 0) { qp_yylval.expr = new_integer_expr (ret); - return CONST; + return VALUE; } else { BEGIN (-ret); } diff --git a/tools/qfcc/source/qp-parse.y b/tools/qfcc/source/qp-parse.y index e928f0ed4..f8c870ed4 100644 --- a/tools/qfcc/source/qp-parse.y +++ b/tools/qfcc/source/qp-parse.y @@ -123,7 +123,7 @@ int yylex (void); %token TYPE TYPE_NAME %token ID -%token CONST +%token VALUE %token PROGRAM VAR ARRAY OF FUNCTION PROCEDURE PBEGIN END IF THEN ELSE %token WHILE DO RANGE ASSIGNOP NOT ELLIPSIS @@ -217,7 +217,7 @@ declarations type : standard_type - | ARRAY '[' CONST RANGE CONST ']' OF standard_type + | ARRAY '[' VALUE RANGE VALUE ']' OF standard_type { $$ = based_array_type ($8, expr_integer ($3), expr_integer ($5)); } @@ -248,7 +248,7 @@ subprogram_declaration current_symtab = current_symtab->parent; current_storage = $3; } - | subprogram_head ASSIGNOP '#' CONST ';' + | subprogram_head ASSIGNOP '#' VALUE ';' { build_builtin_function ($1, $4, 0); } @@ -411,7 +411,7 @@ primary if ($$->type == ex_symbol && extract_type ($$) == ev_func) $$ = function_expr ($$, 0); } - | CONST + | VALUE | name '(' expression_list ')' { $$ = function_expr ($1, $3); } | '(' expression ')' { $$ = $2; } ;