Package org.ek9lang.compiler.tokenizer
Class TokenResult
java.lang.Object
org.ek9lang.compiler.tokenizer.TokenResult
Typically used for locating the nearest token to some position in a source code file.
-
Constructor Summary
ConstructorDescriptionCreate a new and invalid TokenResult.TokenResult
(IToken token, List<IToken> tokensInLine, int positionInLine) Create a valid token result with the token its position and the other surrounding tokens. -
Method Summary
Modifier and TypeMethodDescriptiongetToken()
boolean
boolean
Checks if the previous token was some sort of assignment.boolean
Check if previous token was a 'defines' token.boolean
Check if previous token was an overrides token.boolean
Check if previous token was a pipe token.boolean
Checks the previous tokens in the line.
-
Constructor Details
-
TokenResult
public TokenResult()Create a new and invalid TokenResult. -
TokenResult
Create a valid token result with the token its position and the other surrounding tokens.
-
-
Method Details
-
getToken
-
isPresent
public boolean isPresent() -
previousTokensIndentsOrFirst
public boolean previousTokensIndentsOrFirst()Checks the previous tokens in the line.- Returns:
- true if all previous tokens are indents or this is first token.
-
previousTokenIsAssignment
public boolean previousTokenIsAssignment()Checks if the previous token was some sort of assignment. -
previousTokenIsPipe
public boolean previousTokenIsPipe()Check if previous token was a pipe token. -
previousTokenIsDefines
public boolean previousTokenIsDefines()Check if previous token was a 'defines' token. -
previousTokenIsOverride
public boolean previousTokenIsOverride()Check if previous token was an overrides token.
-