--- a/c2iec.y +++ b/c2iec.y @@ -118,9 +118,9 @@ | postfix_expression PTR_OP IDENTIFIER { sprintf($<str>$, "%s %s %s",$<str>1, $<str>2, $<str>3);} | postfix_expression INC_OP - { sprintf($<str>$, "((%s:=%s+1)-1)",$<str>1, $<str>1); } + { sprintf($<str>$, "%s:=%s+1",$<str>1, $<str>1); } | postfix_expression DEC_OP - { sprintf($<str>$, "((%s:=%s-1)+1)",$<str>1, $<str>1); } + { sprintf($<str>$, "%s:=%s-1",$<str>1, $<str>1); } | '(' type_name ')' '{' initializer_list '}' | '(' type_name ')' '{' initializer_list ',' '}' ; @@ -272,7 +272,7 @@ declaration : declaration_specifiers ';' - { sprintf($<str>$, "%s %s\n",$<str>1, $<str>2); } + { sprintf($<str>$, "%s %s;\n",$<str>1, $<str>2); } | TYPEDEF declaration_specifiers init_declarator_list ';' { char *p; @@ -695,7 +695,7 @@ block_item : declaration | statement -// { printf("%s\n",$<str>1); } + //{ printf("%s\n",$<str>1); } ; expression_statement