Jacek Caban : widl: Add basic acf parser implementation.

Alexandre Julliard julliard at winehq.org
Fri Nov 9 14:12:16 CST 2018


Module: wine
Branch: master
Commit: 90748c581be41ecadcc6a0b38687900d0f7d1bba
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=90748c581be41ecadcc6a0b38687900d0f7d1bba

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Nov  9 13:51:04 2018 +0100

widl: Add basic acf parser implementation.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/widl/parser.y | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 542ee43..d979394 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -266,8 +266,9 @@ static typelib_t *current_typelib;
 %token tWCHAR tWIREMARSHAL
 %token tAPARTMENT tNEUTRAL tSINGLE tFREE tBOTH
 
-%type <attr> attribute type_qualifier function_specifier
+%type <attr> attribute type_qualifier function_specifier acf_attribute
 %type <attr_list> m_attributes attributes attrib_list m_type_qual_list
+%type <attr_list> acf_attributes acf_attribute_list
 %type <str_list> str_list
 %type <expr> m_expr expr expr_const expr_int_const array m_bitfield
 %type <expr_list> m_exprs /* exprs expr_list */ expr_list_int_const
@@ -1154,6 +1155,37 @@ version:
 
 acf_statements
         : /* empty */
+        | acf_interface acf_statements
+
+acf_int_statements
+        : /* empty */
+        | acf_int_statement acf_int_statements
+
+acf_int_statement
+        : tTYPEDEF acf_attributes aKNOWNTYPE ';'
+                                                { type_t *type = find_type_or_error($3, 0);
+                                                  type->attrs = append_attr_list(type->attrs, $2);
+                                                }
+acf_interface
+        : acf_attributes tINTERFACE aKNOWNTYPE '{' acf_int_statements '}'
+                                                {  type_t *iface = find_type_or_error2($3, 0);
+                                                   if (type_get_type(iface) != TYPE_INTERFACE)
+                                                       error_loc("%s is not an interface\n", iface->name);
+                                                   iface->attrs = append_attr_list(iface->attrs, $1);
+                                                }
+
+acf_attributes
+        : /* empty */                           { $$ = NULL; };
+        | '[' acf_attribute_list ']'            { $$ = $2; };
+
+acf_attribute_list
+        : acf_attribute                         { $$ = append_attr(NULL, $1); }
+        | acf_attribute_list ',' acf_attribute  { $$ = append_attr($1, $3); }
+
+acf_attribute
+        : tENCODE                               { $$ = make_attr(ATTR_ENCODE); }
+        | tDECODE                               { $$ = make_attr(ATTR_DECODE); }
+        | tEXPLICITHANDLE                       { $$ = make_attr(ATTR_EXPLICIT_HANDLE); }
 
 %%
 




More information about the wine-cvs mailing list