diff options
author | Vincent Sanders <vincent.sanders@collabora.co.uk> | 2012-09-05 11:38:56 +0100 |
---|---|---|
committer | Vincent Sanders <vincent.sanders@collabora.co.uk> | 2012-09-05 20:06:05 +0100 |
commit | 26dc8906aeb0783cf36bde31e9051b29a193eb23 (patch) | |
tree | 0921de4f6a92c3dc6571c1ba693e4ff19d76df8d /src/genjsbind-parser.y | |
parent | 1c7bc7e17ace1e457c4c0336353f142aef36d254 (diff) | |
download | nsgenbind-26dc8906aeb0783cf36bde31e9051b29a193eb23.tar.gz nsgenbind-26dc8906aeb0783cf36bde31e9051b29a193eb23.tar.bz2 |
make tests work
add basic commandlien handling
Diffstat (limited to 'src/genjsbind-parser.y')
-rw-r--r-- | src/genjsbind-parser.y | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/genjsbind-parser.y b/src/genjsbind-parser.y new file mode 100644 index 0000000..08b8926 --- /dev/null +++ b/src/genjsbind-parser.y @@ -0,0 +1,60 @@ +/* + * This is a bison parser for genbind + * + */ + +%{ + +#include <stdio.h> +#include <string.h> + +#include "genjsbind-parser.h" +#include "genjsbind-lexer.h" +#include "genjsbind.h" + +static void genjsbind_error(const char *str) +{ + fprintf(stderr,"error: %s\n",str); +} + + +int genjsbind_wrap() +{ + return 1; +} + + + +%} + +%define api.pure + +%union +{ + char* text; +} + +%token TOK_IDLFILE + +%token <text> TOK_STRING_LITERAL + +%% + + /* [1] start with Statements */ +Statements: + /* empty */ + | + IdlFile + ; + + /* [2] load a web IDL file */ +IdlFile: + TOK_IDLFILE TOK_STRING_LITERAL ';' + { + if (loadwebidl($2) != 0) { + YYABORT; + } + } + ; + +%% |