ScummVM API documentation
sqlexer.h
1 /* see copyright notice in squirrel.h */
2 #ifndef _SQLEXER_H_
3 #define _SQLEXER_H_
4 
5 typedef unsigned char LexChar;
6 
7 struct SQLexer
8 {
9  SQLexer();
10  ~SQLexer();
11  void Init(SQSharedState *ss,SQLEXREADFUNC rg,SQUserPointer up,CompilerErrorFunc efunc,void *ed);
12  void Error(const SQChar *err);
13  SQInteger Lex();
14  const SQChar *Tok2Str(SQInteger tok);
15 private:
16  SQInteger GetIDType(const SQChar *s,SQInteger len);
17  SQInteger ReadString(SQInteger ndelim,bool verbatim);
18  SQInteger ReadNumber();
19  void LexBlockComment();
20  void LexLineComment();
21  SQInteger ReadID();
22  void Next();
23 
24  SQInteger AddUTF8(SQUnsignedInteger ch);
25  SQInteger ProcessStringHexEscape(SQChar *dest, SQInteger maxdigits);
26  SQInteger _curtoken = 0;
27  SQTable *_keywords = nullptr;
28  SQBool _reached_eof = SQFalse;
29 public:
30  SQInteger _prevtoken = 0;
31  SQInteger _currentline = 0;
32  SQInteger _lasttokenline = 0;
33  SQInteger _currentcolumn = 0;
34  const SQChar *_svalue = nullptr;
35  SQInteger _nvalue = 0;
36  SQFloat _fvalue = 0.f;
37  SQLEXREADFUNC _readf = nullptr;
38  SQUserPointer _up = nullptr;
39  LexChar _currdata = 0;
40  SQSharedState *_sharedstate = nullptr;
41  sqvector<SQChar> _longstr;
42  CompilerErrorFunc _errfunc = nullptr;
43  void *_errtarget = nullptr;
44 };
45 
46 #endif
Definition: sqtable.h:25
Definition: sqstate.h:59
Definition: sqlexer.h:7