summaryrefslogtreecommitdiff
path: root/src/genjsbind.c
diff options
context:
space:
mode:
authorVincent Sanders <vincent.sanders@collabora.co.uk>2012-09-04 16:36:01 +0100
committerVincent Sanders <vincent.sanders@collabora.co.uk>2012-09-04 16:36:01 +0100
commitdc672aedbafa7bf24cd24430abcae2d57528cf41 (patch)
tree269e737cb8adb48def5955bb5b4db6833ffd60e1 /src/genjsbind.c
downloadnsgenbind-dc672aedbafa7bf24cd24430abcae2d57528cf41.tar.gz
nsgenbind-dc672aedbafa7bf24cd24430abcae2d57528cf41.tar.bz2
Initial version of netsurf webidl javascript binding geenrator tool
Diffstat (limited to 'src/genjsbind.c')
-rw-r--r--src/genjsbind.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/genjsbind.c b/src/genjsbind.c
new file mode 100644
index 0000000..150c780
--- /dev/null
+++ b/src/genjsbind.c
@@ -0,0 +1,52 @@
+#include <stdio.h>
+
+#include "webidl-ast.h"
+
+#include "webidl-parser.h"
+#include "genbind-parser.h"
+
+extern int webidl_debug;
+extern FILE* webidl_in;
+extern int webidl_parse();
+
+extern int genbind_debug;
+extern FILE* genbind_in;
+extern int genbind_parse();
+
+int loadwebidl(char *filename)
+{
+ FILE *myfile = fopen(filename, "r");
+ if (!myfile) {
+ perror(filename);
+ return 2;
+ }
+ /* set flex to read from file */
+ webidl_in = myfile;
+
+ webidl_debug = 1;
+
+ /* parse through the input until there is no more: */
+ while (!feof(webidl_in)) {
+ webidl_parse();
+ }
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ FILE *myfile = fopen("htmldocument.bnd", "r");
+ if (!myfile) {
+ perror(NULL);
+ return 2;
+ }
+ /* set flex to read from file */
+ genbind_in = myfile;
+
+ genbind_debug = 1;
+
+ /* parse through the input until there is no more: */
+ while (!feof(genbind_in)) {
+ genbind_parse();
+ }
+ return 0;
+}