Class Token


  • final class Token
    extends java.lang.Object
    Internal token representation.

    This is used as a contract between the lexer and the parser.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) static class  Token.Type  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.lang.StringBuilder content
      The content buffer, never null.
      private static int DEFAULT_CAPACITY
      Length of the initial token (content-)buffer
      (package private) boolean isQuoted  
      (package private) boolean isReady
      Token ready flag: indicates a valid token with content (ready for the parser).
      (package private) Token.Type type
      Token type
    • Constructor Summary

      Constructors 
      Constructor Description
      Token()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void reset()  
      java.lang.String toString()
      Converts the token state to a string to ease debugging.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DEFAULT_CAPACITY

        private static final int DEFAULT_CAPACITY
        Length of the initial token (content-)buffer
        See Also:
        Constant Field Values
      • content

        final java.lang.StringBuilder content
        The content buffer, never null.
      • isReady

        boolean isReady
        Token ready flag: indicates a valid token with content (ready for the parser).
      • isQuoted

        boolean isQuoted
    • Constructor Detail

      • Token

        Token()
    • Method Detail

      • reset

        void reset()
      • toString

        public java.lang.String toString()
        Converts the token state to a string to ease debugging.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string helpful for debugging.