main.cxx

changeset 38
e4bbd540663b
parent 37
c349dca807f9
child 41
47e686c96d8f
equal deleted inserted replaced
37:c349dca807f9 38:e4bbd540663b
62 "mainloop", 62 "mainloop",
63 "onenter", 63 "onenter",
64 "onexit", 64 "onexit",
65 "var", 65 "var",
66 "goto", 66 "goto",
67 "if",
67 68
68 // These ones aren't implemented yet but I plan to do so, thus they are 69 // These ones aren't implemented yet but I plan to do so, thus they are
69 // reserved. Also serves as a to-do list of sorts for me. >:F 70 // reserved. Also serves as a to-do list of sorts for me. >:F
70 "break", 71 "break",
71 "case", 72 "case",
74 "do", 75 "do",
75 "else", 76 "else",
76 "enum", // Would enum actually be useful? I think so. 77 "enum", // Would enum actually be useful? I think so.
77 "for", 78 "for",
78 "func", // Would function support need external support from zandronum? 79 "func", // Would function support need external support from zandronum?
79 "if",
80 "return", 80 "return",
81 "switch", 81 "switch",
82 "while" 82 "while"
83 }; 83 };
84 84
167 printf ("Parsing script..\n"); 167 printf ("Parsing script..\n");
168 r->BeginParse (w); 168 r->BeginParse (w);
169 169
170 // Parse done, print statistics and write to file 170 // Parse done, print statistics and write to file
171 unsigned int globalcount = CountGlobalVars (); 171 unsigned int globalcount = CountGlobalVars ();
172 printf ("%u/%u global variable%s\n", globalcount, MAX_SCRIPT_VARIABLES, PLURAL (globalcount)); 172 printf ("%u / %u global variable%s\n", globalcount, MAX_SCRIPT_VARIABLES, PLURAL (globalcount));
173 printf ("%d state%s written\n", g_NumStates, PLURAL (g_NumStates)); 173 printf ("%d state%s written\n", g_NumStates, PLURAL (g_NumStates));
174 printf ("%d event%s written\n", g_NumEvents, PLURAL (g_NumEvents)); 174 printf ("%d event%s written\n", g_NumEvents, PLURAL (g_NumEvents));
175 w->WriteToFile (); 175 w->WriteToFile ();
176 176
177 // Clear out the junk 177 // Clear out the junk
178 printf ("clear r\n");
179 delete r; 178 delete r;
180 printf ("clear w\n");
181 delete w; 179 delete w;
182 printf ("done!\n"); 180
181 // Done!
182 exit (0);
183 } 183 }
184 184
185 // ============================================================================ 185 // ============================================================================
186 // Utility functions 186 // Utility functions
187 187

mercurial