public abstract class SmcVisitor
extends java.lang.Object
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
Modifier | Constructor and Description |
---|---|
protected |
SmcVisitor()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected SmcVisitor()
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.Copyright © 2015. Charles W. Rapp. All Rights Reserved. Use is subject to license terms.