diff options
author | Vincent Sanders <vincent.sanders@collabora.co.uk> | 2012-09-26 18:54:34 +0100 |
---|---|---|
committer | Vincent Sanders <vincent.sanders@collabora.co.uk> | 2012-09-26 18:54:34 +0100 |
commit | caf565eb318cdf19a1d5e4b4bab7cd462301efef (patch) | |
tree | a2d1757530af5d385b07e4d77ab2d8745cdf88c5 /src/webidl-parser.y | |
parent | 74ea37fbd83a0d381ae928c7f7e30d0ded875cc0 (diff) | |
download | nsgenbind-caf565eb318cdf19a1d5e4b4bab7cd462301efef.tar.gz nsgenbind-caf565eb318cdf19a1d5e4b4bab7cd462301efef.tar.bz2 |
add modifier to allow setting of readonly or unsigned etc.
add property getter/setter body
Diffstat (limited to 'src/webidl-parser.y')
-rw-r--r-- | src/webidl-parser.y | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/webidl-parser.y b/src/webidl-parser.y index fef57dd..81f0dfc 100644 --- a/src/webidl-parser.y +++ b/src/webidl-parser.y @@ -161,7 +161,9 @@ webidl_error(YYLTYPE *locp, struct webidl_node **winbind_ast, const char *str) %type <node> UnsignedIntegerType %type <node> IntegerType +%type <isit> ReadOnly %type <isit> OptionalLong +%type <isit> Inherit %% @@ -522,23 +524,46 @@ Attribute: Inherit ReadOnly TOK_ATTRIBUTE Type TOK_IDENTIFIER ';' { struct webidl_node *attribute; + attribute = webidl_node_new(WEBIDL_NODE_TYPE_IDENT, NULL, $5); + + /* add attributes type */ + attribute = webidl_node_prepend(attribute, $4); + + /* deal with readonly modifier */ + if ($2) { + attribute = webidl_node_new(WEBIDL_NODE_TYPE_MODIFIER, attribute, (void *)WEBIDL_TYPE_READONLY); + } + $$ = webidl_node_new(WEBIDL_NODE_TYPE_ATTRIBUTE, NULL, attribute); + } ; /* [33] */ Inherit: /* empty */ + { + $$ = false; + } | TOK_INHERIT + { + $$ = true; + } ; /* [34] */ ReadOnly: /* empty */ + { + $$ = false; + } | TOK_READONLY + { + $$ = true; + } ; /* [35] */ @@ -1036,7 +1061,7 @@ PrimitiveType: UnrestrictedFloatType: TOK_UNRESTRICTED FloatType { - $$ = webidl_node_new(WEBIDL_NODE_TYPE_TYPE_MODIFIER, + $$ = webidl_node_new(WEBIDL_NODE_TYPE_MODIFIER, $2, (void *)WEBIDL_TYPE_MODIFIER_UNRESTRICTED); } @@ -1061,7 +1086,7 @@ FloatType: UnsignedIntegerType: TOK_UNSIGNED IntegerType { - $$ = webidl_node_new(WEBIDL_NODE_TYPE_TYPE_MODIFIER, + $$ = webidl_node_new(WEBIDL_NODE_TYPE_MODIFIER, $2, (void *)WEBIDL_TYPE_MODIFIER_UNSIGNED); } |