Class Lexer.Token
- java.lang.Object
-
- com.github.zafarkhaja.semver.expr.Lexer.Token
-
- Enclosing class:
- Lexer
static class Lexer.Token extends java.lang.ObjectThis class holds the information about lexemes in the input stream.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classLexer.Token.TypeValid token types.
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.StringlexemeThe lexeme of this token.(package private) intpositionThe position of this token.(package private) Lexer.Token.TypetypeThe type of this token.
-
Constructor Summary
Constructors Constructor Description Token(Lexer.Token.Type type, java.lang.String lexeme, int position)Constructs aTokeninstance with the type, lexeme and position.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)inthashCode()java.lang.StringtoString()Returns the string representation of this token.
-
-
-
Field Detail
-
type
final Lexer.Token.Type type
The type of this token.
-
lexeme
final java.lang.String lexeme
The lexeme of this token.
-
position
final int position
The position of this token.
-
-
Constructor Detail
-
Token
Token(Lexer.Token.Type type, java.lang.String lexeme, int position)
Constructs aTokeninstance with the type, lexeme and position.- Parameters:
type- the type of this tokenlexeme- the lexeme of this tokenposition- the position of this token
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
Returns the string representation of this token.- Overrides:
toStringin classjava.lang.Object- Returns:
- the string representation of this token
-
-