All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala.tasty.reflect.TreeTraverser.scala Maven / Gradle / Ivy

The newest version!
package scala.tasty
package reflect

/** TASTy Reflect tree traverser.
 *
 *  Usage:
 *  ```
 *  class MyTraverser[R <: scala.tasty.Reflection & Singleton](val reflect: R)
 *      extends scala.tasty.reflect.TreeTraverser {
 *    import reflect._
 *    override def traverseTree(tree: Tree)(using ctx: Context): Unit = ...
 *  }
 *  ```
 */
trait TreeTraverser extends TreeAccumulator[Unit] {

  import reflect._

  def traverseTree(tree: Tree)(using ctx: Context): Unit = traverseTreeChildren(tree)

  def foldTree(x: Unit, tree: Tree)(using ctx: Context): Unit = traverseTree(tree)

  protected def traverseTreeChildren(tree: Tree)(using ctx: Context): Unit = foldOverTree((), tree)

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy