object NameTree
The NameTree object comprises NameTree types as well as binding and evaluation routines.
- Alphabetic
- By Inheritance
- NameTree
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class Alt[+T](trees: NameTree[T]*) extends NameTree[T] with ForCaseClass with Product with Serializable
A NameTree representing fallback; it is evaluated by picking the first nonnegative (evaluated) subtree.
- case class Leaf[+T](value: T) extends NameTree[T] with ForCaseClass with Product with Serializable
- case class Union[+T](trees: Weighted[T]*) extends NameTree[T] with ForCaseClass with Product with Serializable
A NameTree representing a weighted union of trees.
A NameTree representing a weighted union of trees. It is evaluated by returning the union of its (recursively evaluated) children, leaving corresponding weights unchanged. When all children are negative, the Union itself evaluates negative.
NameTree gives no semantics to weights (they are interpreted higher in the stack) except to simplify away single-child Unions regardless of weight.
- case class Weighted[+T](weight: Double, tree: NameTree[T]) extends ForCaseClass with Product with Serializable
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- implicit def equiv[T]: Equiv[NameTree[T]]
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[T, U](f: (T) => U)(tree: NameTree[T]): NameTree[U]
Rewrite the paths in a tree for values defined by the given partial function.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def read(s: String): NameTree[Path]
Parse a NameTree from a string with concrete syntax
Parse a NameTree from a string with concrete syntax
tree ::= name weight '*' tree tree '&' tree tree '|' tree '(' tree ')' name ::= path | '!' | '~' | '$' weight ::= [0-9]*\.?[0-9]+
For example:
/foo & /bar | /baz | $
parses in to the NameTree
Alt(Union(Leaf(Path(foo)),Leaf(Path(bar))),Leaf(Path(baz)),Empty)
The production
path
is documented at Path.read.- Exceptions thrown
IllegalArgumentException
when the string does not represent a valid name tree.
- def show[T](tree: NameTree[T])(implicit arg0: Showable[T]): String
A string parseable by NameTree.read.
A string parseable by NameTree.read.
- Annotations
- @tailrec()
- def simplify[T](tree: NameTree[T]): NameTree[T]
Simplify the given NameTree, yielding a new NameTree which is evaluation-equivalent.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object Alt extends Serializable
- object Empty extends NameTree[Nothing]
An empty NameTree.
- object Fail extends NameTree[Nothing]
A failing NameTree.
- object Neg extends NameTree[Nothing]
A negative NameTree.
- object Union extends Serializable
- object Weighted extends Serializable