This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

GCC 3.0 c-parse.y typo?


...
pushlevel:  /* empty */
                { pushlevel (0);
                  clear_last_expr ();
                  add_scope_stmt (/*begin_p=*/1, /*partial_p=*/0);
                }
        ;

poplevel:  /* empty */
                { $$ = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0); }

/* Start and end blocks created for the new scopes of C99.  */
c99_block_start: /* empty */

....

    | error compstmt
    ;

compstmt_start: '{' { compstmt_count++;
                      $$ = c_begin_compound_stmt (); }


compstmt_nostart: '}'

...

compstmt_primary_start:
    '(' '{'
        { if (current_function_decl == 0)
            {
              error ("braced-group within expression allowed only inside a function");
              YYERROR;
            }
          /* We must force a BLOCK for this level
             so that, if it is not expanded later,
             there is a way to turn off the entire subtree of blocks
             that are contained in it.  */
          keep_next_level ();
          push_label_level ();
          compstmt_count++;
          $$ = add_stmt (build_stmt (COMPOUND_STMT, last_tree));
        }

compstmt: compstmt_start compstmt_nostart
...


---- cut here ----

poplevel, compstmet_start, compstmt_primary_start are missing ';'s.

Though it doesn't make any difference for my yacc, it may cause
 troubles somewhere.

anyway, rules are rules.. aren't they? :)





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]