Class Token

    • Constructor Summary

      Constructors 
      Constructor Description
      Token​(java.lang.String theLexeme, int pos)
      Create a token.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract boolean equals​(java.lang.Object actual)  
      java.lang.String getLexeme()
      Get the lexeme for this token.
      int getPosition()  
      java.lang.String toString()
      Display this token as a string.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Token

        public Token​(java.lang.String theLexeme,
                     int pos)
        Create a token.
        Parameters:
        theLexeme - lexeme for this token.
        pos - position of this lexeme within the string
    • Method Detail

      • equals

        public abstract boolean equals​(java.lang.Object actual)
        Overrides:
        equals in class java.lang.Object
      • getLexeme

        public java.lang.String getLexeme()
        Get the lexeme for this token.
        Returns:
        the lexeme
      • toString

        public java.lang.String toString()
        Display this token as a string.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representation.
      • getPosition

        public int getPosition()
        Returns:
        the position