[PATCH 3/5] widl: Support WinRT activatable attribute parsing.

Rémi Bernon rbernon at codeweavers.com
Tue Feb 2 02:22:35 CST 2021


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 tools/widl/parser.l    | 1 +
 tools/widl/parser.y    | 3 +++
 tools/widl/widltypes.h | 1 +
 3 files changed, 5 insertions(+)

diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index 7e20d30e7f0..264fa7f906c 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -320,6 +320,7 @@ static const struct keyword keywords[] = {
  */
 static const struct keyword attr_keywords[] =
 {
+	{"activatable",                 tACTIVATABLE,               1},
 	{"aggregatable",                tAGGREGATABLE,              0},
 	{"agile",                       tAGILE,                     1},
 	{"all_nodes",                   tALLNODES,                  0},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 1e3e254ec8c..3b7953ae19c 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -176,6 +176,7 @@ static typelib_t *current_typelib;
 %token GREATEREQUAL LESSEQUAL
 %token LOGICALOR LOGICALAND
 %token ELLIPSIS
+%token tACTIVATABLE
 %token tAGGREGATABLE
 %token tAGILE
 %token tALLNODES tALLOCATE tANNOTATION
@@ -542,6 +543,7 @@ contract_req: decl_spec ',' contract_ver	{ if ($1->type->type_type != TYPE_APICO
 						}
 
 attribute:					{ $$ = NULL; }
+	| tACTIVATABLE '(' contract_req ')'	{ $$ = make_attrp(ATTR_ACTIVATABLE, $3); }
 	| tAGGREGATABLE				{ $$ = make_attr(ATTR_AGGREGATABLE); }
 	| tANNOTATION '(' aSTRING ')'		{ $$ = make_attrp(ATTR_ANNOTATION, $3); }
 	| tAPPOBJECT				{ $$ = make_attr(ATTR_APPOBJECT); }
@@ -2243,6 +2245,7 @@ struct allowed_attr
 struct allowed_attr allowed_attr[] =
 {
     /* attr                        { D ACF M   I Fn ARG T En Enm St Un Fi L  DI M  C AC  R  <display name> } */
+    /* ATTR_ACTIVATABLE */         { 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "activatable" },
     /* ATTR_AGGREGATABLE */        { 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "aggregatable" },
     /* ATTR_ALLOCATE */            { 0, 1, 0,  0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "allocate" },
     /* ATTR_ANNOTATION */          { 0, 0, 0,  0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" },
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 0fba33d6a09..5d4532d6434 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -69,6 +69,7 @@ typedef struct list warning_list_t;
 
 enum attr_type
 {
+    ATTR_ACTIVATABLE,
     ATTR_AGGREGATABLE,
     ATTR_ALLOCATE,
     ATTR_ANNOTATION,
-- 
2.30.0




More information about the wine-devel mailing list