squirrel update
[supertux.git] / src / squirrel / squirrel / sqlexer.h
1 /*      see copyright notice in squirrel.h */\r
2 #ifndef _SQLEXER_H_\r
3 #define _SQLEXER_H_\r
4 \r
5 #define MAX_STRING 2024\r
6 \r
7 \r
8 \r
9 struct SQLexer\r
10 {\r
11         SQLexer();\r
12         ~SQLexer();\r
13         void Init(SQSharedState *ss,SQLEXREADFUNC rg,SQUserPointer up,CompilerErrorFunc efunc,void *ed);\r
14         void Error(const SQChar *err);\r
15         SQInteger Lex();\r
16         const SQChar *Tok2Str(SQInteger tok);\r
17 private:\r
18         SQInteger GetIDType(SQChar *s);\r
19         SQInteger ReadString(SQInteger ndelim,bool verbatim);\r
20         SQInteger ReadNumber();\r
21         void LexBlockComment();\r
22         SQInteger ReadID();\r
23         void Next();\r
24         SQInteger _curtoken;\r
25         SQTable *_keywords;\r
26 public:\r
27         SQInteger _prevtoken;\r
28         SQInteger _currentline;\r
29         SQInteger _lasttokenline;\r
30         SQInteger _currentcolumn;\r
31         const SQChar *_svalue;\r
32         SQInteger _nvalue;\r
33         SQFloat _fvalue;\r
34         SQLEXREADFUNC _readf;\r
35         SQUserPointer _up;\r
36 #ifdef _UNICODE\r
37         SQChar _currdata;\r
38 #else\r
39         unsigned char _currdata;\r
40 #endif\r
41         SQSharedState *_sharedstate;\r
42         sqvector<SQChar> _longstr;\r
43         CompilerErrorFunc _errfunc;\r
44         void *_errtarget;\r
45 };\r
46 \r
47 #endif\r