summaryrefslogtreecommitdiffstats
path: root/code/Interpreter/Token.java
diff options
context:
space:
mode:
authorAidenRushbrooke <72034940+AidenRushbrooke@users.noreply.github.com>2021-10-09 23:12:42 +0100
committerAidenRushbrooke <72034940+AidenRushbrooke@users.noreply.github.com>2021-10-09 23:12:42 +0100
commitcb29252f1e0d29d555fb232f39d343930fc76105 (patch)
tree8b0d62d941475c319a7bceb7939334a70be5bc30 /code/Interpreter/Token.java
parentd9e2cc94e10fb5f9d870a0f3e66afd1ad66c470c (diff)
downloadesotericFORTRAN-cb29252f1e0d29d555fb232f39d343930fc76105.tar.gz
esotericFORTRAN-cb29252f1e0d29d555fb232f39d343930fc76105.zip
Added basic lexical analysis
Diffstat (limited to 'code/Interpreter/Token.java')
-rw-r--r--code/Interpreter/Token.java23
1 files changed, 23 insertions, 0 deletions
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;
+ }
+}