a/c99.y b/c2iec.y
...
...
543
    | selection_statement
543
    | selection_statement
544
    | iteration_statement
544
    | iteration_statement
545
    | jump_statement
545
    | jump_statement
546
    ;
546
    ;
547
547
548
case_statement
549
    : labeled_statement
550
    | compound_statement
551
    | expression_statement
552
    | selection_statement
553
    | iteration_statement
554
    | jump_statement
555
    { strcpy($<str>$, ""); }
556
    ;
557
548
labeled_statement
558
labeled_statement
549
    : IDENTIFIER ':' statement
559
    : IDENTIFIER ':' statement
550
    | CASE constant_expression ':' statement
560
    | CASE constant_expression ':' case_statement
561
    { sprintf($<str>$, "%s:\n%s",$<str>2, $<str>4); }
551
    | DEFAULT ':' statement
562
    | DEFAULT ':' statement
552
    ;
563
    ;
553
564
554
compound_statement
565
compound_statement
555
    : '{' '}'
566
    : '{' '}'
...
...
577
588
578
selection_statement
589
selection_statement
579
    : IF '(' expression ')' statement
590
    : IF '(' expression ')' statement
580
    | IF '(' expression ')' statement ELSE statement
591
    | IF '(' expression ')' statement ELSE statement
581
    | SWITCH '(' expression ')' statement
592
    | SWITCH '(' expression ')' statement
593
    { sprintf($<str>$, "CASE %s OF\n %s\nEND_CASE",$<str>3, $<str>5); }
582
    ;
594
    ;
583
595
584
iteration_statement
596
iteration_statement
585
    : WHILE '(' expression ')' statement
597
    : WHILE '(' expression ')' statement
586
    { sprintf($<str>$, "WHILE %s DO\n%s\nEND_WHILE\n",$<str>3, $<str>5); }
598
    { sprintf($<str>$, "WHILE %s DO\n%s\nEND_WHILE\n",$<str>3, $<str>5); }