Added toString.

This commit is contained in:
Robert Greene 2003-06-14 02:46:06 +00:00
parent 723c54d549
commit 4893e7b5aa

View File

@ -78,4 +78,16 @@ public class ApplesoftToken {
return tokenValue;
}
/**
* Render the token as a useful String.
*/
public String toString() {
if (isLineNumber()) {
return Integer.toString(getLineNumber());
} else if (isToken()) {
return getTokenString() + " " + Integer.toHexString(getTokenValue());
} else {
return getStringValue();
}
}
}