+
+ registry_init();
+
+ int t=0;
+ char*mainclass = 0;
+ for(t=1;t<argn-1;t++) {
+ if(!strcmp(argv[t], "-lex")) {
+ test_lexer(filename);
+ return 0;
+ }
+ if(!strcmp(argv[t], "-M")) {
+ mainclass = argv[++t];
+ }
+ if(!strcmp(argv[t], "-v")) {
+ as3_verbosity++;
+ }
+ if(!strcmp(argv[t], "-q")) {
+ as3_verbosity--;
+ }
+ if(!strcmp(argv[t], "-D")) {
+ char*c = argv[t+1];
+ if(!strstr(c, "::"))
+ printf("Error: compile definition must contain \"::\"\n");
+ as3_set_define(c);
+ }
+ if(!strcmp(argv[t], "-R")) {
+ as3_set_option("recurse","1");
+ }
+ if(!strcmp(argv[t], "-I")) {
+ as3_add_include_dir(argv[++t]);
+ }
+ if(!strcmp(argv[t], "-l")) {
+ as3_import_file(argv[++t]);
+ }
+ }
+
+ //extern int avm2_debug;
+ //avm2_debug = 1;
+
+ //memfile_t*m = memfile_open(filename);
+ //as3_parse_bytearray(filename, m->data, m->len);
+ //memfile_close(m);
+ if(!strcmp(filename, ".")) {
+ as3_parse_directory(".");
+ } else {
+ as3_parse_file(filename);
+ }
+