From 26bbe37c6f0b99f23736380ba55f156f22bdaf06 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 29 Oct 2012 23:45:29 +0000 Subject: implement basic property getter functionality --- src/nsgenbind-parser.y | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/nsgenbind-parser.y') 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 Interface %type Operation %type Api +%type Getter +%type 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 '}' -- cgit v1.2.3