2012-11-02 23:07:00 +00:00
|
|
|
#ifndef TOKEN_H
|
|
|
|
#define TOKEN_H
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
typedef enum { t_invalid_token=0, t_symbol, t_integer, t_literal,
|
2012-12-17 08:37:45 +00:00
|
|
|
t_punctuation, t_keyword, t_operator, t_float } type_of_token;
|
|
|
|
|
2012-11-02 23:07:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Token
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
type_of_token type;
|
|
|
|
string value;
|
|
|
|
Token() : type(t_invalid_token), value("") {};
|
|
|
|
Token(type_of_token type, string value) : type(type), value(value) { };
|
|
|
|
type_of_token get_type() { return type; };
|
|
|
|
string get_value() { return value; };
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TOKEN_H
|