Trait

scala.meta.tql

Combinators

Related Doc: package tql

Permalink

trait Combinators[T] extends AnyRef

This trait contains the base combinators which can be used to write powerful traversers.

Self Type
Combinators[T] with Traverser[T]
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Combinators
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  5. by XtensionShow
  6. by XtensionInputLike
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. implicit class CTWithResult[U <: T] extends AnyRef

    Permalink

    Part of the 'transform' infrastructure.

    Part of the 'transform' infrastructure. transform ca take either a T only or a (T, A). (t, a) is bit cumbersome to write and that is why CTWithResult exists. This allows to write t andCollect a instead of (t, List(a))

  2. abstract class CollectInType[C[_]] extends AnyRef

    Permalink

    This is solely use to write collect as def collect[C[_] ] = new CollectInType[C] {..} instead of def collect[C[_] ] = new {} and so to not use reflective calls.

    This is solely use to write collect as def collect[C[_] ] = new CollectInType[C] {..} instead of def collect[C[_] ] = new {} and so to not use reflective calls. This as not been benchmarked so I don't really know if it has a real performance impact

  3. trait Collector[C, A, R] extends AnyRef

    Permalink

    This trait is part of the infrastructure required to make the collect combinator have a default parameter to List[_].

    This trait is part of the infrastructure required to make the collect combinator have a default parameter to List[_]. C is the type of the collection (ex: List[Int]) given by the User (or inferred to Nothing by the compiler) A is the element inside the collection (in List[Int] it would be Int) R is the 'real' collection that will be used i.e if C = Nothing => R = List[A] else R = C

    Note: maybe it would be interesting to generate such boilerplaite with a macro annotation. Something like that:

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Combinators[T] to any2stringadd[Combinators[T]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Combinators[T], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Combinators[T] to ArrowAssoc[Combinators[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. def @@[U <: T](implicit arg0: ClassTag[U]): (Combinators.this)#Matcher[U]

    Permalink

    Alias for select

  7. object Collector

    Permalink
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def bottomUp[A](m: ⇒ (Combinators.this)#Matcher[A])(implicit arg0: Monoid[A]): (Combinators.this)#Matcher[A]

    Permalink

    Same as bottomUpBreak, but does not sop when a transformation/traversal has succeeded

  10. def bottomUpBreak[A](m: (Combinators.this)#Matcher[A])(implicit arg0: Monoid[A]): (Combinators.this)#Matcher[A]

    Permalink

    Traverse the tree in a BottomUp manner, stop when a transformation/traversal has succeeded

  11. def children[A](f: ⇒ (Combinators.this)#Matcher[A])(implicit arg0: Monoid[A]): (Combinators.this)#Matcher[A]

    Permalink

    Traverse the direct children of the tree and apply f to them.

  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def collect[C[_]]: (Combinators.this)#CollectInType[C]

    Permalink

    Same as visit but puts the results into a collection (List by default)

  14. def collect2[V[_, _]]: AnyRef { def apply[A, B](f: PartialFunction[T,(A, B)])(implicit x: scala.reflect.ClassTag[T],implicit y: scala.collection.generic.CanBuildFrom[V[A,B],(A, B),V[A,B]]): Combinators.this.Matcher[V[A,B]] }

    Permalink

    same as collect but put the results into a collection of 2 type parameter e.g a Map[K, V]

  15. def ensuring(cond: (Combinators[T]) ⇒ Boolean, msg: ⇒ Any): Combinators[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Combinators[T] to Ensuring[Combinators[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: (Combinators[T]) ⇒ Boolean): Combinators[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Combinators[T] to Ensuring[Combinators[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: Boolean, msg: ⇒ Any): Combinators[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Combinators[T] to Ensuring[Combinators[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. def ensuring(cond: Boolean): Combinators[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Combinators[T] to Ensuring[Combinators[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. def fix[A](f: ((Combinators.this)#Matcher[A]) ⇒ (Combinators.this)#Matcher[A]): (Combinators.this)#Matcher[A]

    Permalink

    The infamous fix point combinator

  23. macro def focus(f: PartialFunction[T, Boolean]): (Combinators.this)#Matcher[T]

    Permalink

    Syntactic sugar for guard combinator so that one doesn't need to type the type parameter

  24. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Combinators[T] to StringFormat[Combinators[T]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  25. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  26. def guard[U <: T](f: PartialFunction[U, Boolean])(implicit arg0: ClassTag[U]): (Combinators.this)#Matcher[U]

    Permalink

    Succeed if the partial function f applied on the tree is defined and return true

  27. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  28. def identity[A](implicit arg0: Monoid[A]): (Combinators.this)#Matcher[A]

    Permalink

    Simple Identity combinator.

    Simple Identity combinator. a identity = a

  29. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  30. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  31. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  32. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  33. def oneOfChildren[A](m: ⇒ (Combinators.this)#Matcher[A])(implicit arg0: Monoid[A]): (Combinators.this)#Matcher[A]

    Permalink
  34. def parse[U](implicit convert: Convert[Combinators[T], meta.Input], dialect: Dialect, parse: meta.Parse[U]): U

    Permalink
    Implicit information
    This member is added by an implicit conversion from Combinators[T] to meta.XtensionInputLike[Combinators[T]] performed by method XtensionInputLike in scala.meta.syntactic.Api.
    Definition Classes
    XtensionInputLike
  35. def select[U <: T](implicit arg0: ClassTag[U]): (Combinators.this)#Matcher[U]

    Permalink

    Alias for focus{case t: U => some((t,t)}

  36. def show[Style[X] <: Show[X]](implicit style: Style[Combinators[T]]): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Combinators[T] to meta.XtensionShow[Combinators[T]] performed by method XtensionShow in scala.meta.ui.Api.
    Definition Classes
    XtensionShow
  37. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  38. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  39. def tokens(implicit convert: Convert[Combinators[T], meta.Input], dialect: Dialect): meta.Tokens

    Permalink
    Implicit information
    This member is added by an implicit conversion from Combinators[T] to meta.XtensionInputLike[Combinators[T]] performed by method XtensionInputLike in scala.meta.syntactic.Api.
    Definition Classes
    XtensionInputLike
  40. def topDown[A](m: (Combinators.this)#Matcher[A])(implicit arg0: Monoid[A]): (Combinators.this)#Matcher[A]

    Permalink

    Same as TopDown, but does not sop when a transformation/traversal has succeeded

  41. def topDownBreak[A](m: (Combinators.this)#Matcher[A])(implicit arg0: Monoid[A]): (Combinators.this)#Matcher[A]

    Permalink

    Traverse the tree in a TopDown manner, stop when a transformation/traversal has succeeded

  42. macro def transform(f: PartialFunction[T, Any]): (Combinators.this)#Matcher[Any]

    Permalink

    Syntactic sugar for transform combinator so that one doesn't need to type the type parameter

  43. def transformWithResult[I <: T, O <: T, A](f: PartialFunction[I, (O, A)])(implicit arg0: ClassTag[I], x: AllowedTransformation[I, O]): (Combinators.this)#Matcher[A]

    Permalink

    Transform a I into a T where both I and O are subtypes of T and where a transformation from I to O is authorized

  44. def tupledUntil[A, B](m1: (Combinators.this)#Matcher[A], m2: (Combinators.this)#Matcher[B])(implicit arg0: Monoid[A], arg1: Monoid[B]): (Combinators.this)#Matcher[(A, B)]

    Permalink
  45. def until[A, B](m1: ⇒ (Combinators.this)#Matcher[A], m2: (Combinators.this)#Matcher[B])(implicit arg0: Monoid[A]): (Combinators.this)#Matcher[A]

    Permalink
  46. def visit[A](f: PartialFunction[T, A])(implicit x: ClassTag[T]): (Combinators.this)#Matcher[A]

    Permalink

    Traverse the data structure and return a result

  47. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. def [B](y: B): (Combinators[T], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Combinators[T] to ArrowAssoc[Combinators[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Combinators[T] to any2stringadd[Combinators[T]]

Inherited by implicit conversion StringFormat from Combinators[T] to StringFormat[Combinators[T]]

Inherited by implicit conversion Ensuring from Combinators[T] to Ensuring[Combinators[T]]

Inherited by implicit conversion ArrowAssoc from Combinators[T] to ArrowAssoc[Combinators[T]]

Inherited by implicit conversion XtensionShow from Combinators[T] to meta.XtensionShow[Combinators[T]]

Inherited by implicit conversion XtensionInputLike from Combinators[T] to meta.XtensionInputLike[Combinators[T]]

Ungrouped