Class TokenImpl

java.lang.Object
org.sonar.python.tree.PyTree
org.sonar.python.tree.TokenImpl
All Implemented Interfaces:
Token, Tree

public class TokenImpl extends PyTree implements Token
  • Constructor Details

    • TokenImpl

      public TokenImpl(com.sonar.sslr.api.Token token)
    • TokenImpl

      public TokenImpl(com.sonar.sslr.api.Token token, int line, int column, int includedEscapeChars, List<Trivia> trivia, boolean isCompressed)
  • Method Details

    • value

      public String value()
      Specified by:
      value in interface Token
    • line

      public int line()
      Specified by:
      line in interface Token
    • column

      public int column()
      Specified by:
      column in interface Token
    • pythonLine

      public PythonLine pythonLine()
      Specified by:
      pythonLine in interface Token
    • includedEscapeChars

      public int includedEscapeChars()
      Specified by:
      includedEscapeChars in interface Token
    • pythonColumn

      public int pythonColumn()
      Specified by:
      pythonColumn in interface Token
    • trivia

      public List<Trivia> trivia()
      Specified by:
      trivia in interface Token
    • type

      public com.sonar.sslr.api.TokenType type()
      Specified by:
      type in interface Token
    • accept

      public void accept(TreeVisitor visitor)
      Specified by:
      accept in interface Tree
    • computeChildren

      public List<Tree> computeChildren()
    • getKind

      public Tree.Kind getKind()
      Specified by:
      getKind in interface Tree
    • firstToken

      public Token firstToken()
      Specified by:
      firstToken in interface Tree
      Overrides:
      firstToken in class PyTree
    • lastToken

      public Token lastToken()
      Specified by:
      lastToken in interface Tree
      Overrides:
      lastToken in class PyTree
      Returns:
      the last meaningful token of the Tree. Separators of simple statements (semicolon and/or newline) are not be returned by this method.
    • valueLength

      public int valueLength()
      Specified by:
      valueLength in interface Token
    • isCompressed

      public boolean isCompressed()
      Specified by:
      isCompressed in interface Token