object Expr
Provides helper methods for expressions
The most notable is reduceTree
, which helps convert a Seq of
org.benknoble.ebnf.Exprs to an org.benknoble.ebnf.Expr
subtype representing an expression tree.
Simple names are provided for the most common tree reductions.
Used primarly by org.benknoble.ebnf.EbnfParser to map parser results into trees.
- Alphabetic
- By Inheritance
- Expr
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
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
branchify(exprs: Seq[Expr]): Expr
Convert a series of of expressions into a tree of org.benknoble.ebnf.Alternations
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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
reduceTree(es: Seq[Expr], f: (Expr, Expr) ⇒ Expr): Expr
Converts a series of expressions to a single expression tree
Converts a series of expressions to a single expression tree
Example:
Expr.reduceTree(List(Terminal("a"), Nonterminal("b")), Sequence(_,_))
- es
sequence of expressions
- f
function to fold expressions together
- returns
a single org.benknoble.ebnf.Expr tree
-
def
sequencify(exprs: Seq[Expr]): Expr
Convert a series of of expressions into a tree of org.benknoble.ebnf.Sequences
-
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( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )