bsp
|
00001 #ifndef _TOKENIZER_H_ 00002 #define _TOKENIZER_H_ 00003 00004 #include "global.h" 00005 00006 class Tokenizer 00007 { 00008 public: 00009 Tokenizer(char *data); 00010 ~Tokenizer(); 00011 00012 int avail_line(); //equiv !TokenAvail 00013 void skipline(); //read to end of line 00014 bool next (bool crossline); //next token 00015 void putback(); //current token will be returned on next() 00016 void begin(); //move to beginning of data 00017 00018 char token[MAXTOKEN]; 00019 bool unget; 00020 char *script_p; //points to byte after current token 00021 char *script_start; 00022 int line; 00023 bool getGroups; //try to parse groups in comments 00024 int curGroup; 00025 bool curLock; 00026 typedef enum error_e {success, err_eof, err_eol, err_too_large} tok_err; 00027 tok_err error; 00028 int error_line; 00029 const char *errormsg(); 00030 //todo error reset 00031 }; 00032 00033 #endif //_TOKENIZER_H_