Huw Davies : widl: Add support for parsing the annotation attribute.

Alexandre Julliard julliard at winehq.org
Mon Oct 26 10:08:39 CDT 2009


Module: wine
Branch: master
Commit: ab32b3df4df8adcee75e39b8bcc4e2330aa5b2a1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ab32b3df4df8adcee75e39b8bcc4e2330aa5b2a1

Author: Huw Davies <huw at codeweavers.com>
Date:   Mon Oct 26 12:15:23 2009 +0000

widl: Add support for parsing the annotation attribute.

---

 tools/widl/parser.l    |    1 +
 tools/widl/parser.y    |    4 +++-
 tools/widl/widltypes.h |    1 +
 3 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index 55a73c7..f45b228 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -279,6 +279,7 @@ static const struct keyword attr_keywords[] =
 {
         {"aggregatable",                tAGGREGATABLE},
         {"allocate",                    tALLOCATE},
+        {"annotation",                  tANNOTATION},
         {"appobject",                   tAPPOBJECT},
         {"async",                       tASYNC},
         {"async_uuid",                  tASYNCUUID},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index c2f1abc..b12741c 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -194,7 +194,7 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s
 %token EQUALITY INEQUALITY
 %token GREATEREQUAL LESSEQUAL
 %token LOGICALOR LOGICALAND
-%token tAGGREGATABLE tALLOCATE tAPPOBJECT tASYNC tASYNCUUID
+%token tAGGREGATABLE tALLOCATE tANNOTATION tAPPOBJECT tASYNC tASYNCUUID
 %token tAUTOHANDLE tBINDABLE tBOOLEAN tBROADCAST tBYTE tBYTECOUNT
 %token tCALLAS tCALLBACK tCASE tCDECL tCHAR tCOCLASS tCODE tCOMMSTATUS
 %token tCONST tCONTEXTHANDLE tCONTEXTHANDLENOSERIALIZE
@@ -472,6 +472,7 @@ str_list: aSTRING                               { $$ = append_str( NULL, $1 ); }
 
 attribute:					{ $$ = NULL; }
 	| tAGGREGATABLE				{ $$ = make_attr(ATTR_AGGREGATABLE); }
+	| tANNOTATION '(' aSTRING ')'		{ $$ = make_attrp(ATTR_ANNOTATION, $3); }
 	| tAPPOBJECT				{ $$ = make_attr(ATTR_APPOBJECT); }
 	| tASYNC				{ $$ = make_attr(ATTR_ASYNC); }
 	| tAUTOHANDLE				{ $$ = make_attr(ATTR_AUTO_HANDLE); }
@@ -1872,6 +1873,7 @@ struct allowed_attr allowed_attr[] =
 {
     /* attr                        { D ACF I Fn ARG T En St Un Fi  L  DI M  C  <display name> } */
     /* ATTR_AGGREGATABLE */        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "aggregatable" },
+    /* ATTR_ANNOTATION */          { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" },
     /* ATTR_APPOBJECT */           { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "appobject" },
     /* ATTR_ASYNC */               { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" },
     /* ATTR_AUTO_HANDLE */         { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "auto_handle" },
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index c1c07ea..e80c7ed 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -72,6 +72,7 @@ typedef struct list statement_list_t;
 enum attr_type
 {
     ATTR_AGGREGATABLE,
+    ATTR_ANNOTATION,
     ATTR_APPOBJECT,
     ATTR_ASYNC,
     ATTR_AUTO_HANDLE,




More information about the wine-cvs mailing list