X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fmain.c;h=df7aed341ca5c5096d98f35fc6456d0f9857338b;hb=639ac6b9f7a89f10d02c5d9ef41bca3bad4eaf2b;hp=4901e43812d0cd654b5f3d69f0b71b54cb9fe88f;hpb=3e1312c39052252e112f435ba3193f550cf891cb;p=swftools.git diff --git a/lib/as3/main.c b/lib/as3/main.c index 4901e43..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; @@ -59,7 +63,13 @@ int main(int argn, char*argv[]) exit(1); } 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;