Class TokenResult

java.lang.Object
org.ek9lang.compiler.tokenizer.TokenResult

public class TokenResult extends Object
Typically used for locating the nearest token to some position in a source code file.
  • Constructor Details

    • TokenResult

      public TokenResult()
      Create a new and invalid TokenResult.
    • TokenResult

      public TokenResult(IToken token, List<IToken> tokensInLine, int positionInLine)
      Create a valid token result with the token its position and the other surrounding tokens.
  • Method Details

    • getToken

      public IToken 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.