From cb29252f1e0d29d555fb232f39d343930fc76105 Mon Sep 17 00:00:00 2001 From: AidenRushbrooke <72034940+AidenRushbrooke@users.noreply.github.com> Date: Sat, 9 Oct 2021 23:12:42 +0100 Subject: Added basic lexical analysis --- code/Interpreter/Token.java | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 code/Interpreter/Token.java (limited to 'code/Interpreter/Token.java') diff --git a/code/Interpreter/Token.java b/code/Interpreter/Token.java new file mode 100644 index 0000000..b1cf542 --- /dev/null +++ b/code/Interpreter/Token.java @@ -0,0 +1,23 @@ +package Interpreter; + +public class Token { + + + //Stores the token type, the actual text and the runtime object + final TokenType type; + final String text; + final Object value; + + + Token(TokenType type, String text, Object value){ + this.type=type; + this.text=text; + this.value=value; + + } + + @Override + public String toString() { + return type + " " + text + " " + value; + } +} -- cgit v1.2.3