summaryrefslogtreecommitdiff
path: root/src/nsgenbind-parser.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/nsgenbind-parser.y')
-rw-r--r--src/nsgenbind-parser.y34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/nsgenbind-parser.y b/src/nsgenbind-parser.y
index ea0a625..1ffab7a 100644
--- a/src/nsgenbind-parser.y
+++ b/src/nsgenbind-parser.y
@@ -45,6 +45,8 @@ char *errtxt;
%token TOK_API
%token TOK_BINDING
%token TOK_OPERATION
+%token TOK_GETTER
+%token TOK_SETTER
%token TOK_INTERFACE
%token TOK_TYPE
%token TOK_PRIVATE
@@ -71,6 +73,8 @@ char *errtxt;
%type <node> Interface
%type <node> Operation
%type <node> Api
+%type <node> Getter
+%type <node> Setter
%%
@@ -113,6 +117,10 @@ Statement
Operation
|
Api
+ |
+ Getter
+ |
+ Setter
;
/* [3] load a web IDL file */
@@ -189,6 +197,32 @@ Api
$2));
}
+Getter
+ :
+ TOK_GETTER TOK_IDENTIFIER CBlock
+ {
+ $$ = genbind_new_node(GENBIND_NODE_TYPE_GETTER,
+ NULL,
+ genbind_new_node(GENBIND_NODE_TYPE_IDENT,
+ genbind_new_node(GENBIND_NODE_TYPE_CBLOCK,
+ NULL,
+ $3),
+ $2));
+ }
+
+Setter
+ :
+ TOK_SETTER TOK_IDENTIFIER CBlock
+ {
+ $$ = genbind_new_node(GENBIND_NODE_TYPE_SETTER,
+ NULL,
+ genbind_new_node(GENBIND_NODE_TYPE_IDENT,
+ genbind_new_node(GENBIND_NODE_TYPE_CBLOCK,
+ NULL,
+ $3),
+ $2));
+ }
+
Binding
:
TOK_BINDING TOK_IDENTIFIER '{' BindingArgs '}'