Class Token
- java.lang.Object
-
- edu.odu.cs.zeil.codegrader.oracle.Token
-
- Direct Known Subclasses:
NumberToken,PunctuationToken,StringToken,WhiteSpaceToken
public abstract class Token extends java.lang.Object
-
-
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 booleanequals(java.lang.Object actual)java.lang.StringgetLexeme()Get the lexeme for this token.intgetPosition()java.lang.StringtoString()Display this token as a string.
-
-
-
Method Detail
-
equals
public abstract boolean equals(java.lang.Object actual)
- Overrides:
equalsin classjava.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:
toStringin classjava.lang.Object- Returns:
- the string representation.
-
getPosition
public int getPosition()
- Returns:
- the position
-
-