Initial commit
This commit is contained in:
19
java/com/craftinginterpreters/lox/Token.java
Normal file
19
java/com/craftinginterpreters/lox/Token.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.craftinginterpreters.lox;
|
||||
|
||||
class Token {
|
||||
final TokenType type;
|
||||
final String lexeme;
|
||||
final Object literal;
|
||||
final int line;
|
||||
|
||||
Token(TokenType type, String lexeme, Object literal, int line) {
|
||||
this.type = type;
|
||||
this.lexeme = lexeme;
|
||||
this.literal = literal;
|
||||
this.line = line;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return type + " " + lexeme + " " + literal;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user