-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathToken.cs
50 lines (48 loc) · 1.3 KB
/
Token.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MC02Translator
{
class Token
{
public int Row { get; set; }
public String Value { get; set; }
public int Index { get; set; }
public int ClassInnerIndex { get; set; }
public String GeneralizedValue {
get
{
if (Index == 37)
return "id";
if (Index == 38)
return "const";
if (Index == 39)
return "lbl";
return Value;
}
}
public Token(int row, String token, int index)
{
Row = row;
Value = token;
Index = index;
ClassInnerIndex = 0;
}
public Token(Token token)
{
Row = token.Row;
Value = token.Value;
Index = token.Index;
ClassInnerIndex = token.ClassInnerIndex;
}
public Token(int row, String token, int index, int classInnerIndex)
{
Row = row;
Value = token;
Index = index;
ClassInnerIndex = classInnerIndex;
}
}
}