3 Flash ActionScript 3.0 compiler
5 Part of the swftools package.
7 Copyright (c) 2008 Matthias Kramm <kramm@quiss.org>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
27 #include "../rfxswf.h"
30 #include "tokenizer.h"
31 #include "parser.tab.h"
37 int token = avm2_lex();
40 if(token>=32 && token<256) {
41 printf("'%c'\n", token);
43 printf("%s\n", token2string(token, avm2_lval));
48 int main(int argn, char*argv[])
54 fprintf(stderr, "please supply a filename\n");
61 add_include_dir(getcwd(buf, 512));
62 char*fullfilename = enter_file(filename, 0);
64 FILE*fi = fopen(fullfilename, "rb");
72 if(argn>2 && !strcmp(argv[2], "-lex")) {
77 void*code = finalize_state();
80 memset(&swf, 0, sizeof(swf));
82 swf.frameRate = 0x2500;
83 swf.movieSize.xmin = swf.movieSize.ymin = 0;
84 swf.movieSize.xmax = 1024*20;
85 swf.movieSize.ymax = 768*20;
86 TAG*tag = swf.firstTag = swf_InsertTag(0, ST_DOABC);
87 swf_WriteABC(tag, code);
90 tag = swf_InsertTag(tag, ST_SYMBOLCLASS);
93 swf_SetString(tag, globalclass);
95 printf("Warning: no global public MovieClip subclass\n");
98 tag = swf_InsertTag(tag, ST_SHOWFRAME);
99 tag = swf_InsertTag(tag, ST_END);
103 int f = open("abc.swf",O_RDWR|O_CREAT|O_TRUNC|O_BINARY,0644);
104 swf_WriteSWF(f,&swf);