diff options
author | Vincent Sanders <vincent.sanders@collabora.co.uk> | 2012-09-24 20:29:25 +0100 |
---|---|---|
committer | Vincent Sanders <vincent.sanders@collabora.co.uk> | 2012-09-24 20:29:25 +0100 |
commit | 4b043613d1a20980b13a6e9b0c8a7ff91c035b2f (patch) | |
tree | ce818286fe2227746369e026ad7b84d7ea083177 | |
parent | b5c59d1138c704afd09c4716faabe79f04a80616 (diff) | |
download | nsgenbind-4b043613d1a20980b13a6e9b0c8a7ff91c035b2f.tar.gz nsgenbind-4b043613d1a20980b13a6e9b0c8a7ff91c035b2f.tar.bz2 |
add interface function return type
-rw-r--r-- | src/webidl-ast.c | 5 | ||||
-rw-r--r-- | src/webidl-ast.h | 1 | ||||
-rw-r--r-- | src/webidl-parser.y | 9 |
3 files changed, 13 insertions, 2 deletions
diff --git a/src/webidl-ast.c b/src/webidl-ast.c index 53ba7e6..91da839 100644 --- a/src/webidl-ast.c +++ b/src/webidl-ast.c @@ -25,8 +25,9 @@ struct webidl_node { struct webidl_node *l; union { void *value; - struct webidl_node *node; - char *text; + struct webidl_node *node; /* node has a list of nodes */ + char *text; /* node data is text */ + int number; /* node data is an integer */ } r; }; diff --git a/src/webidl-ast.h b/src/webidl-ast.h index 7c32d82..c41149d 100644 --- a/src/webidl-ast.h +++ b/src/webidl-ast.h @@ -39,6 +39,7 @@ enum webidl_type { WEBIDL_TYPE_OBJECT, WEBIDL_TYPE_DATE, WEBIDL_TYPE_USER, + WEBIDL_TYPE_VOID, }; enum webidl_type_modifier { diff --git a/src/webidl-parser.y b/src/webidl-parser.y index c3bb609..69fbef5 100644 --- a/src/webidl-parser.y +++ b/src/webidl-parser.y @@ -151,6 +151,7 @@ webidl_error(YYLTYPE *locp, struct webidl_node **winbind_ast, const char *str) %type <node> Ellipsis %type <node> Type +%type <node> ReturnType %type <node> SingleType %type <node> UnionType %type <node> NonAnyType @@ -581,6 +582,8 @@ OperationRest: { struct webidl_node *operation = $4; /* argument list */ + operation = webidl_node_prepend(operation, $1); /* return type */ + operation = webidl_node_prepend(operation, $2); /* identifier */ $$ = webidl_node_new(WEBIDL_NODE_TYPE_OPERATION, NULL, operation); @@ -1119,6 +1122,12 @@ ReturnType: Type | TOK_VOID + { + struct webidl_node *type; + type = webidl_node_new(WEBIDL_NODE_TYPE_TYPE_BASE, NULL, (void *)WEBIDL_TYPE_VOID); + $$ = webidl_node_new(WEBIDL_NODE_TYPE_TYPE, NULL, type); + } + ; %% |