Package io.github.qishr.cascara.common.lang.token
Interface Token
java.lang.Object
io.github.qishr.cascara.common.lang.token.Token
All Known Implementing Classes:
JsonToken, XmlToken, YamlToken
public interface Token
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
| public abstract TokenType | getType() | Returns the basic type of this the token, defined in a class that implements TokenType. |
| public abstract String | getLexeme() | Returns the exact literal characters scanned from the source file, including any surrounding quotes or syntax indicators. |
| public abstract String | getContent() | Returns the unescaped, processed string content within the token boundaries. |
| public abstract int | getOffset() | Returns the total number of bytes/characters read before start of current token. |
| public abstract int | getStartLine() | Returns the input row on which current token starts; 1-based |
| public abstract int | getStartColumn() | Returns the column on input row that current token starts; 1-based |
| public abstract String | toString() | Returns a human readable description of the token. |
Method Details
getType
public abstract TokenType getType()
Returns the basic type of this the token, defined in a class that implements TokenType.
getLexeme
public abstract String getLexeme()
Returns the exact literal characters scanned from the source file, including any surrounding quotes or syntax indicators.
getContent
public abstract String getContent()
Returns the unescaped, processed string content within the token boundaries.
getOffset
public abstract int getOffset()
Returns the total number of bytes/characters read before start of current token.
getStartLine
public abstract int getStartLine()
Returns the input row on which current token starts; 1-based
getStartColumn
public abstract int getStartColumn()
Returns the column on input row that current token starts; 1-based
toString
public abstract String toString()
Returns a human readable description of the token.