tom.library.sl
Class BuiltinRepeatId

java.lang.Object
  extended by tom.library.sl.AbstractStrategy
      extended by tom.library.sl.AbstractStrategyCombinator
          extended by tom.library.sl.BuiltinRepeatId
All Implemented Interfaces:
Strategy, Visitable

public class BuiltinRepeatId
extends AbstractStrategyCombinator

Strategy combinator with one strategy argument s, that repeats the application of s until it does nothing (Identity)


Field Summary
static int ARG
           
 
Fields inherited from class tom.library.sl.AbstractStrategyCombinator
arguments
 
Fields inherited from class tom.library.sl.AbstractStrategy
environment
 
Constructor Summary
BuiltinRepeatId(Strategy v)
           
 
Method Summary
 int visit(Introspector introspector)
          Visit the current subject (found in the environment) and place its result in the environment.
<T> T
visitLight(T subject, Introspector introspector)
          Visit the subject any without managing any environment
 
Methods inherited from class tom.library.sl.AbstractStrategyCombinator
getChildAt, getChildCount, getChildren, getVisitor, getVisitors, initSubterm, initSubterm, initSubterm, initSubterm, initSubterm, setChildAt, setChildren
 
Methods inherited from class tom.library.sl.AbstractStrategy
getAncestor, getEnvironment, getPosition, getRoot, getSubject, init, init, setEnvironment, setRoot, setSubject, visit, visit, visit, visit, visitLight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARG

public static final int ARG
See Also:
Constant Field Values
Constructor Detail

BuiltinRepeatId

public BuiltinRepeatId(Strategy v)
Method Detail

visitLight

public final <T> T visitLight(T subject,
                              Introspector introspector)
                   throws VisitFailure
Visit the subject any without managing any environment

Parameters:
any - the subject to visit
introspector - the introspector
Returns:
a Visitable
Throws:
VisitFailure - if visitLight fails

visit

public int visit(Introspector introspector)
Visit the current subject (found in the environment) and place its result in the environment. Sets the environment flag to Environment.FAILURE in case of failure

Parameters:
introspector - the introspector
Returns:
Environment.SUCCESS if success