73 "while", |
74 "while", |
74 |
75 |
75 // These ones aren't implemented yet but I plan to do so, thus they are |
76 // These ones aren't implemented yet but I plan to do so, thus they are |
76 // reserved. Also serves as a to-do list of sorts for me. >:F |
77 // reserved. Also serves as a to-do list of sorts for me. >:F |
77 "continue", |
78 "continue", |
78 "default", |
|
79 "else", |
79 "else", |
80 "enum", // Would enum actually be useful? I think so. |
80 "enum", // Would enum actually be useful? I think so. |
81 "func", // Would function support need external support from zandronum? |
81 "func", // Would function support need external support from zandronum? |
82 "return", |
82 "return", |
83 }; |
83 }; |
161 // Init stuff |
161 // Init stuff |
162 InitStringTable (); |
162 InitStringTable (); |
163 InitVariables (); |
163 InitVariables (); |
164 |
164 |
165 // Prepare reader and writer |
165 // Prepare reader and writer |
166 ScriptReader *r = new ScriptReader (argv[1]); |
166 ScriptReader* r = new ScriptReader (argv[1]); |
167 ObjWriter *w = new ObjWriter (outfile); |
167 ObjWriter* w = new ObjWriter (outfile); |
168 |
168 |
169 // We're set, begin parsing :) |
169 // We're set, begin parsing :) |
170 printf ("Parsing script...\n"); |
170 printf ("Parsing script...\n"); |
171 r->BeginParse (w); |
171 r->ParseBotScript (w); |
172 printf ("Script parsed successfully.\n"); |
172 printf ("Script parsed successfully.\n"); |
173 |
173 |
174 // Parse done, print statistics and write to file |
174 // Parse done, print statistics and write to file |
175 unsigned int globalcount = CountGlobalVars (); |
175 unsigned int globalcount = CountGlobalVars (); |
176 unsigned int stringcount = CountStringTable (); |
176 unsigned int stringcount = CountStringTable (); |