-
Notifications
You must be signed in to change notification settings - Fork 0
/
Token.hpp
75 lines (68 loc) · 1.4 KB
/
Token.hpp
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#pragma once
#include<string>
#include "Tag.hpp"
class Token{
private:
int tag;
public:
Token();
Token(int newTag):tag(newTag){};
int getTag();
Token* setTag(int newTag);
std::string toString();
};
class Num:public Token{
public:
int value;
Num(int val);
std::string toString();
};
class Word:public Token{
public:
std::string lexeme;
static Word And;
static Word Or;
static Word Eq;
static Word Lt;
static Word Gt;
static Word Le;
static Word Ge;
static Word Ne;
static Word True;
static Word False;
static Word Prog;
static Word Beg;
static Word End;
static Word Int;
static Word Dec;
static Word Decl;
static Word If;
static Word Else;
static Word Do;
static Word While;
static Word Read;
static Word Write;
static Word Ll;
static Word Lll;
static Word Gg;
static Word Ggg;
static Word Mod;
static Word Then;
static Word Add;
static Word Sub;
static Word Div;
static Word Mlt;
static Word Atrib;
static Word Opar;
static Word Cpar;
static Word Smc;
static Word Dqut;
static Word Qst;
static Word Clm;
static Word Pnt;
static Word Com;
static Word For;
Word(std::string lex, int tag);
Word();
std::string toString();
};