-
Notifications
You must be signed in to change notification settings - Fork 0
/
Token.h
47 lines (32 loc) · 805 Bytes
/
Token.h
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
//
// Token.h
// Project2
//
// Created by Michael Bird on 7/16/14.
// Copyright (c) 2014 Michael Bird. All rights reserved.
//
#ifndef __Project2__Token__
#define __Project2__Token__
#include <iostream>
#include <vector>
using namespace std;
class Token {
public:
Token();
Token(string type, string value, int line_number);
~Token();
void set_token_type(string type_);
void set_token_value(string value_);
void set_token_line(int line_);
string get_token_type();
string get_token_value();
int get_token_line();
string toString() {
return "(" + type + ",'" + value + "'," + to_string(line) + ")";
}
private:
string type;
string value;
int line;
};
#endif /* defined(__Project2__Token__) */