Package nz.org.riskscape.dsl
Class Token
java.lang.Object
nz.org.riskscape.dsl.Token
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
int
static Token
eof
(Lexer.Tokens<?> tokens, String source) boolean
getType()
getValue()
int
hashCode()
boolean
boolean
boolean
moreIndented
(Token compareTo) rawValue()
void
setLocation
(SourceLocation location) static Token
Handy constructor for testing situationstoString()
-
Field Details
-
UNKNOWN_LOCATION
-
type
-
source
-
begin
public final int begin -
end
public final int end -
value
-
-
Constructor Details
-
Token
-
-
Method Details
-
eof
-
token
Handy constructor for testing situations
-
getStartOfLine
-
getIndents
- Returns:
- a List of Token objects that are the whitespace tokens that precede any non-whitespace tokens.
-
countIndents
public int countIndents()- Returns:
- The number of whitespace tokens that precede any non-whitespace tokens.
-
isWhitespace
public boolean isWhitespace()- Returns:
- true if this token is of a whitespace token type
-
toString
-
getPosition
-
rawValue
-
moreIndented
- Returns:
- true if this token has more indent tokens than the previous one
-
isSourceSingleLine
public boolean isSourceSingleLine()- Returns:
- true if the source code's non-whitespace tokens occur on a single line
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getType
-
getValue
-
getLocation
-
setLocation
-