main.cxx

changeset 50
2e333a3ca49a
parent 48
976c57f153b3
child 56
384c5605bda9
equal deleted inserted replaced
49:8e2f7a031410 50:2e333a3ca49a
57 #include "botcommands.h" 57 #include "botcommands.h"
58 58
59 const char* g_Keywords[] = { 59 const char* g_Keywords[] = {
60 "break", 60 "break",
61 "case", 61 "case",
62 "default",
62 "do", 63 "do",
63 "event", 64 "event",
64 "for", 65 "for",
65 "goto", 66 "goto",
66 "if", 67 "if",
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 ();

mercurial