tom.library.sl
Interface Strategy

All Superinterfaces:
Visitable
All Known Implementing Classes:
AbstractStrategy, AbstractStrategyBasic, AbstractStrategyCombinator, All, AllSeq, BuiltinBottomUp, BuiltinRepeat, BuiltinRepeatId, BuiltinTopDown, CFGViewer.AllCfg, CFGViewer.Assign, CFGViewer.BuildLabelMap, CFGViewer.IsMarked, CFGViewer.Mark, CFGViewer.OneCfg, CFGViewer.PrintDotLink, CFGViewer.PrintDotNode, CFGViewer.UnMark, Choice, ChoiceId, ChoiceUndet, DeRef, Fail, Identity, IfThenElse, Mu, MuVar, Not, Omega, OmegaU, One, OneId, Pselect, Sequence, SequenceId, ToolBox.BuildDescriptor, Up, Viewer.RemoveMu

public interface Strategy
extends Visitable


Method Summary
 Environment getEnvironment()
          Get a reference to the current environment.
 void setEnvironment(Environment p)
          Set up a new environment
<T extends Visitable>
T
visit(Environment envt)
          Execute the strategy in the given environment (on its current subject).
 Object visit(Environment envt, Introspector i)
          Execute the strategy in the given environment (on its current subject).
 int visit(Introspector i)
          Visit the current subject (found in the environment) and place its result in the environment.
<T extends Visitable>
T
visit(T any)
          Visit the subject any by providing the environment
<T> T
visit(T any, Introspector i)
          Visit the subject any by providing the introspector
<T extends Visitable>
T
visitLight(T any)
          Visit the subject any in a light way (without environment)
<T> T
visitLight(T any, Introspector i)
          Visit the subject any in a light way (without environment)
 
Methods inherited from interface tom.library.sl.Visitable
getChildAt, getChildCount, getChildren, setChildAt, setChildren
 

Method Detail

setEnvironment

void setEnvironment(Environment p)
Set up a new environment

Parameters:
p - the environment to set up

getEnvironment

Environment getEnvironment()
Get a reference to the current environment.

Returns:
the current environment

visit

<T extends Visitable> T visit(T any)
                          throws VisitFailure
Visit the subject any by providing the environment

Parameters:
any - the subject to visit.
Throws:
VisitFailure - in case of failure.

visitLight

<T extends Visitable> T visitLight(T any)
                               throws VisitFailure
Visit the subject any in a light way (without environment)

Parameters:
any - the subject to visit.
Throws:
VisitFailure - in case of failure.

visit

<T extends Visitable> T visit(Environment envt)
                          throws VisitFailure
Execute the strategy in the given environment (on its current subject). This method can only be used inside user strategies to execute another strategy but with the current environment of the user strategy.

Parameters:
envt - the environment where execute the strategy.
Throws:
VisitFailure - in case of failure.

visit

<T> T visit(T any,
            Introspector i)
        throws VisitFailure
Visit the subject any by providing the introspector

Parameters:
any - the subject to visit.
Throws:
VisitFailure - in case of failure.

visitLight

<T> T visitLight(T any,
                 Introspector i)
             throws VisitFailure
Visit the subject any in a light way (without environment)

Parameters:
any - the subject to visit.
Throws:
VisitFailure - in case of failure.

visit

Object visit(Environment envt,
             Introspector i)
             throws VisitFailure
Execute the strategy in the given environment (on its current subject). This method can only be used inside user strategies to execute another strategy but with the current environment of the user strategy.

Parameters:
envt - the environment where execute the strategy.
i - the instrospector
Throws:
VisitFailure - in case of failure.

visit

int visit(Introspector i)
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:
i - the introspector