Website Summary Files Commits Branches @commit @diff @stats
path: root / homework / 81352 / ts2html / token.h
blob: 977a57ccb0bf87fb1bc7fcf5d6a2371497b0f1a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef TOKEN
#define TOKEN

#include <string>

enum TokenType {
    KEYWORD,
    IDENTIFIER,
    NUMBER,
    OPERATOR,
    STRING,
    SEMICOLON,
    LEFT_BLOCK_BRACKET,
    RIGHT_BLOCK_BRACKET,
    LEFT_BRACKET,
    RIGHT_BRACKET,
    NEWLINE,
    WHITESPACE,
    DECORATOR,
    COMMENT,
    OTHER,
    UNRECOGNIZED
};
        
class Token {
    private: 
        std::string text;
        TokenType type;
    public:
        Token(std::string, TokenType);
        std::string getTypeName();
        std::string getTextValue();
        TokenType getTokenType();
};
#endif