-
Notifications
You must be signed in to change notification settings - Fork 0
/
Token.cs
47 lines (38 loc) · 1.18 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
/*=======================================================================
Wyvern compiler: Version 0.4
Copyright (C) 2019 Carlos Rivero A01371368, ITESM CEM
========================================================================*/
using System;
namespace Wyvern {
class Token {
readonly string lexeme;
readonly TokenCategory category;
readonly int row;
readonly int column;
public string Lexeme {
get { return lexeme; }
}
public TokenCategory Category {
get { return category; }
}
public int Row {
get { return row; }
}
public int Column {
get { return column; }
}
public Token(string lexeme,
TokenCategory category,
int row,
int column) {
this.lexeme = lexeme;
this.category = category;
this.row = row;
this.column = column;
}
public override string ToString() {
return string.Format("{{{0}, \"{1}\", @({2}, {3})}}",
category, lexeme, row, column);
}
}
}