From d36c21c4f53270f9ba8137bb1e84a7de45fea0f3 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 22 Jul 2015 22:12:05 +0100 Subject: Load the WebIDL files specified in the binding This loads the WebIDL specified in the bindings into an Abstract Syntax Tree (AST) and performs the mixin operations for implements. Additionally the specs now use a slightly extended IDL syntax. Instead of wholesale implementing the second edition of the IDL spec the parser has been updated to cope with iterator and Promise keywords as those are the only changes used in the dom and html specifications. A bug was also fixed in the lexer where negative int literals were not recognised. --- src/nsgenbind-ast.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'src/nsgenbind-ast.c') diff --git a/src/nsgenbind-ast.c b/src/nsgenbind-ast.c index 1b5f53c..c1acee1 100644 --- a/src/nsgenbind-ast.c +++ b/src/nsgenbind-ast.c @@ -20,6 +20,11 @@ #include "nsgenbind-ast.h" #include "options.h" +/** + * standard IO handle for parse trace logging. + */ +static FILE *genbind_parsetracef; + /* parser and lexer interface */ extern int nsgenbind_debug; extern int nsgenbind__flex_debug; @@ -448,23 +453,23 @@ static int genbind_ast_dump(FILE *dfile, struct genbind_node *node, int indent) /* exported interface documented in nsgenbind-ast.h */ int genbind_dump_ast(struct genbind_node *node) { - FILE *dumpf; + FILE *dumpf; - /* only dump AST to file if required */ - if (!options->debug) { - return 0; - } + /* only dump AST to file if required */ + if (!options->debug) { + return 0; + } - dumpf = genb_fopen("binding-ast", "w"); - if (dumpf == NULL) { - return 2; - } + dumpf = genb_fopen("binding-ast", "w"); + if (dumpf == NULL) { + return 2; + } - genbind_ast_dump(dumpf, node, 0); + genbind_ast_dump(dumpf, node, 0); - fclose(dumpf); + fclose(dumpf); - return 0; + return 0; } FILE *genbindopen(const char *filename) @@ -545,10 +550,6 @@ FILE *genbindopen(const char *filename) return genfile; } -/** - * standard IO handle for parse trace logging. - */ -static FILE *genbind_parsetracef; int genbind_parsefile(char *infilename, struct genbind_node **ast) { -- cgit v1.2.3