Updated addon repository URL and improved debug output on download
[supertux.git] / external / 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 #ifdef SQUNICODE\r
6 typedef SQChar LexChar;\r
7 #else\r
8 typedef unsigned char LexChar;\r
9 #endif\r
10 \r
11 struct SQLexer\r
12 {\r
13         SQLexer();\r
14         ~SQLexer();\r
15         void Init(SQSharedState *ss,SQLEXREADFUNC rg,SQUserPointer up,CompilerErrorFunc efunc,void *ed);\r
16         void Error(const SQChar *err);\r
17         SQInteger Lex();\r
18         const SQChar *Tok2Str(SQInteger tok);\r
19 private:\r
20         SQInteger GetIDType(SQChar *s);\r
21         SQInteger ReadString(SQInteger ndelim,bool verbatim);\r
22         SQInteger ReadNumber();\r
23         void LexBlockComment();\r
24         void LexLineComment();\r
25         SQInteger ReadID();\r
26         void Next();\r
27         SQInteger _curtoken;\r
28         SQTable *_keywords;\r
29         SQBool _reached_eof;\r
30 public:\r
31         SQInteger _prevtoken;\r
32         SQInteger _currentline;\r
33         SQInteger _lasttokenline;\r
34         SQInteger _currentcolumn;\r
35         const SQChar *_svalue;\r
36         SQInteger _nvalue;\r
37         SQFloat _fvalue;\r
38         SQLEXREADFUNC _readf;\r
39         SQUserPointer _up;\r
40         LexChar _currdata;\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