X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fmain.c;h=df7aed341ca5c5096d98f35fc6456d0f9857338b;hb=639ac6b9f7a89f10d02c5d9ef41bca3bad4eaf2b;hp=4cbbb718630441286cc132fe0cd03137efc29364;hpb=749bee41b380e032eb3c6713dc5b6630e6cd3d15;p=swftools.git diff --git a/lib/as3/main.c b/lib/as3/main.c index 4cbbb71..df7aed3 100644 --- a/lib/as3/main.c +++ b/lib/as3/main.c @@ -27,16 +27,19 @@ #include "../rfxswf.h" #include "../os.h" #include "files.h" +#include "common.h" #include "tokenizer.h" #include "parser.tab.h" #include "parser.h" #include "compiler.h" +#include "import.h" void test_lexer(char*filename) { - char*fullfilename = enter_file(filename, 0); + char*fullfilename = find_file(filename, 1); + enter_file(filename, fullfilename, 0); FILE*fi = fopen(fullfilename, "rb"); - as3_set_in(fi); + as3_file_input(fi); while(1) { int token = as3_lex(); if(token==T_EOF) @@ -49,6 +52,7 @@ void test_lexer(char*filename) } } +extern int a3_debug; int main(int argn, char*argv[]) { char*filename = 0; @@ -58,18 +62,55 @@ int main(int argn, char*argv[]) fprintf(stderr, "please supply a filename\n"); exit(1); } - filename=argv[1]; - - if(argn>2 && !strcmp(argv[2], "-lex")) { - test_lexer(filename); - return 0; + filename=argv[argn-1]; + + //a3_debug = 1; //if bison was called with -t + + as3_add_include_dir(getcwd(buf, 512)); + + registry_init(); + + int t=0; + for(t=1;tdata, m->len); + //memfile_close(m); + if(!strcmp(filename, ".")) { + as3_parse_directory("."); + } else { + as3_parse_file(filename); + } + void*code = as3_getcode(); SWF swf;