diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-07-24 00:01:51 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-07-24 00:01:51 +0100 |
commit | 6406dae8c4da597da888345cf145f366b8297d7c (patch) | |
tree | f862560fbfd34b913484fce42c1997894f90b093 /src/nsgenbind.c | |
parent | d36c21c4f53270f9ba8137bb1e84a7de45fea0f3 (diff) | |
download | nsgenbind-6406dae8c4da597da888345cf145f366b8297d7c.tar.gz nsgenbind-6406dae8c4da597da888345cf145f366b8297d7c.tar.bz2 |
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.
Diffstat (limited to 'src/nsgenbind.c')
-rw-r--r-- | src/nsgenbind.c | 13 |
1 files changed, 12 insertions, 1 deletions
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 <getopt.h> #include <errno.h> +#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 */ |