Class Thunk<R,S,M,O>

java.lang.Object
eu.bandm.tools.ramus.runtime2.Action<S,M,O>
eu.bandm.tools.ramus.runtime2.Thunk<R,S,M,O>

class Thunk<R,S,M,O> extends Action<S,M,O>
  • Constructor Details

  • Method Details

    • force

      Action<S,M,O> force()
    • bind

      public <T> Action<T,M,O> bind(Action.Continuation<? super S,T,M,O> cont)
      Description copied from class: Action
      Applies a monadic continuation to all leaves of this search tree (transition operation).
      Specified by:
      bind in class Action<S,M,O>
      Type Parameters:
      T - the output parsing result type of the continuation
      Parameters:
      cont - the continuation to apply
      Returns:
      an updated search tree
    • isEmpty

      public boolean isEmpty()
      Description copied from class: Action
      Checks whether this search tree is empty.
      Specified by:
      isEmpty in class Action<S,M,O>
      Returns:
      true iff this tree has no leaves
    • getLeafCount

      protected int getLeafCount()
      Specified by:
      getLeafCount in class Action<S,M,O>
    • prune

      public <Q> Action<? extends S,M,Q> prune()
      Description copied from class: Action
      Simplifies this search tree by removing redundant choice nodes and all obstructions (transition operation).
      Specified by:
      prune in class Action<S,M,O>
      Type Parameters:
      Q - the new type of obstructions
      Returns:
      a simplified search tree without nested or unary choice nodes
    • host

      public void host(Action.Visitor<? super S,M,O> visitor)
      Description copied from class: Action
      Performs a double dispatch to the appropriate method of a visitor.
      Specified by:
      host in class Action<S,M,O>
      Parameters:
      visitor - the visitor