Exemplo n.º 1
0
 /** Unwind the trail to given low water mark */
 public void unwindTrail(int mark) {
   for (int i = trail.size() - 1; i >= mark; i--) {
     Node_RuleVariable var = (Node_RuleVariable) trail.get(i);
     var.unbind();
     trail.remove(i);
   }
 }
Exemplo n.º 2
0
 /**
  * Bind a value to a variable, recording the binding in the trail.
  *
  * @param var the dereferenced variable to be bound
  * @param val the value to bind to it
  */
 public void bind(Node var, Node val) {
   ((Node_RuleVariable) var).simpleBind(val);
   trail.add(var);
 }