/* * This is a bison parser for genbind * */ %{ #include #include #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 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; } } ; %%