Package eu.bandm.tools.ramus.ogma
Class Action.Success<R,M,O>
java.lang.Object
eu.bandm.tools.ramus.ogma.Action<R,M,O>
eu.bandm.tools.ramus.ogma.Action.Success<R,M,O>
- Type Parameters:
R- the type of parsing results attached to leavesM- the type of diagnostic messages attached to stemsO- the type of obstructions to continuation
Leaf node class of the parsing search-tree monad.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.bandm.tools.ramus.ogma.Action
Action.BiContinuation<R,S, T, M, O>, Action.Continuation<R, S, M, O>, Action.Success<R, M, O>, Action.Visitor<R, M, O> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbind(Action.Continuation<? super R, S, M, O> cont) Applies a monadic continuation to all leaves of this search tree (transition operation).Returns the parsing result for this leaf.voidhost(Action.Visitor<? super R, M, O> v) Performs a double dispatch to the appropriate method of a visitor.booleanisEmpty()Checks whether this search tree is empty.prune()Simplifies this search tree by removing redundant choice nodes and all obstructions (transition operation).toString()Methods inherited from class eu.bandm.tools.ramus.ogma.Action
choice, choice, diagnosis, diagnosis, fail, fail, first, forEachObstruction, forEachResult, getResults, map, second, succeed, succeed, visitEachObstruction, visitEachResult
-
Constructor Details
-
Success
Creates a new leaf.Recycling existing leaves, if possible, is preferrable to creating new ones.
- Parameters:
result- the parsing result for the leaf
-
-
Method Details
-
getResult
Returns the parsing result for this leaf.- Returns:
- the parsing result for this leaf
-
bind
Applies a monadic continuation to all leaves of this search tree (transition operation).This leaf node is advertised for recyling in the process.
-
prune
Description copied from class:ActionSimplifies this search tree by removing redundant choice nodes and all obstructions (transition operation). -
isEmpty
public boolean isEmpty()Description copied from class:ActionChecks whether this search tree is empty. -
toString
-
host
Description copied from class:ActionPerforms a double dispatch to the appropriate method of a visitor.
-