ANSII C structures and unions

Alan Fargusson alan at drivax.UUCP
Thu Apr 25 14:18:18 AEST 1985


I blew it. The grammar that was posted to the net has a bug
which I fixed as shown below. When I read the grammar in the
standard I missed the fact that the tag is optional. Everything
is okay.

Before fix:

struct_or_union_specifier
	: struct_or_union identifier '{' struct_declaration_list '}'
	| struct_or_union identifier
	;

After fix:

struct_or_union_specifier
	: struct_or_union identifier '{' struct_declaration_list '}'
	| struct_or_union '{' struct_declaration_list '}'
	| struct_or_union identifier
	;
-- 

Alan Fargusson.

{ ihnp4, sftig, amdahl, ucscc, ucbvax!unisoft }!drivax!alan



More information about the Comp.lang.c mailing list