00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef FORMULA_TOKENIZER_HPP_INCLUDED
00015 #define FORMULA_TOKENIZER_HPP_INCLUDED
00016
00017 #include <string>
00018
00019 namespace formula_tokenizer
00020 {
00021
00022 typedef std::string::const_iterator iterator;
00023
00024 enum TOKEN_TYPE { TOKEN_OPERATOR, TOKEN_STRING_LITERAL,
00025 TOKEN_IDENTIFIER, TOKEN_INTEGER,
00026 TOKEN_LPARENS, TOKEN_RPARENS,
00027 TOKEN_LSQUARE, TOKEN_RSQUARE,
00028 TOKEN_LBRACKET, TOKEN_RBRACKET,
00029 TOKEN_COMMA, TOKEN_SEMICOLON,
00030 TOKEN_WHITESPACE, TOKEN_KEYWORD,
00031 TOKEN_COMMENT, TOKEN_POINTER };
00032
00033 struct token {
00034 TOKEN_TYPE type;
00035 iterator begin, end;
00036 };
00037
00038 token get_token(iterator& i1, iterator i2);
00039
00040 struct token_error {};
00041
00042 }
00043
00044 #endif