From ade96212575df58bc0f714168a87d9975eea273a Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 29 Oct 2012 13:40:13 +0000 Subject: add internal and API to binding language split out class operation, initialisation and new generation --- src/nsgenbind-parser.y | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) (limited to 'src/nsgenbind-parser.y') diff --git a/src/nsgenbind-parser.y b/src/nsgenbind-parser.y index 500f4b8..ea0a625 100644 --- a/src/nsgenbind-parser.y +++ b/src/nsgenbind-parser.y @@ -42,11 +42,13 @@ char *errtxt; %token TOK_HDR_COMMENT %token TOK_PREAMBLE +%token TOK_API %token TOK_BINDING %token TOK_OPERATION %token TOK_INTERFACE %token TOK_TYPE %token TOK_PRIVATE +%token TOK_INTERNAL %token TOK_IDENTIFIER %token TOK_STRING_LITERAL @@ -65,8 +67,10 @@ char *errtxt; %type BindingArg %type Type %type Private +%type Internal %type Interface %type Operation +%type Api %% @@ -107,6 +111,8 @@ Statement Binding | Operation + | + Api ; /* [3] load a web IDL file */ @@ -162,12 +168,25 @@ Operation TOK_OPERATION TOK_IDENTIFIER CBlock { $$ = genbind_new_node(GENBIND_NODE_TYPE_OPERATION, - NULL, - genbind_new_node(GENBIND_NODE_TYPE_IDENT, - genbind_new_node(GENBIND_NODE_TYPE_CBLOCK, - NULL, - $3), - $2)); + NULL, + genbind_new_node(GENBIND_NODE_TYPE_IDENT, + genbind_new_node(GENBIND_NODE_TYPE_CBLOCK, + NULL, + $3), + $2)); + } + +Api + : + TOK_API TOK_IDENTIFIER CBlock + { + $$ = genbind_new_node(GENBIND_NODE_TYPE_API, + NULL, + genbind_new_node(GENBIND_NODE_TYPE_IDENT, + genbind_new_node(GENBIND_NODE_TYPE_CBLOCK, + NULL, + $3), + $2)); } Binding @@ -196,6 +215,8 @@ BindingArg | Private | + Internal + | Interface ; @@ -217,6 +238,16 @@ Private } ; +Internal + : + TOK_INTERNAL TOK_STRING_LITERAL TOK_IDENTIFIER ';' + { + $$ = genbind_new_node(GENBIND_NODE_TYPE_BINDING_INTERNAL, NULL, + genbind_new_node(GENBIND_NODE_TYPE_IDENT, + genbind_new_node(GENBIND_NODE_TYPE_STRING, NULL, $2), $3)); + } + ; + Interface : TOK_INTERFACE TOK_IDENTIFIER ';' -- cgit v1.2.1