diff options
Diffstat (limited to 'src/Compiler/Token.java')
-rw-r--r-- | src/Compiler/Token.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/Compiler/Token.java b/src/Compiler/Token.java index 50d3804..b6f11a8 100644 --- a/src/Compiler/Token.java +++ b/src/Compiler/Token.java @@ -1,15 +1,23 @@ package Compiler; +/** + * Class for storing information about a single token + */ public class Token { - - //Stores the token type, the actual text and the runtime object public final TokenType type; final String text; final Object value; final int line; + /** + * Contructor for a token object + * @param type the type of token + * @param text the actual text for the token + * @param value the value the token represents + * @param line the line of code the token is on + */ Token(TokenType type, String text, Object value,int line){ this.type=type; this.text=text; @@ -17,10 +25,4 @@ public class Token { this.line=line; } - - @Override - public String toString() { - return type + " " + text + " " + value; - } - } |