From: ceriel Date: Sat, 7 Feb 1987 03:56:34 +0000 (+0000) Subject: The added ',' separator in token declarations did not work X-Git-Tag: release-5-5~4714 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=8f4a99cc2402dcf98005a33196340d30fc4f503f;p=ack.git The added ',' separator in token declarations did not work (reported by Kees Bot, Edwin Scheffer). This is corrected (I hope). --- diff --git a/util/ncgg/cgg.y b/util/ncgg/cgg.y index f61d58714..96e4649e1 100644 --- a/util/ncgg/cgg.y +++ b/util/ncgg/cgg.y @@ -86,7 +86,7 @@ iocc_t iops[20]; %token TIMEFACTOR SIZEFACTOR %token COST %type prop_list property ident_list ident_list_el -%type att_list att_list_el att_list_el_list structdecl optcost optformat +%type att_list att_list_el att_list_el_list att_ident structdecl optcost optformat %type kills allocates yields leaving %type generates kill_list kill_list_el uselist uselist_el genlist yieldlist %type leavelist leavelist_el gen_instruction @@ -302,28 +302,28 @@ att_list : /* empty */ { $$ = 0; } | att_list_el att_list - { $1->vi_next = $2; $$ = $1; } + { $$ = $1; while ($$->vi_next) $$ = $$->vi_next; + $$->vi_next = $2; $$ = $1; + } ; att_list_el - : att_list_el_type IDENT - { NEW ($$,struct varinfo); - $$->vi_int[0] = $1; - $$->vi_str[0] = $2; - att_type = $1; - } - att_list_el_list ';' - { $3->vi_next = $4; - $$ = $3; - } + : att_list_el_type + { att_type = $1; } + att_list_el_list + ';' + { $$ = $3; } ; att_list_el_list - : /* empty */ - { $$ = 0; } - | ',' IDENT att_list_el_list + : att_ident + | att_ident ',' att_list_el_list + { $1->vi_next = $3; $$ = $1; } + ; +att_ident + : IDENT { NEW($$, struct varinfo); - $$->vi_next = $3; + $$->vi_next = 0; $$->vi_int[0] = att_type; - $$->vi_str[0] = $2; + $$->vi_str[0] = $1; } ; att_list_el_type