index
 1  /************************************************************
 2  * file: Lexer.h
 3  * date: 2006-03-31
 4  * author: ideawu
 5  * describe: none; lexer
 6  *************************************************************/
 7
 8  #include "common.h"
 9
10  class Lexer{
11  private:
12      char *src;
13      int length;
14      int index;
15      char *buf;
16
17  public:
18      Lexer(char *filename);
19      Lexer();
20      ~Lexer();
21      void reset();   // rewind index
22      bool isReady();
23      bool isFinished();
24      char *getSrc();
25      int getIndex();
26
27      void setSrc(char *s, int len);
28
29      Token nextToken();
30  };
31
32
33