WIDL: Add missing ignore attribute. Check for inapplicable attributes in typedef. (more better patch)

Saveliy Tretiakov saveliyt at mail.ru
Wed Mar 15 08:34:33 CST 2006


Addeded attribute into correct place, fixed identation.

ChangeLog:
Saveliy Tretiakov <saveliyt at mail.ru>
Add missing ignore attribute.
Check for inapplicable attributes in typedef.
Register type alias (without attributes) in typelib, if ATTR_PUBLIC is set.



-------------- next part --------------
Index: tools/widl/parser.l
===================================================================
RCS file: /home/wine/wine/tools/widl/parser.l,v
retrieving revision 1.35
diff -u -p -r1.35 parser.l
--- tools/widl/parser.l	9 Feb 2006 11:51:32 -0000	1.35
+++ tools/widl/parser.l	15 Mar 2006 13:48:51 -0000
@@ -228,6 +228,7 @@ static struct keyword {
 	{"hyper",			tHYPER},
 	{"id",				tID},
 	{"idempotent",			tIDEMPOTENT},
+	{"ignore", tIGNORE },
 /* ... */
 	{"iid_is",			tIIDIS},
 	{"immediatebind",		tIMMEDIATEBIND},
Index: tools/widl/parser.y
===================================================================
RCS file: /home/wine/wine/tools/widl/parser.y,v
retrieving revision 1.63
diff -u -p -r1.63 parser.y
--- tools/widl/parser.y	9 Feb 2006 11:51:32 -0000	1.63
+++ tools/widl/parser.y	15 Mar 2006 14:27:54 -0000
@@ -198,6 +198,7 @@ static type_t std_uhyper = { "MIDL_uhype
 %token tVERSION
 %token tVOID
 %token tWCHAR tWIREMARSHAL
+%token tIGNORE
 
 %type <attr> m_attributes attributes attrib_list attribute
 %type <expr> m_exprs /* exprs expr_list */ m_expr expr expr_list_const expr_const
@@ -411,6 +412,7 @@ attribute:
 	| tVERSION '(' version ')'		{ $$ = make_attrv(ATTR_VERSION, $3); }
 	| tWIREMARSHAL '(' type ')'		{ $$ = make_attrp(ATTR_WIREMARSHAL, type_ref($3)); }
 	| pointer_type				{ $$ = make_attrv(ATTR_POINTERTYPE, $1); }
+	| tIGNORE				{ $$ = make_attr(ATTR_IGNORE); }
 	;
 
 callconv:
@@ -768,7 +770,29 @@ type:	  tVOID					{ $$ = make_tref(NULL,
 	| tUNION aIDENTIFIER			{ $$ = make_tref(NULL, find_type2($2, tsUNION)); }
 	;
 
-typedef: tTYPEDEF m_attributes type pident_list	{ typeref_t *tref = uniq_tref($3);
+typedef: tTYPEDEF m_attributes type pident_list	{ 
+						  attr_t *a = $2;
+						  int public = 0;
+						  while(a){
+							switch(a->type)
+							{
+							case ATTR_CONTEXTHANDLE:
+							case ATTR_STRING:
+							case ATTR_HANDLE:
+							case ATTR_SWITCHTYPE:
+							case ATTR_TRANSMITAS:
+							case ATTR_POINTERTYPE:
+							case ATTR_IGNORE:
+								break;
+							case ATTR_PUBLIC:
+								public = 1;
+								break;
+							default:
+								yyerror("Inapplicable attribute\n");
+							}
+							a = NEXT_LINK(a);
+						  }
+						  typeref_t *tref = uniq_tref($3);
 						  $4->tname = tref->name;
 						  tref->name = NULL;
 						  $$ = type_ref(tref);
Index: tools/widl/widltypes.h
===================================================================
RCS file: /home/wine/wine/tools/widl/widltypes.h,v
retrieving revision 1.36
diff -u -p -r1.36 widltypes.h
--- tools/widl/widltypes.h	9 Feb 2006 11:51:32 -0000	1.36
+++ tools/widl/widltypes.h	15 Mar 2006 14:31:01 -0000
@@ -88,6 +88,7 @@ enum attr_type
     ATTR_ID,
     ATTR_IDEMPOTENT,
     ATTR_IIDIS,
+    ATTR_IGNORE,
     ATTR_IMMEDIATEBIND,
     ATTR_IMPLICIT_HANDLE,
     ATTR_IN,


More information about the wine-patches mailing list