|
SMC 6_0_1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.smc.model.SmcVisitor
public abstract class SmcVisitor
The super class for all FSM model visitors. Within the SMC applications, visitors perform either global syntax checking on the tree or generate code based on the tree. See the Visitor pattern in GoF (p. 331).
If an application needs to traverse a finite state machine
model, then it should create a class derived from
SmcVisitor, override the appropriate visit methods for
those FSM elements it needs to process. Visiting is
started by calling SmcFSM.accept(net.sf.smc.model.SmcVisitor)
and
passing in the application's visitor instance. See
SmcCodeGenerator
for an
example.
All visit methods are explicity defined and do nothing. The reason why there are not abstract is because not all visistors visit all element types. Therefore, Visitor subclasses need override only those methods visiting the elements they care about.
SmcElement
Constructor Summary | |
---|---|
protected |
SmcVisitor()
Default constructor. |
Method Summary | |
---|---|
void |
visit(SmcAction action)
Visits a state transition action. |
void |
visit(SmcFSM fsm)
Visits the top-level finite state machine element. |
void |
visit(SmcGuard guard)
Visits a state tansition guard. |
void |
visit(SmcMap map)
Visits a finite state machine submap. |
void |
visit(SmcParameter parameter)
Visits a state transition parameter. |
void |
visit(SmcState state)
Visits a finite state machine state. |
void |
visit(SmcTransition transition)
Visits a finite state machine state transition. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected SmcVisitor()
Method Detail |
---|
public void visit(SmcFSM fsm)
fsm
- The top-level finite state machine element.public void visit(SmcMap map)
map
- A finite state machine submap.public void visit(SmcState state)
state
- A finite state machine state.public void visit(SmcTransition transition)
transition
- A finite state machine state transition.public void visit(SmcGuard guard)
guard
- A state tansition guard.public void visit(SmcAction action)
action
- A state transition action.public void visit(SmcParameter parameter)
parameter
- A state transition parameter.
|
SMC 6_0_1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |