blob: bb4612763a5c83f919790cfdffd50e2cc5b49149 [file] [log] [blame]
swissChili7babd922021-12-02 22:46:48 -08001#pragma once
2
3#include <QList>
4#include <QChar>
5
6class Token {
7public:
8 Token();
9 Token(const Token &other);
10
11 explicit Token(QChar symbol);
12 explicit Token(QString &&identifier);
13 explicit Token(QList<Token> &&parenthesized);
14 Token(char varType, const QString &&name);
15
16 bool operator ==(const Token &other);
17
18 ~Token();
19
20 bool isSym();
21 bool isIdent();
22 bool isParen();
23 bool isVar();
24
25 QList<Token> parenContent();
26
27private:
28 enum Type {
29 SYM, IDENT, PAREN, VAR,
30 };
31
32 int _type = 0;
33 QString _stringVal = "";
34 QList<Token> *_listVal = nullptr;
35 QChar _charVal = 0;
36};