src/Parser.h

changeset 112
def56932f938
parent 111
87d9ebd3ef34
child 115
9be16e1c1e44
equal deleted inserted replaced
111:87d9ebd3ef34 112:def56932f938
33 #include "Main.h" 33 #include "Main.h"
34 #include "Commands.h" 34 #include "Commands.h"
35 #include "LexerScanner.h" 35 #include "LexerScanner.h"
36 #include "Tokens.h" 36 #include "Tokens.h"
37 37
38 // TODO: get rid of this too?
39 #define MAX_CASE 64
40
41 // TODO: get rid of this
42 #define MAX_MARKS 512
43
44 class DataBuffer; 38 class DataBuffer;
45 class Lexer; 39 class Lexer;
46 class Variable; 40 class Variable;
47 41
48 // ============================================================================ 42 // ============================================================================
153 147
154 // ============================================================================ 148 // ============================================================================
155 // 149 //
156 class BotscriptParser 150 class BotscriptParser
157 { 151 {
158 PROPERTY (public, bool, ReadOnly, BOOL_OPS, STOCK_WRITE) 152 PROPERTY (public, bool, IsReadOnly, SetReadOnly, STOCK_WRITE)
159 153
160 public: 154 public:
161 enum EReset 155 enum EReset
162 { 156 {
163 eNoReset, 157 eNoReset,
174 void PushScope (EReset reset = SCOPE_Reset); 168 void PushScope (EReset reset = SCOPE_Reset);
175 DataBuffer* ParseStatement(); 169 DataBuffer* ParseStatement();
176 void AddSwitchCase (DataBuffer* b); 170 void AddSwitchCase (DataBuffer* b);
177 void CheckToplevel(); 171 void CheckToplevel();
178 void CheckNotToplevel(); 172 void CheckNotToplevel();
179 bool TokenIs (TokenType a); 173 bool TokenIs (ETokenType a);
180 String GetTokenString(); 174 String GetTokenString();
181 String DescribePosition() const; 175 String DescribePosition() const;
182 void WriteToFile (String outfile); 176 void WriteToFile (String outfile);
183 Variable* FindVariable (const String& name); 177 Variable* FindVariable (const String& name);
184 bool IsInGlobalState() const; 178 bool IsInGlobalState() const;

mercurial