From 3901ce8230053c126edae31b03c81e6205feeec5 Mon Sep 17 00:00:00 2001 From: Robert Greene Date: Wed, 28 May 2003 03:45:12 +0000 Subject: [PATCH] Represents an Applesoft token. This is returned by ApplesoftTokenizer. --- .../applecommander/util/ApplesoftToken.java | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/com/webcodepro/applecommander/util/ApplesoftToken.java diff --git a/src/com/webcodepro/applecommander/util/ApplesoftToken.java b/src/com/webcodepro/applecommander/util/ApplesoftToken.java new file mode 100644 index 0000000..41378bc --- /dev/null +++ b/src/com/webcodepro/applecommander/util/ApplesoftToken.java @@ -0,0 +1,67 @@ +package com.webcodepro.applecommander.util; + +/** + * Represents an ApplesoftToken. + * @see com.webcodepro.applecommander.util.ApplesoftTokenizer + * @author Rob + */ +public class ApplesoftToken { + private int lineNumber; + private byte tokenValue; + private String tokenString; + private String stringValue; + + public ApplesoftToken(int lineNumber) { + this.lineNumber = lineNumber; + } + + public ApplesoftToken(byte tokenValue, String tokenString) { + this.tokenValue = tokenValue; + this.tokenString = tokenString; + } + + public ApplesoftToken(String stringValue) { + this.stringValue = stringValue; + } + + public boolean isLineNumber() { + return !isToken() && !isString(); + } + + public boolean isToken() { + return tokenString != null; + } + + public boolean isString() { + return stringValue != null; + } + + /** + * Get the line number. + */ + public int getLineNumber() { + return lineNumber; + } + + /** + * Get the string value. + */ + public String getStringValue() { + return stringValue; + } + + /** + * Get the token. + */ + public String getTokenString() { + return tokenString; + } + + /** + * Get the token. + */ + public byte getTokenValue() { + return tokenValue; + } + +}