summaryrefslogtreecommitdiff
path: root/src/genjsbind-parser.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/genjsbind-parser.y')
-rw-r--r--src/genjsbind-parser.y42
1 files changed, 29 insertions, 13 deletions
diff --git a/src/genjsbind-parser.y b/src/genjsbind-parser.y
index 8436034..ce8a1fd 100644
--- a/src/genjsbind-parser.y
+++ b/src/genjsbind-parser.y
@@ -37,12 +37,19 @@ int genjsbind_wrap()
%token TOK_IDLFILE
%token TOK_HDR_COMMENT
-%token TOK_INTERFACE
%token TOK_PREAMBLE
+%token TOK_BINDING
+%token TOK_INTERFACE
+%token TOK_TYPE
+%token TOK_EXTRA
+
+%token <text> TOK_IDENTIFIER
+
%token <text> TOK_STRING_LITERAL
%token <text> TOK_CCODE_LITERAL
+
%%
/* [1] start with Statements */
@@ -59,7 +66,7 @@ Statement
|
Preamble
|
- Interface
+ Binding
;
/* [3] load a web IDL file */
@@ -73,33 +80,25 @@ IdlFile
;
HdrComment
- : TOK_HDR_COMMENT Strings ';'
+ : TOK_HDR_COMMENT HdrStrings ';'
{
}
;
-Strings
+HdrStrings
:
TOK_STRING_LITERAL
{
genjsbind_header_comment($1);
}
|
- Strings TOK_STRING_LITERAL
+ HdrStrings TOK_STRING_LITERAL
{
genjsbind_header_comment($2);
}
;
-Interface
- :
- TOK_INTERFACE TOK_STRING_LITERAL ';'
- {
- genjsbind_interface($2);
- }
- ;
-
Preamble
:
TOK_PREAMBLE CBlock
@@ -118,4 +117,21 @@ CBlock
}
;
+Binding
+ :
+ TOK_BINDING TOK_IDENTIFIER '{' BindingArgs '}' ';'
+ ;
+
+BindingArgs
+:
+;
+
+Interface
+ :
+ TOK_INTERFACE TOK_STRING_LITERAL ';'
+ {
+ genjsbind_interface($2);
+ }
+ ;
+
%%