public class FSMActor extends NamedProgramCodeGeneratorAdapter
Red (zgang) |
Red (zgang) |
Modifier and Type | Class and Description |
---|---|
static class |
FSMActor.OutgoingRelations
The outgoing releations.
|
protected class |
FSMActor.PortScope
This class implements a scope, which is used to generate the
parsed expressions in target language.
|
static interface |
FSMActor.TransitionRetriever
A class implementing this interface implements a method to
retrieve transitions of a given state.
|
NamedProgramCodeGeneratorAdapter.VariableScope
ProgramCodeGeneratorAdapter.Channel
NamedObj.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
protected FSMActor.PortScope |
_scope
The scope to generate code for guard expression, choice action
and commit action.
|
_component, _defaultBlocks, _eol, _templateParser
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
Constructor and Description |
---|
FSMActor(FSMActor component)
Construct the code generator helper associated with the given FSMActor.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
_generateFireCode()
Generate the fire code of the associated FSMActor.
|
protected java.lang.Object |
_generateStateConstantLabel(State state)
Generate a label for a state constant.
|
protected void |
_updateCurrentState(java.lang.StringBuffer codeBuffer,
State state)
Generate code for updating current state of this FSMActor.
|
java.lang.String |
generateInitializeCode()
Generate the initialize code of the associated FSMActor.
|
java.lang.String |
generatePreinitializeCode()
Generate the preinitialize code of the associated FSMActor.
|
void |
generateTransitionCode(java.lang.StringBuffer code,
FSMActor.TransitionRetriever transitionRetriever)
Generate code for making transition.
|
_generateTypeConvertStatement, analyzeTypeConvert, copyFilesToCodeDirectory, generateFireCode, generateFireFunctionCode, generateMainLoop, generateModeTransitionCode, generatePostfireCode, generatePrefireCode, generatePreinitializeMethodBodyCode, generateSimpleName, generateTypeConvertFireCode, generateTypeConvertFireCode, generateVariableDeclaration, generateVariableInitialization, generateWrapupCode, getAddTimeString, getBufferSize, getBufferSize, getComponent, getDeclareSharedCode, getDefaultBlocks, getFireFunctionParameters, getHeaderFiles, getIncludeDirectories, getLibraries, getLibraryDirectories, getModifiedVariables, getName, getParameterValue, getReference, getReference, getSharedCode, getSinkChannels, getSourceTimeString, getTimeSourcePortName, getTypeConvertChannels, getTypeConvertReference, getTypeConvertSinkChannels, setupAdapter, targetType
_generateBlockByName, getAdapter, getCodeGenerator, getTemplateParser, processCode, setCodeGenerator, setTemplateParser, toString
createDecoratorAttributes, generateName
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getContainedObject, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateExistence, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getContainer, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setName, setPersistent, setSource, sortContainedObjects, toplevel, uniqueName, validateSettables, workspace
protected FSMActor.PortScope _scope
public FSMActor(FSMActor component) throws NameDuplicationException, IllegalActionException
component
- The associated component.NameDuplicationException
- If the container already contains a
a code generator adapter for this particular FSMActor.IllegalActionException
- If the NamedProgramCodeGeneratorAdapter throws
an IllegalActionException.public java.lang.String generateInitializeCode() throws IllegalActionException
generateInitializeCode
in class NamedProgramCodeGeneratorAdapter
IllegalActionException
- If initial state cannot be found,
configuration number cannot be updated or code cannot be processed.public java.lang.String generatePreinitializeCode() throws IllegalActionException
generatePreinitializeCode
in class NamedProgramCodeGeneratorAdapter
IllegalActionException
- If thrown when creating buffer
size and offset map or processing code.public void generateTransitionCode(java.lang.StringBuffer code, FSMActor.TransitionRetriever transitionRetriever) throws IllegalActionException
code
- The string buffer that the generated code is appended to.transitionRetriever
- An instance of a class implementing
a method.
which returns an iterator of all, preemptive or non-preemptive
transitions of the current state.IllegalActionException
- If thrown while generating
transition code.protected java.lang.String _generateFireCode() throws IllegalActionException
_generateFireCode
in class NamedProgramCodeGeneratorAdapter
IllegalActionException
- If thrown while generating
firing code.protected void _updateCurrentState(java.lang.StringBuffer codeBuffer, State state) throws IllegalActionException
codeBuffer
- The string buffer that the generated code is
appended to.state
- The current state.IllegalActionException
- Thrown if the corresponding code
block cannot be fetched.protected java.lang.Object _generateStateConstantLabel(State state)
state
- The state.