Class PyTree

java.lang.Object
org.sonar.python.tree.PyTree
All Implemented Interfaces:
Tree
Direct Known Subclasses:
AliasedNameImpl, ArgListImpl, AsPatternImpl, AssignmentExpressionImpl, AwaitExpressionImpl, BinaryExpressionImpl, CallExpressionImpl, CapturePatternImpl, CaseBlockImpl, CellMagicStatementImpl, ClassDefImpl, ClassPatternImpl, ComprehensionExpressionImpl, ComprehensionForImpl, ComprehensionIfImpl, ConditionalExpressionImpl, DictCompExpressionImpl, DictOrSetLiteralImpl, DottedNameImpl, DoubleStarPatternImpl, DynamicObjectInfoStatementImpl, EllipsisExpressionImpl, ElseClauseImpl, ExceptClauseImpl, ExpressionListImpl, FileInputImpl, FinallyClauseImpl, FormatSpecifierImpl, FormattedExpressionImpl, ForStatementImpl, FunctionDefImpl, GroupPatternImpl, GuardImpl, IfStatementImpl, KeyValuePairImpl, KeyValuePatternImpl, KeywordPatternImpl, LambdaExpressionImpl, LineMagicImpl, ListLiteralImpl, LiteralPatternImpl, MappingPatternImpl, MatchStatementImpl, NameImpl, NoneExpressionImpl, NumericLiteralImpl, OrPatternImpl, ParameterImpl, ParameterListImpl, ParenthesizedExpressionImpl, QualifiedExpressionImpl, RegularArgumentImpl, ReprExpressionImpl, SequencePatternImpl, SimpleStatement, SliceExpressionImpl, SliceItemImpl, SliceListImpl, StarPatternImpl, StatementListImpl, StringElementImpl, StringLiteralImpl, SubscriptionExpressionImpl, TokenImpl, TryStatementImpl, TupleImpl, TupleParameterImpl, TypeAnnotationImpl, TypeParamImpl, TypeParamsImpl, UnaryExpressionImpl, UnpackingExpressionImpl, ValuePatternImpl, WhileStatementImpl, WildcardPatternImpl, WithStatementImpl, WithStatementImpl.WithItemImpl, YieldExpressionImpl

public abstract class PyTree extends Object implements Tree
  • Field Details

    • firstToken

      protected Token firstToken
    • lastToken

      protected Token lastToken
  • Constructor Details

    • PyTree

      protected PyTree()
  • Method Details

    • is

      public boolean is(Tree.Kind... kinds)
      Specified by:
      is in interface Tree
    • firstToken

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

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

      public Tree parent()
      Specified by:
      parent in interface Tree
    • setParent

      protected void setParent(Tree parent)
    • children

      public List<Tree> children()
      Specified by:
      children in interface Tree