main.cxx

changeset 67
0a202714eea4
parent 66
4fc1ec88aa41
child 68
588cc27e84bb
equal deleted inserted replaced
66:4fc1ec88aa41 67:0a202714eea4
166 ReadEvents (); 166 ReadEvents ();
167 ReadCommands (); 167 ReadCommands ();
168 168
169 // Init stuff 169 // Init stuff
170 InitStringTable (); 170 InitStringTable ();
171 InitVariables ();
172 171
173 // Prepare reader and writer 172 // Prepare reader and writer
174 ScriptReader* r = new ScriptReader (argv[1]); 173 ScriptReader* r = new ScriptReader (argv[1]);
175 ObjWriter* w = new ObjWriter (outfile); 174 ObjWriter* w = new ObjWriter (outfile);
176 175
178 printf ("Parsing script...\n"); 177 printf ("Parsing script...\n");
179 r->ParseBotScript (w); 178 r->ParseBotScript (w);
180 printf ("Script parsed successfully.\n"); 179 printf ("Script parsed successfully.\n");
181 180
182 // Parse done, print statistics and write to file 181 // Parse done, print statistics and write to file
183 unsigned int globalcount = CountGlobalVars (); 182 unsigned int globalcount = g_GlobalVariables.size();
184 unsigned int stringcount = CountStringTable (); 183 unsigned int stringcount = CountStringTable ();
185 int NumMarks = w->MainBuffer->CountMarks (); 184 int NumMarks = w->MainBuffer->CountMarks ();
186 int NumRefs = w->MainBuffer->CountReferences (); 185 int NumRefs = w->MainBuffer->CountReferences ();
187 printf ("%u / %u strings written\n", stringcount, MAX_LIST_STRINGS); 186 printf ("%u / %u strings written\n", stringcount, MAX_LIST_STRINGS);
188 printf ("%u / %u global variables\n", globalcount, MAX_SCRIPT_VARIABLES); 187 printf ("%u / %u global variables\n", globalcount, MAX_SCRIPT_VARIABLES);

mercurial