From 6406dae8c4da597da888345cf145f366b8297d7c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 24 Jul 2015 00:01:51 +0100 Subject: Build interface map allowing for correct dependency generation This constructs an ordered list of all interfaces in their dependency order. The topological sort ordering is derived from the interfaces inheritance. The resulting table allows the generation phase to easily map interfaces to classes defined in the binding with a useful ordering. Additionally it was noticed that the uievent IDL was missing so that has now been added and allows for a much more complete graph of interfaces to be constructed. --- src/nsgenbind.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/nsgenbind.c') diff --git a/src/nsgenbind.c b/src/nsgenbind.c index 914f58e..18db196 100644 --- a/src/nsgenbind.c +++ b/src/nsgenbind.c @@ -14,10 +14,11 @@ #include #include +#include "options.h" #include "nsgenbind-ast.h" #include "webidl-ast.h" #include "jsapi-libdom.h" -#include "options.h" +#include "interface-map.h" struct options *options; @@ -194,6 +195,7 @@ int main(int argc, char **argv) int res; struct genbind_node *genbind_root = NULL; struct webidl_node *webidl_root = NULL; + struct interface_map *interface_map = NULL; enum bindingtype_e bindingtype; options = process_cmdline(argc, argv); @@ -226,6 +228,15 @@ int main(int argc, char **argv) /* debug dump of web idl AST */ webidl_dump_ast(webidl_root); + /* generate index of interfaces in idl sorted by inheritance */ + res = interface_map_new(genbind_root, webidl_root, &interface_map); + if (res != 0) { + return 5; + } + + /* dump the interface mapping */ + interface_map_dump(interface_map); + interface_map_dumpdot(interface_map); #if 0 /* generate output for each binding */ -- cgit v1.2.3