public class Token extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Token.Kind |
Modifier and Type | Field and Description |
---|---|
String |
image
Lowercase image
|
Token.Kind |
kind |
private boolean |
special
True if this is a special token
|
Substring |
substring
The raw substring causing this token, never null
|
Constructor and Description |
---|
Token(Token.Kind kind,
String image)
Crates a token which fails to know its origin (as a substring).
|
Token(Token.Kind kind,
String image,
boolean special,
Substring substring) |
Token(Token.Kind kind,
String image,
Substring substring) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object) |
Substring |
getSubstring()
Returns the substring containing the image ins original form (including casing),
as well as all the text surrounding the token
|
int |
hashCode() |
boolean |
isSpecial()
Returns whether this is a special token
|
String |
toString() |
public final Substring substring
public final Token.Kind kind
public final String image
private final boolean special
public Token(Token.Kind kind, String image)
public Token(Token.Kind kind, String image, Substring substring)
public Token(Token.Kind kind, String image, boolean special, Substring substring)
public boolean isSpecial()
public Substring getSubstring()
Copyright © 2017. All rights reserved.