# HG changeset patch # User mario # Date 1195222341 -3600 # Node ID 284ef59bb1339afa7641db57c244d4e73424fd49 # Parent a1b03af4b26abd31ecac4f94e18b1fb5a7867420 Cleaning up comments. diff -r a1b03af4b26a -r 284ef59bb133 stage1_2/iec.y --- a/stage1_2/iec.y Fri Nov 16 13:47:41 2007 +0100 +++ b/stage1_2/iec.y Fri Nov 16 15:12:21 2007 +0100 @@ -172,15 +172,6 @@ symbol_c *leaf; list_c *list; char *ID; /* token value */ -/* - struct { - symbol_c *first; - symbol_c *second; - } tmp_symbol; -*/ -/* used as a temorary reference to symbols by: - il_simple_operator_clash_il_operand - */ } /* @@ -4377,14 +4368,21 @@ il_simple_operation: +// il_simple_operation ::= (il_simple_operator [il_operand]) | (function_name [il_operand_list]) il_simple_operator {$$ = new il_simple_operation_c($1, NULL, locloc(@$));} +/* + * Note: Bison is getting confused with the following rule, + * i.e. it is finding conflicts where there are really none. + * The rule was therefore replaced by the equivalent following + * two rules. + */ +/* +| il_simple_operator il_operand + {$$ = new il_simple_operation_c($1, $2, locloc(@$));} +*/ | il_simple_operator_noclash il_operand {$$ = new il_simple_operation_c($1, $2, locloc(@$));} -/* -| il_simple_operator_clash_il_operand - {$$ = new il_simple_operation_c($1.first, $1.second, locloc(@$));} -*/ | il_simple_operator_clash il_operand {$$ = new il_simple_operation_c($1, $2, locloc(@$));} /* NOTE: the line @@ -4436,28 +4434,10 @@ */ | function_name_no_clashes il_operand_list {$$ = new il_function_call_c($1, $2, locloc(@$));} -/* -| il_simple_operator_clash_il_operand ',' il_operand_list - {list_c *list = new il_operand_list_c(locloc(@$)); - list->add_element($1.second); - FOR_EACH_ELEMENT(elem, $3, {list->add_element(elem);}) - $$ = new il_function_call_c(il_operator_c_2_identifier_c($1.first), list, locloc(@$)); - } -*/ | il_simple_operator_clash il_operand_list2 - { - $$ = new il_function_call_c(il_operator_c_2_identifier_c($1), $2, locloc(@$)); - } -; - - - -/* -il_simple_operator_clash_il_operand: - il_simple_operator_clash il_operand - {$$.first = $1; $$.second = $2;} -; -*/ + {$$ = new il_function_call_c(il_operator_c_2_identifier_c($1), $2, locloc(@$));} +; + @@ -4471,16 +4451,12 @@ {$$ = new il_expression_c($1, NULL, $4, locloc(@$));} | il_expr_operator_noclash '(' il_operand eol_list simple_instr_list ')' {$$ = new il_expression_c($1, $3, $5, locloc(@$));} -/* -*/ | il_expr_operator_clash '(' eol_list ')' {$$ = new il_expression_c($1, NULL, NULL, locloc(@$));} | il_expr_operator_clash '(' il_operand eol_list ')' {$$ = new il_expression_c($1, $3, NULL, locloc(@$));} | il_expr_operator_clash '(' il_operand eol_list simple_instr_list ')' {$$ = new il_expression_c($1, $3, $5, locloc(@$));} -/* -*/ | il_expr_operator_clash_eol_list simple_instr_list ')' {$$ = new il_expression_c($1, NULL, $2, locloc(@$));} ;