Class Lexer.Token
- java.lang.Object
-
- com.github.zafarkhaja.semver.expr.Lexer.Token
-
- Enclosing class:
- Lexer
static class Lexer.Token extends java.lang.Object
This class holds the information about lexemes in the input stream.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
Lexer.Token.Type
Valid token types.
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.String
lexeme
The lexeme of this token.(package private) int
position
The position of this token.(package private) Lexer.Token.Type
type
The type of this token.
-
Constructor Summary
Constructors Constructor Description Token(Lexer.Token.Type type, java.lang.String lexeme, int position)
Constructs aToken
instance with the type, lexeme and position.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
int
hashCode()
java.lang.String
toString()
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 aToken
instance 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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
Returns the string representation of this token.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the string representation of this token
-
-