From 90a0cdfedfc93bed54f466a31525ef8c775a5f61 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 19 Jun 2001 23:35:09 +0000 Subject: [PATCH] now seems to get through CustomTF properly, but better def handling is needed --- tools/qfcc/source/qc-parse.y | 56 ++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/tools/qfcc/source/qc-parse.y b/tools/qfcc/source/qc-parse.y index 2e8cb4358..eacaf0afd 100644 --- a/tools/qfcc/source/qc-parse.y +++ b/tools/qfcc/source/qc-parse.y @@ -76,7 +76,13 @@ defs ; def - : type {current_type = $1;} def_list {} + : type + { + current_type = $1; + } + def_list + { + } ; type @@ -105,7 +111,7 @@ def_list ; def_item - : def_name opt_initializer + : def_name opt_initializer { $$ = $1; } | '(' { $$.scope = pr_scope; @@ -121,16 +127,50 @@ def_item param_scope.scope_next = $2.pscope; pr_scope = $2.scope; } - ')' { current_type = parse_params ($4); } def_name opt_definition + ')' + { + current_type = parse_params ($4); + } + def_name + { + $$ = $7->scope_next; + $7->scope_next = $4; + } + opt_definition { - def_t scope; - scope.scope_next=$4; - PR_FlushScope (&scope); + PR_FlushScope ($7); + $7->scope_next = $8; $$ = $7; } - | '(' ')' { current_type = parse_params (0); } def_name opt_definition { $$ = $4; } - | '(' ELIPSIS ')' { current_type = parse_params ((def_t*)1); } def_name opt_definition { $$ = $5; } + | '(' ')' + { + current_type = parse_params (0); + } + def_name + { + $$ = $4->scope_next; + $4->scope_next = 0; + } + opt_definition + { + $4->scope_next = $5; + $$ = $4; + } + | '(' ELIPSIS ')' + { + current_type = parse_params ((def_t*)1); + } + def_name + { + $$ = $5->scope_next; + $5->scope_next = 0; + } + opt_definition + { + $5->scope_next = $6; + $$ = $5; + } ; def_name