Commit 41ddaaa4 by Richard Kenner

Update number of shift/reduce conflicts.

(structsp): Pass attribute arg to finish_struct.
Support attributes on enums and pass to finish_enum.

From-SVN: r9487
parent 10861e9a
...@@ -24,13 +24,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ ...@@ -24,13 +24,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
c-parse.y and into objc-parse.y. */ c-parse.y and into objc-parse.y. */
/* To whomever it may concern: I have heard that such a thing was once /* To whomever it may concern: I have heard that such a thing was once
written by AT&T, but I have never seen it. */ written by AT&T, but I have never seen it. */
ifobjc ifobjc
%expect 40 %expect 42
end ifobjc end ifobjc
ifc ifc
%expect 28 %expect 30
/* These are the 23 conflicts you should get in parse.output; /* These are the 23 conflicts you should get in parse.output;
the state numbers may vary if minor changes in the grammar are made. the state numbers may vary if minor changes in the grammar are made.
...@@ -1310,41 +1310,34 @@ structsp: ...@@ -1310,41 +1310,34 @@ structsp:
/* Start scope of tag before parsing components. */ /* Start scope of tag before parsing components. */
} }
component_decl_list '}' maybe_attribute component_decl_list '}' maybe_attribute
{ $$ = finish_struct ($<ttype>4, $5); { $$ = finish_struct ($<ttype>4, $5, $7); }
decl_attributes ($$, $7, NULL_TREE);
/* Really define the structure. */
}
| STRUCT '{' component_decl_list '}' maybe_attribute | STRUCT '{' component_decl_list '}' maybe_attribute
{ $$ = finish_struct (start_struct (RECORD_TYPE, NULL_TREE), { $$ = finish_struct (start_struct (RECORD_TYPE, NULL_TREE),
$3); $3, $5);
decl_attributes ($$, $5, NULL_TREE);
} }
| STRUCT identifier | STRUCT identifier
{ $$ = xref_tag (RECORD_TYPE, $2); } { $$ = xref_tag (RECORD_TYPE, $2); }
| UNION identifier '{' | UNION identifier '{'
{ $$ = start_struct (UNION_TYPE, $2); } { $$ = start_struct (UNION_TYPE, $2); }
component_decl_list '}' maybe_attribute component_decl_list '}' maybe_attribute
{ $$ = finish_struct ($<ttype>4, $5); { $$ = finish_struct ($<ttype>4, $5, $7); }
decl_attributes ($$, $7, NULL_TREE);
}
| UNION '{' component_decl_list '}' maybe_attribute | UNION '{' component_decl_list '}' maybe_attribute
{ $$ = finish_struct (start_struct (UNION_TYPE, NULL_TREE), { $$ = finish_struct (start_struct (UNION_TYPE, NULL_TREE),
$3); $3, $5);
decl_attributes ($$, $5, NULL_TREE);
} }
| UNION identifier | UNION identifier
{ $$ = xref_tag (UNION_TYPE, $2); } { $$ = xref_tag (UNION_TYPE, $2); }
| ENUM identifier '{' | ENUM identifier '{'
{ $<itype>3 = suspend_momentary (); { $<itype>3 = suspend_momentary ();
$$ = start_enum ($2); } $$ = start_enum ($2); }
enumlist maybecomma_warn '}' enumlist maybecomma_warn '}' maybe_attribute
{ $$ = finish_enum ($<ttype>4, nreverse ($5)); { $$ = finish_enum ($<ttype>4, nreverse ($5), $8);
resume_momentary ($<itype>3); } resume_momentary ($<itype>3); }
| ENUM '{' | ENUM '{'
{ $<itype>2 = suspend_momentary (); { $<itype>2 = suspend_momentary ();
$$ = start_enum (NULL_TREE); } $$ = start_enum (NULL_TREE); }
enumlist maybecomma_warn '}' enumlist maybecomma_warn '}' maybe_attribute
{ $$ = finish_enum ($<ttype>3, nreverse ($4)); { $$ = finish_enum ($<ttype>3, nreverse ($4), $7);
resume_momentary ($<itype>2); } resume_momentary ($<itype>2); }
| ENUM identifier | ENUM identifier
{ $$ = xref_tag (ENUMERAL_TYPE, $2); } { $$ = xref_tag (ENUMERAL_TYPE, $2); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment