Tokenizer.h 714 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef TOKENIZER_H
  2. #define TOKENIZER_H
  3. #include <string>
  4. #include "../data/ArrayList.h"
  5. #include "Token.h"
  6. #include "TokenList.h"
  7. using namespace std;
  8. class Tokenizer
  9. {
  10. public:
  11. Tokenizer(string s);
  12. Tokenizer(const Tokenizer& orig);
  13. virtual ~Tokenizer();
  14. void tokenize(TokenList& tokens);
  15. private:
  16. string data;
  17. int pos;
  18. int line;
  19. int length;
  20. void tokenize(TokenList& tokens, char c, TokenType type1, TokenType type2);
  21. void tokenize(TokenList& tokens, TokenType type1, char c2, TokenType, char c3, TokenType type3);
  22. void tokenize(TokenList& tokens, TokenType type1, char c2, char c3, TokenType type2, TokenType type3, char c4, TokenType type4);
  23. };
  24. #endif