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