scala.quasiquotes

TreeInfo

abstract class TreeInfo extends SymbolTableCompat

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TreeInfo
  2. SymbolTableCompat
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TreeInfo()

Type Members

  1. class Applied extends AnyRef

    Applications in Scala can have one of the following shapes:

  2. trait CommonNames extends AnyRef

    Definition Classes
    SymbolTableCompat
  3. class DynamicApplicationExtractor extends AnyRef

  4. trait KeywordNames extends AnyRef

    Definition Classes
    SymbolTableCompat
  5. abstract class SeeThroughBlocks[T] extends AnyRef

    Some handy extractors for spotting trees through the the haze of irrelevant braces: i.

Abstract Value Members

  1. abstract val global: SymbolTable

    Definition Classes
    TreeInfoSymbolTableCompat

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object Applied

    Destructures applications into important subparts described in Applied class, namely into: core, targs and argss (in the specified order).

  7. object DynamicApplication extends DynamicApplicationExtractor

  8. object DynamicApplicationNamed extends DynamicApplicationExtractor

  9. object DynamicUpdate extends DynamicApplicationExtractor

  10. object IsFalse extends SeeThroughBlocks[Boolean]

  11. object IsTrue extends SeeThroughBlocks[Boolean]

  12. final val SYNTH_CASE_FLAGS: Int

  13. object StripCast

  14. object Unapplied

    Locates the synthetic Apply node corresponding to an extractor's call to unapply (unwrapping nested Applies) and returns the fun part of that Apply.

  15. object WildcardStarArg

  16. def admitsTypeSelection(tree: reflect.internal.SymbolTable.Tree): Boolean

    Is tree either a non-volatile type, or a path that does not include any of:

    Is tree either a non-volatile type, or a path that does not include any of:

    • a reference to a mutable variable/field
    • a reference to a by-name parameter
    • a member selection on a volatile type (Spec: 3.6 Volatile Types)?

    Such a tree is a suitable target for type selection.

  17. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  18. def assignmentToMaybeNamedArg(tree: reflect.internal.SymbolTable.Tree): reflect.internal.SymbolTable.Tree

    Translates an Assign(_, _) node to AssignOrNamedArg(_, _) if the lhs is a simple ident.

    Translates an Assign(_, _) node to AssignOrNamedArg(_, _) if the lhs is a simple ident. Otherwise returns unchanged.

  19. lazy val build: ReificationSupport { val global: TreeInfo.this.global.type }

    Definition Classes
    SymbolTableCompat
  20. def catchesThrowable(cdef: reflect.internal.SymbolTable.CaseDef): Boolean

    Does this CaseDef catch Throwable?

  21. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. object definitions

    Definition Classes
    SymbolTableCompat
  23. def detectTypecheckedTree(tree: reflect.internal.SymbolTable.Tree): Boolean

    Does the tree have a structure similar to typechecked trees?

  24. def dissectApplied(tree: reflect.internal.SymbolTable.Tree): Applied

    Returns a wrapper that knows how to destructure and analyze applications.

  25. def effectivePatternArity(args: List[reflect.internal.SymbolTable.Tree]): Int

    //------------------------ => effectivePatternArity(args)
    case Extractor(a)          => 1
    case Extractor(a, b)       => 2
    case Extractor((a, b))     => 2
    case Extractor(a @ (b, c)) => 2
  26. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  27. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  28. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  29. def firstConstructor(stats: List[reflect.internal.SymbolTable.Tree]): reflect.internal.SymbolTable.Tree

    The first constructor definitions in stats

  30. def firstConstructorArgs(stats: List[reflect.internal.SymbolTable.Tree]): List[reflect.internal.SymbolTable.Tree]

    The arguments to the first constructor in stats.

  31. def firstDefinesClassOrObject(trees: List[reflect.internal.SymbolTable.Tree], name: Name): Boolean

    Does list of trees start with a definition of a class of module with given name (ignoring imports)

  32. def flattenedPatternArgs(args: List[reflect.internal.SymbolTable.Tree]): List[reflect.internal.SymbolTable.Tree]

  33. def foreachMethodParamAndArg(params: List[reflect.internal.SymbolTable.Symbol], args: List[reflect.internal.SymbolTable.Tree])(f: (reflect.internal.SymbolTable.Symbol, reflect.internal.SymbolTable.Tree) ⇒ Unit): Boolean

  34. lazy val gen: TreeGen { val global: TreeInfo.this.global.type }

    Definition Classes
    SymbolTableCompat
  35. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  36. def hasSynthCaseSymbol(t: reflect.internal.SymbolTable.Tree): Boolean

  37. def hasUntypedPreSuperFields(stats: List[reflect.internal.SymbolTable.Tree]): Boolean

  38. def hasVolatileType(tree: reflect.internal.SymbolTable.Tree): Boolean

    Is tree's type volatile? (Ignored if its symbol has the @uncheckedStable annotation.

    Is tree's type volatile? (Ignored if its symbol has the @uncheckedStable annotation.)

  39. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  40. def isAbsTypeDef(tree: reflect.internal.SymbolTable.Tree): Boolean

  41. def isAliasTypeDef(tree: reflect.internal.SymbolTable.Tree): Boolean

  42. def isApplyDynamicName(name: Name): Boolean

  43. def isByNameParamType(tpt: reflect.internal.SymbolTable.Tree): Boolean

    Is tpt a by-name parameter type of the form => T?

  44. def isCatchCase(cdef: reflect.internal.SymbolTable.CaseDef): Boolean

    Is this pattern node a catch-all or type-test pattern?

  45. def isDeclarationOrTypeDef(tree: reflect.internal.SymbolTable.Tree): Boolean

    Is tree a declaration or type definition?

  46. def isDefaultCase(cdef: reflect.internal.SymbolTable.CaseDef): Boolean

    Is this pattern node a catch-all (wildcard or variable) pattern?

  47. def isDefaultGetter(tree: reflect.internal.SymbolTable.Tree): Boolean

  48. def isEarlyDef(tree: reflect.internal.SymbolTable.Tree): Boolean

  49. def isEarlyValDef(tree: reflect.internal.SymbolTable.Tree): Boolean

  50. def isExprSafeToInline(tree: reflect.internal.SymbolTable.Tree): Boolean

    Is tree an expression which can be inlined without affecting program semantics?

    Is tree an expression which can be inlined without affecting program semantics?

    Note that this is not called "isExprPure" since purity (lack of side-effects) is not the litmus test. References to modules and lazy vals are side-effecting, both because side-effecting code may be executed and because the first reference takes a different code path than all to follow; but they are safe to inline because the expression result from evaluating them is always the same.

  51. def isGuardedCase(cdef: reflect.internal.SymbolTable.CaseDef): Boolean

    Is this case guarded?

  52. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  53. def isInterfaceMember(tree: reflect.internal.SymbolTable.Tree): Boolean

    Is tree legal as a member definition of an interface?

  54. def isLeftAssoc(operator: Name): Boolean

    Is name a left-associative operator?

  55. def isMacroApplication(tree: reflect.internal.SymbolTable.Tree): Boolean

  56. def isMacroApplicationOrBlock(tree: reflect.internal.SymbolTable.Tree): Boolean

  57. def isNullaryInvocation(tree: reflect.internal.SymbolTable.Tree): Boolean

  58. def isPath(tree: reflect.internal.SymbolTable.Tree, allowVolatile: Boolean): Boolean

    Is tree a path, defined as follows? (Spec: 3.

    Is tree a path, defined as follows? (Spec: 3.1 Paths)

    - The empty path ε (which cannot be written explicitly in user programs). - C.this, where C references a class. - p.x where p is a path and x is a stable member of p. - C.super.x or C.super[M].x where C references a class and x references a stable member of the super class or designated parent class M of C.

    NOTE: Trees with errors are (mostly) excluded.

    Path ::= StableId | [id ‘.’] this

  59. def isPureDef(tree: reflect.internal.SymbolTable.Tree): Boolean

    Is tree a pure (i.

    Is tree a pure (i.e. non-side-effecting) definition?

  60. def isQualifierSafeToElide(tree: reflect.internal.SymbolTable.Tree): Boolean

  61. def isRepeatedParamType(tpt: reflect.internal.SymbolTable.Tree): Boolean

    Is tpt a vararg type of the form T* ?

  62. def isSelfConstrCall(tree: reflect.internal.SymbolTable.Tree): Boolean

    Is tree a self constructor call this(.

    Is tree a self constructor call this(...)? I.e. a call to a constructor of the same object?

  63. def isSelfOrSuperConstrCall(tree: reflect.internal.SymbolTable.Tree): Boolean

    Is tree a self or super constructor call?

  64. def isSequenceValued(tree: reflect.internal.SymbolTable.Tree): Boolean

    Is this pattern node a sequence-valued pattern?

  65. def isStableIdentifier(tree: reflect.internal.SymbolTable.Tree, allowVolatile: Boolean): Boolean

    Is tree a stable identifier, a path which ends in an identifier?

    Is tree a stable identifier, a path which ends in an identifier?

    StableId ::= id | Path ‘.’ id | [id ’.’] ‘super’ [‘[’ id ‘]’] ‘.’ id

  66. def isStableIdentifierPattern(tree: reflect.internal.SymbolTable.Tree): Boolean

    Is tree admissible as a stable identifier pattern (8.

    Is tree admissible as a stable identifier pattern (8.1.5 Stable Identifier Patterns)?

    We disregard volatility, as it's irrelevant in patterns (SI-6815)

  67. def isStableMemberOf(sym: reflect.internal.SymbolTable.Symbol, tree: reflect.internal.SymbolTable.Tree, allowVolatile: Boolean): Boolean

    Assuming sym is a member of tree, is it a "stable member"?

    Assuming sym is a member of tree, is it a "stable member"?

    Stable members are packages or members introduced by object definitions or by value definitions of non-volatile types (§3.6).

  68. def isStar(x: reflect.internal.SymbolTable.Tree): Boolean

    Is this tree a Star(_) after removing bindings?

  69. def isSuperConstrCall(tree: reflect.internal.SymbolTable.Tree): Boolean

    Is tree a super constructor call?

  70. def isSwitchAnnotation(tpe: reflect.internal.SymbolTable.Type): Boolean

    a Match(Typed(_, tpt), _) must be translated into a switch if isSwitchAnnotation(tpt.

    a Match(Typed(_, tpt), _) must be translated into a switch if isSwitchAnnotation(tpt.tpe)

  71. def isSynthCaseSymbol(sym: reflect.internal.SymbolTable.Symbol): Boolean

  72. def isSyntheticCase(cdef: reflect.internal.SymbolTable.CaseDef): Boolean

    Is this CaseDef synthetically generated, e.

    Is this CaseDef synthetically generated, e.g. by MatchTranslation.translateTry?

  73. def isSyntheticDefaultCase(cdef: reflect.internal.SymbolTable.CaseDef): Boolean

    Is this pattern node a synthetic catch-all case, added during PartialFuction synthesis before we know whether the user provided cases are exhaustive.

  74. def isTraitRef(tree: reflect.internal.SymbolTable.Tree): Boolean

  75. def isVarPattern(pat: reflect.internal.SymbolTable.Tree): Boolean

    Is tree a variable pattern?

  76. def isVarPatternDeep(tree: reflect.internal.SymbolTable.Tree): Boolean

    Does this tree represent an irrefutable pattern match in the position for { <tree> <- expr } based only on information at the parser phase? To qualify, there may be no subtree that will be interpreted as a Stable Identifier Pattern, nor any type tests, even on TupleN.

    Does this tree represent an irrefutable pattern match in the position for { <tree> <- expr } based only on information at the parser phase? To qualify, there may be no subtree that will be interpreted as a Stable Identifier Pattern, nor any type tests, even on TupleN. See SI-6968.

    For instance:

    (foo @ (bar @ _)) = 0

    is a not a variable pattern; if only binds names.

    The following are not variable patterns.

    `bar`
    Bar
    (a, b)
    _: T

    If the pattern is a simple identifier, it is always a variable pattern. For example, the following introduce new bindings:

    for { X <- xs } yield X
    for { `backquoted` <- xs } yield `backquoted`

    Note that this differs from a case clause:

    object X
    scrut match {
       case X =>  // case _ if scrut == X
    }

    Background: https://groups.google.com/d/msg/scala-internals/qwa_XOw_7Ks/IktkeTBYqg0J

  77. def isVariableOrGetter(tree: reflect.internal.SymbolTable.Tree): Boolean

    Is tree a mutable variable, or the getter of a mutable field?

  78. def isWildcardArg(tree: reflect.internal.SymbolTable.Tree): Boolean

    Is the argument a wildcard argument of the form _ or x @ _?

  79. def isWildcardStarArg(tree: reflect.internal.SymbolTable.Tree): Boolean

    Is this argument node of the form <expr> : _* ?

  80. def isWildcardStarArgList(trees: List[reflect.internal.SymbolTable.Tree]): Boolean

    Does this argument list end with an argument of the form <expr> : _* ?

  81. def isWildcardStarType(tree: reflect.internal.SymbolTable.Tree): Boolean

    Is the argument a wildcard star type of the form _*?

  82. def mapMethodParamsAndArgs[R](params: List[reflect.internal.SymbolTable.Symbol], args: List[reflect.internal.SymbolTable.Tree])(f: (reflect.internal.SymbolTable.Symbol, reflect.internal.SymbolTable.Tree) ⇒ R): List[R]

  83. def mayBeTypePat(tree: reflect.internal.SymbolTable.Tree): Boolean

    can this type be a type pattern

  84. def mayBeVarGetter(sym: reflect.internal.SymbolTable.Symbol): Boolean

    Is symbol potentially a getter of a variable?

  85. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  86. object nme extends CommonNames with KeywordNames

    Definition Classes
    SymbolTableCompat
  87. def noPredefImportForUnit(body: reflect.internal.SymbolTable.Tree): Boolean

    Is this file the body of a compilation unit which should not have Predef imported?

  88. final def notify(): Unit

    Definition Classes
    AnyRef
  89. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  90. def preSuperFields(stats: List[reflect.internal.SymbolTable.Tree]): List[reflect.internal.SymbolTable.ValDef]

    The value definitions marked PRESUPER in this statement sequence

  91. def repeatedParams(tree: reflect.internal.SymbolTable.Tree): List[reflect.internal.SymbolTable.ValDef]

    The parameter ValDefs of a method definition that have vararg types of the form T*

  92. def stripCast(tree: reflect.internal.SymbolTable.Tree): reflect.internal.SymbolTable.Tree

    Strips layers of .asInstanceOf[T] / _.$asInstanceOf[T]() from an expression

  93. def stripNamedApplyBlock(tree: reflect.internal.SymbolTable.Tree): reflect.internal.SymbolTable.Tree

    Named arguments can transform a constructor call into a block, e.

    Named arguments can transform a constructor call into a block, e.g. <init>(b = foo, a = bar) is transformed to { val x$1 = foo val x$2 = bar <init>(x$2, x$1) }

  94. object symbolTable

    Definition Classes
    SymbolTableCompat
  95. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  96. def toString(): String

    Definition Classes
    AnyRef → Any
  97. object tpnme extends CommonNames

    Definition Classes
    SymbolTableCompat
  98. lazy val treeInfo: TreeInfo { val global: TreeInfo.this.global.type }

    Definition Classes
    SymbolTableCompat
  99. def typeParameters(tree: reflect.internal.SymbolTable.Tree): List[reflect.internal.SymbolTable.TypeDef]

    If this tree has type parameters, those.

    If this tree has type parameters, those. Otherwise Nil.

  100. def unbind(x: reflect.internal.SymbolTable.Tree): reflect.internal.SymbolTable.Tree

    The underlying pattern ignoring any bindings

  101. def untypecheckedBlockBody(block: reflect.internal.SymbolTable.Block): collection.immutable.List[reflect.internal.SymbolTable.Tree]

    Recover block body to parsed state

  102. def untypecheckedTemplBody(templ: reflect.internal.SymbolTable.Template): collection.immutable.List[reflect.internal.SymbolTable.Tree]

    Recover template body to parsed state

  103. def untypecheckedTreeBody(tree: reflect.internal.SymbolTable.Tree, tbody: List[reflect.internal.SymbolTable.Tree]): collection.immutable.List[reflect.internal.SymbolTable.Tree]

    Recover tree body to parsed state

  104. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  105. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  106. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from SymbolTableCompat

Inherited from AnyRef

Inherited from Any

Ungrouped