diff --git a/tools/widl/parser.l b/tools/widl/parser.l index 2938fb68858..3a535e829fa 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -289,11 +289,13 @@ static const struct keyword attr_keywords[] = {"aggregatable", tAGGREGATABLE}, {"allocate", tALLOCATE}, {"annotation", tANNOTATION}, + {"apartment", tAPARTMENT}, {"appobject", tAPPOBJECT}, {"async", tASYNC}, {"async_uuid", tASYNCUUID}, {"auto_handle", tAUTOHANDLE}, {"bindable", tBINDABLE}, + {"both", tBOTH}, {"broadcast", tBROADCAST}, {"byte_count", tBYTECOUNT}, {"call_as", tCALLAS}, @@ -320,6 +322,7 @@ static const struct keyword attr_keywords[] = {"explicit_handle", tEXPLICITHANDLE}, {"fault_status", tFAULTSTATUS}, {"force_allocate", tFORCEALLOCATE}, + {"free", tFREE}, {"handle", tHANDLE}, {"helpcontext", tHELPCONTEXT}, {"helpfile", tHELPFILE}, @@ -342,6 +345,7 @@ static const struct keyword attr_keywords[] = {"local", tLOCAL}, {"maybe", tMAYBE}, {"message", tMESSAGE}, + {"neutral", tNEUTRAL}, {"nocode", tNOCODE}, {"nonbrowsable", tNONBROWSABLE}, {"noncreatable", tNONCREATABLE}, @@ -356,6 +360,7 @@ static const struct keyword attr_keywords[] = {"out", tOUT}, {"partial_ignore", tPARTIALIGNORE}, {"pointer_default", tPOINTERDEFAULT}, + {"progid", tPROGID}, {"propget", tPROPGET}, {"propput", tPROPPUT}, {"propputref", tPROPPUTREF}, @@ -369,12 +374,14 @@ static const struct keyword attr_keywords[] = {"requestedit", tREQUESTEDIT}, {"restricted", tRESTRICTED}, {"retval", tRETVAL}, + {"single", tSINGLE}, {"size_is", tSIZEIS}, {"source", tSOURCE}, {"strict_context_handle", tSTRICTCONTEXTHANDLE}, {"string", tSTRING}, {"switch_is", tSWITCHIS}, {"switch_type", tSWITCHTYPE}, + {"threading", tTHREADING}, {"transmit_as", tTRANSMITAS}, {"uidefault", tUIDEFAULT}, {"unique", tUNIQUE}, @@ -384,6 +391,7 @@ static const struct keyword attr_keywords[] = {"v1_enum", tV1ENUM}, {"vararg", tVARARG}, {"version", tVERSION}, + {"vi_progid", tVIPROGID}, {"wire_marshal", tWIREMARSHAL}, }; diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 1bf9a1e9150..c924a662f7f 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -239,7 +239,7 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s %token tOUT %token tPARTIALIGNORE tPASCAL %token tPOINTERDEFAULT -%token tPROPERTIES +%token tPROGID tPROPERTIES %token tPROPGET tPROPPUT tPROPPUTREF %token tPROXY tPTR %token tPUBLIC @@ -260,7 +260,7 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s %token tSTRICTCONTEXTHANDLE %token tSTRING tSTRUCT %token tSWITCH tSWITCHIS tSWITCHTYPE -%token tTRANSMITAS +%token tTHREADING tTRANSMITAS %token tTRUE %token tTYPEDEF %token tUIDEFAULT tUNION @@ -269,9 +269,10 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s %token tUSESGETLASTERROR tUSERMARSHAL tUUID %token tV1ENUM %token tVARARG -%token tVERSION +%token tVERSION tVIPROGID %token tVOID %token tWCHAR tWIREMARSHAL +%token tAPARTMENT tNEUTRAL tSINGLE tFREE tBOTH %type attribute type_qualifier function_specifier %type m_attributes attributes attrib_list m_type_qual_list @@ -299,7 +300,7 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s %type m_abstract_declarator abstract_declarator abstract_declarator_no_direct abstract_direct_declarator %type declarator_list struct_declarator_list %type coclass coclasshdr coclassdef -%type pointer_type version +%type pointer_type threading_type version %type libraryhdr callconv cppquote importlib import t_ident %type uuid_string %type import_start @@ -538,6 +539,7 @@ attribute: { $$ = NULL; } | tOUT { $$ = make_attr(ATTR_OUT); } | tPARTIALIGNORE { $$ = make_attr(ATTR_PARTIALIGNORE); } | tPOINTERDEFAULT '(' pointer_type ')' { $$ = make_attrv(ATTR_POINTERDEFAULT, $3); } + | tPROGID '(' aSTRING ')' { $$ = make_attrp(ATTR_PROGID, $3); } | tPROPGET { $$ = make_attr(ATTR_PROPGET); } | tPROPPUT { $$ = make_attr(ATTR_PROPPUT); } | tPROPPUTREF { $$ = make_attr(ATTR_PROPPUTREF); } @@ -559,6 +561,7 @@ attribute: { $$ = NULL; } | tSWITCHIS '(' expr ')' { $$ = make_attrp(ATTR_SWITCHIS, $3); } | tSWITCHTYPE '(' type ')' { $$ = make_attrp(ATTR_SWITCHTYPE, $3); } | tTRANSMITAS '(' type ')' { $$ = make_attrp(ATTR_TRANSMITAS, $3); } + | tTHREADING '(' threading_type ')' { $$ = make_attrv(ATTR_THREADING, $3); } | tUIDEFAULT { $$ = make_attr(ATTR_UIDEFAULT); } | tUSESGETLASTERROR { $$ = make_attr(ATTR_USESGETLASTERROR); } | tUSERMARSHAL '(' type ')' { $$ = make_attrp(ATTR_USERMARSHAL, $3); } @@ -566,6 +569,7 @@ attribute: { $$ = NULL; } | tV1ENUM { $$ = make_attr(ATTR_V1ENUM); } | tVARARG { $$ = make_attr(ATTR_VARARG); } | tVERSION '(' version ')' { $$ = make_attrv(ATTR_VERSION, $3); } + | tVIPROGID '(' aSTRING ')' { $$ = make_attrp(ATTR_VIPROGID, $3); } | tWIREMARSHAL '(' type ')' { $$ = make_attrp(ATTR_WIREMARSHAL, $3); } | pointer_type { $$ = make_attrv(ATTR_POINTERTYPE, $1); } ; @@ -1069,6 +1073,14 @@ init_declarator: | declarator '=' expr_const { $$ = $1; $1->var->eval = $3; } ; +threading_type: + tAPARTMENT { $$ = THREADING_APARTMENT; } + | tNEUTRAL { $$ = THREADING_NEUTRAL; } + | tSINGLE { $$ = THREADING_SINGLE; } + | tFREE { $$ = THREADING_FREE; } + | tBOTH { $$ = THREADING_BOTH; } + ; + pointer_type: tREF { $$ = RPC_FC_RP; } | tUNIQUE { $$ = RPC_FC_UP; } @@ -2070,6 +2082,7 @@ struct allowed_attr allowed_attr[] = /* ATTR_PARTIALIGNORE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "partial_ignore" }, /* ATTR_POINTERDEFAULT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "pointer_default" }, /* ATTR_POINTERTYPE */ { 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "ref, unique or ptr" }, + /* ATTR_PROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "progid" }, /* ATTR_PROPGET */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propget" }, /* ATTR_PROPPUT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propput" }, /* ATTR_PROPPUTREF */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propputref" }, @@ -2087,6 +2100,7 @@ struct allowed_attr allowed_attr[] = /* ATTR_STRING */ { 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "string" }, /* ATTR_SWITCHIS */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "switch_is" }, /* ATTR_SWITCHTYPE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, "switch_type" }, + /* ATTR_THREADING */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "threading" }, /* ATTR_TRANSMITAS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "transmit_as" }, /* ATTR_UIDEFAULT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "uidefault" }, /* ATTR_USESGETLASTERROR */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "usesgetlasterror" }, @@ -2095,6 +2109,7 @@ struct allowed_attr allowed_attr[] = /* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, "v1_enum" }, /* ATTR_VARARG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "vararg" }, /* ATTR_VERSION */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "version" }, + /* ATTR_VIPROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "vi_progid" }, /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "wire_marshal" }, }; diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h index 40962ed61c8..295ad7097d8 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h @@ -135,6 +135,7 @@ enum attr_type ATTR_PARTIALIGNORE, ATTR_POINTERDEFAULT, ATTR_POINTERTYPE, + ATTR_PROGID, ATTR_PROPGET, ATTR_PROPPUT, ATTR_PROPPUTREF, @@ -152,6 +153,7 @@ enum attr_type ATTR_STRING, ATTR_SWITCHIS, ATTR_SWITCHTYPE, + ATTR_THREADING, ATTR_TRANSMITAS, ATTR_UIDEFAULT, ATTR_USERMARSHAL, @@ -160,6 +162,7 @@ enum attr_type ATTR_V1ENUM, ATTR_VARARG, ATTR_VERSION, + ATTR_VIPROGID, ATTR_WIREMARSHAL }; @@ -240,6 +243,15 @@ enum statement_type STMT_CPPQUOTE }; +enum threading_type +{ + THREADING_APARTMENT = 1, + THREADING_NEUTRAL, + THREADING_SINGLE, + THREADING_FREE, + THREADING_BOTH +}; + enum type_basic_type { TYPE_BASIC_INT8 = 1,