Commit 91c35be7 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

widl: Write out more TYPEFLAGs and add more type library-specific

attributes to the parser.
parent 649d5d0e
......@@ -179,7 +179,6 @@ static struct keyword {
{"aggregatable", tAGGREGATABLE},
{"allocate", tALLOCATE},
{"appobject", tAPPOBJECT},
{"arrays", tARRAYS},
{"async", tASYNC},
{"async_uuid", tASYNCUUID},
{"auto_handle", tAUTOHANDLE},
......@@ -203,51 +202,45 @@ static struct keyword {
{"cpp_quote", tCPPQUOTE},
/* ... */
{"default", tDEFAULT},
{"defaultcollelem", tDEFAULTCOLLELEM},
{"defaultvalue", tDEFAULTVALUE},
/* ... */
{"defaultvtable", tDEFAULTVTABLE},
{"dispinterface", tDISPINTERFACE},
/* ... */
{"displaybind", tDISPLAYBIND},
{"dllname", tDLLNAME},
{"double", tDOUBLE},
{"dual", tDUAL},
/* ... */
{"endpoint", tENDPOINT},
{"entry", tENTRY},
{"enum", tENUM},
{"error_status_t", tERRORSTATUST},
{"explicit_handle", tEXPLICITHANDLE},
{"extern", tEXTERN},
/* ... */
{"float", tFLOAT},
/* ... */
{"handle", tHANDLE},
{"handle_t", tHANDLET},
/* ... */
{"helpcontext", tHELPCONTEXT},
{"helpfile", tHELPFILE},
{"helpstring", tHELPSTRING},
{"helpstringcontext", tHELPSTRINGCONTEXT},
{"helpstringdll", tHELPSTRINGDLL},
/* ... */
{"hidden", tHIDDEN},
{"hyper", tHYPER},
{"id", tID},
{"idempotent", tIDEMPOTENT},
/* ... */
{"iid_is", tIIDIS},
/* ... */
{"immediatebind", tIMMEDIATEBIND},
{"implicit_handle", tIMPLICITHANDLE},
{"import", tIMPORT},
{"importlib", tIMPORTLIB},
{"in", tIN},
{"include", tINCLUDE},
{"in_line", tINLINE},
{"input_sync", tINPUTSYNC},
{"int", tINT},
/* ... */
{"interface", tINTERFACE},
/* ... */
{"lcid", tLCID},
{"length_is", tLENGTHIS},
{"library", tLIBRARY},
/* ... */
......@@ -258,7 +251,9 @@ static struct keyword {
/* ... */
{"module", tMODULE},
/* ... */
{"nonbrowsable", tNONBROWSABLE},
{"noncreatable", tNONCREATABLE},
{"nonextensible", tNONEXTENSIBLE},
{"object", tOBJECT},
{"odl", tODL},
{"oleautomation", tOLEAUTOMATION},
......@@ -279,7 +274,7 @@ static struct keyword {
/* ... */
{"readonly", tREADONLY},
{"ref", tREF},
/* ... */
{"requestedit", tREQUESTEDIT},
{"restricted", tRESTRICTED},
{"retval", tRETVAL},
/* ... */
......
......@@ -126,13 +126,15 @@ static type_t std_uhyper = { "MIDL_uhyper" };
%token <uuid> aUUID
%token aEOF
%token SHL SHR
%token tAGGREGATABLE tALLOCATE tAPPOBJECT tARRAYS tASYNC tASYNCUUID
%token tAGGREGATABLE tALLOCATE tAPPOBJECT tASYNC tASYNCUUID
%token tAUTOHANDLE tBINDABLE tBOOLEAN tBROADCAST tBYTE tBYTECOUNT
%token tCALLAS tCALLBACK tCASE tCDECL tCHAR tCOCLASS tCODE tCOMMSTATUS
%token tCONST tCONTEXTHANDLE tCONTEXTHANDLENOSERIALIZE
%token tCONTEXTHANDLESERIALIZE tCONTROL tCPPQUOTE
%token tDEFAULT
%token tDEFAULTCOLLELEM
%token tDEFAULTVALUE
%token tDEFAULTVTABLE
%token tDISPLAYBIND
%token tDISPINTERFACE
%token tDLLNAME tDOUBLE tDUAL
......@@ -147,18 +149,22 @@ static type_t std_uhyper = { "MIDL_uhyper" };
%token tHIDDEN
%token tHYPER tID tIDEMPOTENT
%token tIIDIS
%token tIMMEDIATEBIND
%token tIMPLICITHANDLE
%token tIMPORT tIMPORTLIB
%token tIN tINCLUDE tINLINE
%token tIN tINLINE
%token tINPUTSYNC
%token tINT tINT64
%token tINTERFACE
%token tLCID
%token tLENGTHIS tLIBRARY
%token tLOCAL
%token tLONG
%token tMETHODS
%token tMODULE
%token tNONBROWSABLE
%token tNONCREATABLE
%token tNONEXTENSIBLE
%token tOBJECT tODL tOLEAUTOMATION
%token tOPTIONAL
%token tOUT
......@@ -169,6 +175,7 @@ static type_t std_uhyper = { "MIDL_uhyper" };
%token tPUBLIC
%token tRANGE
%token tREADONLY tREF
%token tREQUESTEDIT
%token tRESTRICTED
%token tRETVAL
%token tSHORT
......@@ -192,9 +199,6 @@ static type_t std_uhyper = { "MIDL_uhyper" };
%token tVOID
%token tWCHAR tWIREMARSHAL
/* used in attr_t */
%token tPOINTERTYPE
%type <attr> m_attributes attributes attrib_list attribute
%type <expr> m_exprs /* exprs expr_list */ m_expr expr expr_list_const expr_const
%type <expr> array array_list
......@@ -338,7 +342,9 @@ attrib_list: attribute
;
attribute:
tASYNC { $$ = make_attr(ATTR_ASYNC); }
tAGGREGATABLE { $$ = make_attr(ATTR_AGGREGATABLE); }
| tAPPOBJECT { $$ = make_attr(ATTR_APPOBJECT); }
| tASYNC { $$ = make_attr(ATTR_ASYNC); }
| tAUTOHANDLE { $$ = make_attr(ATTR_AUTO_HANDLE); }
| tBINDABLE { $$ = make_attr(ATTR_BINDABLE); }
| tCALLAS '(' ident ')' { $$ = make_attrp(ATTR_CALLAS, $3); }
......@@ -348,8 +354,10 @@ attribute:
| tCONTEXTHANDLESERIALIZE { $$ = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ }
| tCONTROL { $$ = make_attr(ATTR_CONTROL); }
| tDEFAULT { $$ = make_attr(ATTR_DEFAULT); }
| tDEFAULTCOLLELEM { $$ = make_attr(ATTR_DEFAULTCOLLELEM); }
| tDEFAULTVALUE '(' expr_const ')' { $$ = make_attrp(ATTR_DEFAULTVALUE_EXPR, $3); }
| tDEFAULTVALUE '(' aSTRING ')' { $$ = make_attrp(ATTR_DEFAULTVALUE_STRING, $3); }
| tDEFAULTVTABLE { $$ = make_attr(ATTR_DEFAULTVTABLE); }
| tDISPLAYBIND { $$ = make_attr(ATTR_DISPLAYBIND); }
| tDLLNAME '(' aSTRING ')' { $$ = make_attrp(ATTR_DLLNAME, $3); }
| tDUAL { $$ = make_attr(ATTR_DUAL); }
......@@ -367,12 +375,15 @@ attribute:
| tID '(' expr_const ')' { $$ = make_attrp(ATTR_ID, $3); }
| tIDEMPOTENT { $$ = make_attr(ATTR_IDEMPOTENT); }
| tIIDIS '(' ident ')' { $$ = make_attrp(ATTR_IIDIS, $3); }
| tIMMEDIATEBIND { $$ = make_attr(ATTR_IMMEDIATEBIND); }
| tIMPLICITHANDLE '(' tHANDLET aIDENTIFIER ')' { $$ = make_attrp(ATTR_IMPLICIT_HANDLE, $4); }
| tIN { $$ = make_attr(ATTR_IN); }
| tINPUTSYNC { $$ = make_attr(ATTR_INPUTSYNC); }
| tLENGTHIS '(' m_exprs ')' { $$ = make_attrp(ATTR_LENGTHIS, $3); }
| tLOCAL { $$ = make_attr(ATTR_LOCAL); }
| tNONBROWSABLE { $$ = make_attr(ATTR_NONBROWSABLE); }
| tNONCREATABLE { $$ = make_attr(ATTR_NONCREATABLE); }
| tNONEXTENSIBLE { $$ = make_attr(ATTR_NONEXTENSIBLE); }
| tOBJECT { $$ = make_attr(ATTR_OBJECT); }
| tODL { $$ = make_attr(ATTR_ODL); }
| tOLEAUTOMATION { $$ = make_attr(ATTR_OLEAUTOMATION); }
......@@ -385,6 +396,7 @@ attribute:
| tPUBLIC { $$ = make_attr(ATTR_PUBLIC); }
| tRANGE '(' expr_const ',' expr_const ')' { LINK($5, $3); $$ = make_attrp(ATTR_RANGE, $5); }
| tREADONLY { $$ = make_attr(ATTR_READONLY); }
| tREQUESTEDIT { $$ = make_attr(ATTR_REQUESTEDIT); }
| tRESTRICTED { $$ = make_attr(ATTR_RESTRICTED); }
| tRETVAL { $$ = make_attr(ATTR_RETVAL); }
| tSIZEIS '(' m_exprs ')' { $$ = make_attrp(ATTR_SIZEIS, $3); }
......@@ -552,6 +564,7 @@ ident: aIDENTIFIER { $$ = make_var($1); }
| aKNOWNTYPE { $$ = make_var($<str>1); }
| tASYNC { $$ = make_var($<str>1); }
| tID { $$ = make_var($<str>1); }
| tLCID { $$ = make_var($<str>1); }
| tRANGE { $$ = make_var($<str>1); }
| tRETVAL { $$ = make_var($<str>1); }
| tVERSION { $$ = make_var($<str>1); }
......
......@@ -56,6 +56,8 @@ typedef struct _typelib_t typelib_t;
enum attr_type
{
ATTR_AGGREGATABLE,
ATTR_APPOBJECT,
ATTR_ASYNC,
ATTR_AUTO_HANDLE,
ATTR_BINDABLE,
......@@ -64,8 +66,10 @@ enum attr_type
ATTR_CONTEXTHANDLE,
ATTR_CONTROL,
ATTR_DEFAULT,
ATTR_DEFAULTCOLLELEM,
ATTR_DEFAULTVALUE_EXPR,
ATTR_DEFAULTVALUE_STRING,
ATTR_DEFAULTVTABLE,
ATTR_DISPINTERFACE,
ATTR_DISPLAYBIND,
ATTR_DLLNAME,
......@@ -84,12 +88,15 @@ enum attr_type
ATTR_ID,
ATTR_IDEMPOTENT,
ATTR_IIDIS,
ATTR_IMMEDIATEBIND,
ATTR_IMPLICIT_HANDLE,
ATTR_IN,
ATTR_INPUTSYNC,
ATTR_LENGTHIS,
ATTR_LOCAL,
ATTR_NONBROWSABLE,
ATTR_NONCREATABLE,
ATTR_NONEXTENSIBLE,
ATTR_OBJECT,
ATTR_ODL,
ATTR_OLEAUTOMATION,
......@@ -103,6 +110,7 @@ enum attr_type
ATTR_PUBLIC,
ATTR_RANGE,
ATTR_READONLY,
ATTR_REQUESTEDIT,
ATTR_RESTRICTED,
ATTR_RETVAL,
ATTR_SIZEIS,
......
......@@ -1667,6 +1667,21 @@ static msft_typeinfo_t *create_msft_typeinfo(msft_typelib_t *typelib, enum type_
for( ; attr; attr = NEXT_LINK(attr)) {
switch(attr->type) {
case ATTR_AGGREGATABLE:
if (kind == TKIND_COCLASS)
typeinfo->flags |= 0x400; /* TYPEFLAG_FAGGREGATABLE */
break;
case ATTR_APPOBJECT:
if (kind == TKIND_COCLASS)
typeinfo->flags |= 0x1; /* TYPEFLAG_FAPPOBJECT */
break;
case ATTR_CONTROL:
if (kind == TKIND_COCLASS)
typeinfo->flags |= 0x20; /* TYPEFLAG_FCONTROL */
break;
case ATTR_DISPINTERFACE:
break;
......@@ -1678,7 +1693,8 @@ static msft_typeinfo_t *create_msft_typeinfo(msft_typelib_t *typelib, enum type_
}
case ATTR_DUAL:
typeinfo->flags |= 0x40; /* TYPEFLAG_FDUAL */
/* FIXME: check interface is compatible */
typeinfo->flags |= 0x140; /* TYPEFLAG_FDUAL | TYPEFLAG_FOLEAUTOMATION */
break;
case ATTR_HELPCONTEXT:
......@@ -1708,6 +1724,10 @@ static msft_typeinfo_t *create_msft_typeinfo(msft_typelib_t *typelib, enum type_
typeinfo->flags &= ~0x2; /* TYPEFLAG_FCANCREATE */
break;
case ATTR_NONEXTENSIBLE:
typeinfo->flags |= 0x80; /* TYPEFLAG_FNONEXTENSIBLE */
break;
case ATTR_ODL:
break;
......
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