Represents an Applesoft token. This is returned by ApplesoftTokenizer.

This commit is contained in:
Robert Greene 2003-05-28 03:45:12 +00:00
parent c8247048e7
commit 3901ce8230
1 changed files with 67 additions and 0 deletions

View File

@ -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;
}
}