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` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `char` | `cVal` |
    `int` | `nVal` |
    `String` | `sVal` |
    `Token.Type` | `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)` |

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### 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

    - #### equals

          public boolean equals​(Object o)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### 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`

    - #### toString

          public static String toString​(Vector<Token> tokens)

    - #### isOpenParen

          public boolean isOpenParen()

    - #### main

          public static void main​(String[] argv)
                           throws IOException,
                                  RuleParseException

      Throws:
        `IOException`
        `RuleParseException`