mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2025-02-01 18:33:25 +00:00
Represents an Applesoft token. This is returned by ApplesoftTokenizer.
This commit is contained in:
parent
c8247048e7
commit
3901ce8230
67
src/com/webcodepro/applecommander/util/ApplesoftToken.java
Normal file
67
src/com/webcodepro/applecommander/util/ApplesoftToken.java
Normal 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;
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user