summaryrefslogtreecommitdiff
path: root/Homework/cs5300/project-two/scanner/Token.java
diff options
context:
space:
mode:
Diffstat (limited to 'Homework/cs5300/project-two/scanner/Token.java')
-rw-r--r--Homework/cs5300/project-two/scanner/Token.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/Homework/cs5300/project-two/scanner/Token.java b/Homework/cs5300/project-two/scanner/Token.java
new file mode 100644
index 0000000..4c0151a
--- /dev/null
+++ b/Homework/cs5300/project-two/scanner/Token.java
@@ -0,0 +1,33 @@
+/*
+ * DO NOT MODIFY THIS FILE
+ */
+package scanner;
+
+/**
+ * A class that stores a token.
+ *
+ * Do not modify this file.
+ */
+public class Token {
+
+ private final String type;
+ private final String lexeme;
+
+ public Token(String type, String lexeme) {
+ this.type = type;
+ this.lexeme = lexeme;
+ }
+
+ public String toString() {
+ return type + ": " + lexeme;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public String getLexeme() {
+ return lexeme;
+ }
+
+}