summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-10-12 12:26:44 (GMT)
committer Vincent Sanders <vince@kyllikki.org>2015-10-12 12:26:44 (GMT)
commit44edef813d0319616dd5003dd62267742bd0e0a9 (patch)
tree7b43005f60cb84475ce20f59e577af00016bfd8a
parentb13a9384d961d1895d9e8527596048386a90e1ea (diff)
downloadnsgenbind-44edef813d0319616dd5003dd62267742bd0e0a9.tar.gz
nsgenbind-44edef813d0319616dd5003dd62267742bd0e0a9.tar.bz2
Extend the permitted values of the binding method names
-rw-r--r--src/nsgenbind-parser.y23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/nsgenbind-parser.y b/src/nsgenbind-parser.y
index 88c69b1..7c2f7ce 100644
--- a/src/nsgenbind-parser.y
+++ b/src/nsgenbind-parser.y
@@ -230,6 +230,7 @@ add_method(struct genbind_node **genbind_ast,
%type <node> ClassFlags
%type <node> Method
+%type <text> MethodName
%type <node> MethodDeclarator
%type <value> MethodType
%type <value> BindingAndMethodType
@@ -470,8 +471,26 @@ BindingAndMethodType:
}
;
+MethodName:
+ TOK_IDENTIFIER
+ {
+ $$ = $1;
+ }
+ |
+ TOK_METHOD
+ {
+ $$ = strdup("method");
+ }
+ |
+ TOK_TYPE
+ {
+ $$ = strdup("type");
+ }
+ ;
+
+/* declarator of a binding method */
MethodDeclarator:
- TOK_IDENTIFIER TOK_DBLCOLON TOK_IDENTIFIER '(' ParameterList ')'
+ TOK_IDENTIFIER TOK_DBLCOLON MethodName '(' ParameterList ')'
{
$$ = genbind_new_node(GENBIND_NODE_TYPE_CLASS,
genbind_new_node(GENBIND_NODE_TYPE_IDENT,
@@ -482,7 +501,7 @@ MethodDeclarator:
$1));
}
|
- TOK_IDENTIFIER TOK_DBLCOLON TOK_IDENTIFIER '(' ')'
+ TOK_IDENTIFIER TOK_DBLCOLON MethodName '(' ')'
{
$$ = genbind_new_node(GENBIND_NODE_TYPE_CLASS,
genbind_new_node(GENBIND_NODE_TYPE_IDENT,