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 class
Token.Type
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
asId()
boolean
equals(Object o)
boolean
isOpenParen()
static void
main(String[] argv)
String
toArgv()
Re-imagines the token as an element of a command line.static Vector<Token>
tokenize(String x)
String
toSrc()
String
toString()
static String
toString(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:
IOException
RuleParseException
-
-