-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathToken.java
More file actions
37 lines (32 loc) · 706 Bytes
/
Token.java
File metadata and controls
37 lines (32 loc) · 706 Bytes
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
package Tokens;
/**
* Token template class for all other tokens
*
* @author Keenan Leverty
* @author Peter Matern
* @author Chris Allender
*/
class Token {
public String input;
public int scope;
/**
* Simple constructor initializing variables
* @param input
* @param scope
*/
Token(String input, int scope) {
this.input = input;
this.scope = scope;
}
/**
* Returns an amount of tabs for the scope of the token.
* @return String of tab characters
*/
public String gimmeTabs() {
String output = "";
for(int i = 0; i < scope; i++) {
output += "\t";
}
return output;
}
}