Package edu.wisc.game.parser
Class Token
- java.lang.Object
-
- edu.wisc.game.parser.Token
-
public class Token extends Object
A token represents an element of the input text. Used in parsing rules.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classToken.Type
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringasId()booleanequals(Object o)booleanisOpenParen()static voidmain(String[] argv)StringtoArgv()Re-imagines the token as an element of a command line.static Vector<Token>tokenize(String x)StringtoSrc()StringtoString()static StringtoString(Vector<Token> tokens)
-
-
-
Field Detail
-
type
public final Token.Type type
-
cVal
public char cVal
-
sVal
public String sVal
-
nVal
public int nVal
-
-
Method Detail
-
asId
public String asId()
- Returns:
- The string value if it is an ID, or null otherwise
-
toSrc
public String toSrc()
-
toArgv
public String toArgv()
Re-imagines the token as an element of a command line. Used for compatibility purposes in the Captive Game Server.
-
tokenize
public static Vector<Token> tokenize(String x) throws RuleParseException
- Throws:
RuleParseException
-
isOpenParen
public boolean isOpenParen()
-
main
public static void main(String[] argv) throws IOException, RuleParseException
- Throws:
IOExceptionRuleParseException
-
-