Dan Hipschman : widl: Set type_t kind field correctly for all types.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 31 15:01:26 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 3e1ace5aa32c2995cedb0f75e3635a4ef57da0ed
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=3e1ace5aa32c2995cedb0f75e3635a4ef57da0ed

Author: Dan Hipschman <dsh at linux.ucla.edu>
Date:   Mon Jul 31 11:57:05 2006 -0700

widl: Set type_t kind field correctly for all types.

---

 tools/widl/parser.y |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 123a23a..db78003 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -487,6 +487,7 @@ enum:	  ident '=' expr_const			{ $$ = re
 	;
 
 enumdef: tENUM t_ident '{' enums '}'		{ $$ = get_typev(RPC_FC_ENUM16, $2, tsENUM);
+						  $$->kind = TKIND_ENUM;
 						  $$->fields = $4;
 						  $$->defined = TRUE;
                                                   if(in_typelib)
@@ -663,8 +664,8 @@ coclass_int:
 	  m_attributes interfacedec		{ $$ = make_ifref($2); $$->attrs = $1; }
 	;
 
-dispinterface: tDISPINTERFACE aIDENTIFIER	{ $$ = get_type(0, $2, 0); }
-	|      tDISPINTERFACE aKNOWNTYPE	{ $$ = get_type(0, $2, 0); }
+dispinterface: tDISPINTERFACE aIDENTIFIER	{ $$ = get_type(0, $2, 0); $$->kind = TKIND_DISPATCH; }
+	|      tDISPINTERFACE aKNOWNTYPE	{ $$ = get_type(0, $2, 0); $$->kind = TKIND_DISPATCH; }
 	;
 
 dispinterfacehdr: attributes dispinterface	{ attr_t *attrs;
@@ -707,8 +708,8 @@ inherit:					{ $$ = NULL; }
 	| ':' aKNOWNTYPE			{ $$ = find_type2($2, 0); }
 	;
 
-interface: tINTERFACE aIDENTIFIER		{ $$ = get_type(RPC_FC_IP, $2, 0); }
-	|  tINTERFACE aKNOWNTYPE		{ $$ = get_type(RPC_FC_IP, $2, 0); }
+interface: tINTERFACE aIDENTIFIER		{ $$ = get_type(RPC_FC_IP, $2, 0); $$->kind = TKIND_INTERFACE; }
+	|  tINTERFACE aKNOWNTYPE		{ $$ = get_type(RPC_FC_IP, $2, 0); $$->kind = TKIND_INTERFACE; }
 	;
 
 interfacehdr: attributes interface		{ $$ = $2;
@@ -742,8 +743,8 @@ interfacedec:
 	| dispinterface ';'			{ $$ = $1; if (!parse_only && do_header) write_forward($$); }
 	;
 
-module:   tMODULE aIDENTIFIER			{ $$ = make_type(0, NULL); $$->name = $2; }
-	| tMODULE aKNOWNTYPE			{ $$ = make_type(0, NULL); $$->name = $2; }
+module:   tMODULE aIDENTIFIER			{ $$ = make_type(0, NULL); $$->name = $2; $$->kind = TKIND_MODULE; }
+	| tMODULE aKNOWNTYPE			{ $$ = make_type(0, NULL); $$->name = $2; $$->kind = TKIND_MODULE; }
 	;
 
 modulehdr: attributes module			{ $$ = $2;
@@ -780,6 +781,7 @@ pointer_type:
 structdef: tSTRUCT t_ident '{' fields '}'	{ $$ = get_typev(RPC_FC_STRUCT, $2, tsSTRUCT);
                                                   /* overwrite RPC_FC_STRUCT with a more exact type */
 						  $$->type = get_struct_type( $4 );
+						  $$->kind = TKIND_RECORD;
 						  $$->fields = $4;
 						  $$->defined = TRUE;
                                                   if(in_typelib)
@@ -814,6 +816,7 @@ typedef: tTYPEDEF m_attributes type pide
 	;
 
 uniondef: tUNION t_ident '{' fields '}'		{ $$ = get_typev(RPC_FC_NON_ENCAPSULATED_UNION, $2, tsUNION);
+						  $$->kind = TKIND_UNION;
 						  $$->fields = $4;
 						  $$->defined = TRUE;
 						}
@@ -821,8 +824,10 @@ uniondef: tUNION t_ident '{' fields '}'	
 	  tSWITCH '(' s_field ')'
 	  m_ident '{' cases '}'			{ var_t *u = $7;
 						  $$ = get_typev(RPC_FC_ENCAPSULATED_UNION, $2, tsUNION);
+						  $$->kind = TKIND_UNION;
 						  if (!u) u = make_var("tagged_union");
 						  u->type = make_type(RPC_FC_NON_ENCAPSULATED_UNION, NULL);
+						  u->type->kind = TKIND_UNION;
 						  u->type->fields = $9;
 						  u->type->defined = TRUE;
 						  LINK(u, $5); $$->fields = u;




More information about the wine-cvs mailing list