From 6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6 Mon Sep 17 00:00:00 2001 From: Elizabeth Alexander Hunt Date: Thu, 2 Jul 2026 11:55:17 -0700 Subject: Init --- .../project-one/p1-scanner/scanner/Token.java | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Homework/cs5300/project-one/p1-scanner/scanner/Token.java (limited to 'Homework/cs5300/project-one/p1-scanner/scanner/Token.java') diff --git a/Homework/cs5300/project-one/p1-scanner/scanner/Token.java b/Homework/cs5300/project-one/p1-scanner/scanner/Token.java new file mode 100644 index 0000000..4c0151a --- /dev/null +++ b/Homework/cs5300/project-one/p1-scanner/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; + } + +} -- cgit v1.3