From 9e6c89f1fa93287104381e02f0bbbdd6060a9382 Mon Sep 17 00:00:00 2001 From: AidenRushbrooke <72034940+AidenRushbrooke@users.noreply.github.com> Date: Sun, 5 Dec 2021 03:27:18 +0000 Subject: Added subroutines and comments for most files --- src/Compiler/Token.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/Compiler/Token.java') 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; - } - } -- cgit v1.2.3