From 4806630104448616ccf8c3e5cd1050c06b05a056 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 5 Oct 2004 02:14:54 +0000 Subject: [PATCH] Added support for the propget/propput function attributes. --- tools/widl/header.c | 4 ++++ tools/widl/parser.l | 2 ++ tools/widl/parser.y | 5 ++++- tools/widl/widltypes.h | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/widl/header.c b/tools/widl/header.c index 5332d5fe292..34238b13adc 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -90,6 +90,10 @@ static void write_pident(FILE *h, var_t *v) void write_name(FILE *h, var_t *v) { + if (is_attr( v->attrs, ATTR_PROPGET )) + fprintf(h, "get_" ); + else if (is_attr( v->attrs, ATTR_PROPPUT )) + fprintf(h, "put_" ); fprintf(h, "%s", v->name); } diff --git a/tools/widl/parser.l b/tools/widl/parser.l index 2e7cd2b14a9..992c6a10169 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -262,6 +262,8 @@ static struct keyword { {"pointer_default", tPOINTERDEFAULT}, /* ... */ {"properties", tPROPERTIES}, + {"propget", tPROPGET}, + {"propput", tPROPPUT}, /* ... */ {"public", tPUBLIC}, /* ... */ diff --git a/tools/widl/parser.y b/tools/widl/parser.y index a835a549f8a..d9cab5a5216 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -156,6 +156,7 @@ static type_t std_uhyper = { "MIDL_uhyper" }; %token tOUT %token tPOINTERDEFAULT %token tPROPERTIES +%token tPROPGET tPROPPUT %token tPUBLIC %token tREADONLY tREF %token tRETVAL @@ -359,6 +360,8 @@ attribute: | tOLEAUTOMATION { $$ = make_attr(ATTR_OLEAUTOMATION); } | tOUT { $$ = make_attr(ATTR_OUT); } | tPOINTERDEFAULT '(' pointer_type ')' { $$ = make_attrv(ATTR_POINTERDEFAULT, $3); } + | tPROPGET { $$ = make_attr(ATTR_PROPGET); } + | tPROPPUT { $$ = make_attr(ATTR_PROPPUT); } | tPUBLIC { $$ = make_attr(ATTR_PUBLIC); } | tREADONLY { $$ = make_attr(ATTR_READONLY); } | tRETVAL { $$ = make_attr(ATTR_RETVAL); } @@ -502,7 +505,7 @@ funcdef: $4->attrs = $1; $$ = make_func($4, $6); if (is_attr($4->attrs, ATTR_IN)) { - yyerror("Inapplicatable attribute"); + yyerror("Inapplicable attribute"); } if (!is_attr($4->attrs, ATTR_OUT)) { attr_t *a = make_attr(ATTR_OUT); diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h index 799d05ba0b6..2ef1f77767a 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h @@ -83,6 +83,8 @@ enum attr_type ATTR_OUT, ATTR_POINTERDEFAULT, ATTR_POINTERTYPE, + ATTR_PROPGET, + ATTR_PROPPUT, ATTR_PUBLIC, ATTR_READONLY, ATTR_RETVAL,