|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.codegen.kernel.CodeGeneratorHelper
ptolemy.codegen.rtmaude.kernel.RTMaudeAdaptor
public class RTMaudeAdaptor
Generate RTMaude code in DE domain. Every adaptor (helper) class for RTMaude should extend this class.
CodeGeneratorHelper
,
Serialized Form
Red (kquine) |
Red (kquine) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.codegen.kernel.CodeGeneratorHelper |
---|
CodeGeneratorHelper.Channel, CodeGeneratorHelper.VariableScope |
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
NamedObj.ContainedObjectsIterator |
Field Summary | |
---|---|
protected java.lang.String |
defaultTermBlock
The default name of the block for the term template. |
(package private) java.util.List<java.lang.String> |
formalIncludes
|
(package private) java.util.Map<java.lang.String,java.lang.String> |
RTMmodule
|
(package private) java.util.List<java.lang.String> |
semanticsIncludes
|
Fields inherited from class ptolemy.codegen.kernel.CodeGeneratorHelper |
---|
_codeGenerator, _codeStream, _eol, _INDENT1, _INDENT2, _parseTreeCodeGenerator, _portConversions, _referencedParameters |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Constructor Summary | |
---|---|
RTMaudeAdaptor(NamedObj component)
Constructs a RTMaude code generator adaptor. |
Method Summary | |
---|---|
protected java.lang.String |
_generateBlockCode(java.lang.String blockName,
java.lang.String... args)
Given a block name, generate code for that block. |
protected java.lang.String |
_generateTypeConvertMethod(java.lang.String ref,
java.lang.String castType,
java.lang.String refType)
Generate expression that evaluates to a result of equivalent value with the cast type. |
protected java.lang.String |
_replaceMacro(java.lang.String macro,
java.lang.String parameter)
Return the replacement string of the given macro. |
java.lang.String |
generateEntryCode()
Generates the entry code for RTMaude model, whose template is defined in "mainEntry" block. |
java.lang.String |
generateExitCode()
Generates the exit code for the RTMaude model, whose template is defined in "mainExit" block. |
java.lang.String |
generateFireCode()
Generate the fire code. |
java.lang.String |
generateFireFunctionCode()
Generate The fire function code. |
java.lang.String |
generateTermCode()
Generate a Real-time Maude term representation of given component. |
java.util.List<java.lang.String> |
getBlockCodeList(java.lang.String blockName,
java.lang.String... args)
Given a block name, generate a list of codes for that block. |
protected java.lang.String |
getInfo(java.lang.String name,
java.util.List<java.lang.String> parameters)
Returns some information of the component. |
java.util.List<java.lang.String> |
getModuleCode(java.lang.String header)
Generates code for RTMaude module with the given template indicated by the header of the block. |
ParseTreeCodeGenerator |
getParseTreeCodeGenerator()
Return a new parse tree code generator to use with expressions. |
java.util.Map<java.lang.String,java.lang.String> |
getRTMmodule()
Returns the RTMmodule value. |
java.util.Set |
getSharedCode()
Generate the shared code. |
protected java.lang.String |
getTranslatedExpression(java.lang.String expression)
Get the translanted expression. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String defaultTermBlock
java.util.Map<java.lang.String,java.lang.String> RTMmodule
java.util.List<java.lang.String> semanticsIncludes
java.util.List<java.lang.String> formalIncludes
Constructor Detail |
---|
public RTMaudeAdaptor(NamedObj component)
component
- The associated componentMethod Detail |
---|
public java.util.List<java.lang.String> getBlockCodeList(java.lang.String blockName, java.lang.String... args) throws IllegalActionException
blockName
- The name of the block.args
- The arguments for the block.
IllegalActionException
public java.lang.String generateFireCode() throws IllegalActionException
CodeGeneratorHelper
generateFireCode
in interface ActorCodeGenerator
generateFireCode
in class CodeGeneratorHelper
IllegalActionException
- Not thrown in this base class.public java.lang.String generateFireFunctionCode() throws IllegalActionException
CodeGeneratorHelper
generateFireFunctionCode
in interface ActorCodeGenerator
generateFireFunctionCode
in class CodeGeneratorHelper
IllegalActionException
- If thrown while generating fire code.public java.lang.String generateTermCode() throws IllegalActionException
IllegalActionException
public java.util.Set getSharedCode() throws IllegalActionException
CodeGeneratorHelper
getSharedCode
in interface ActorCodeGenerator
getSharedCode
in class CodeGeneratorHelper
IllegalActionException
- Not thrown in this base class.public java.util.List<java.lang.String> getModuleCode(java.lang.String header) throws IllegalActionException
header
- The header of the template block
IllegalActionException
public java.lang.String generateEntryCode() throws IllegalActionException
IllegalActionException
public java.lang.String generateExitCode() throws IllegalActionException
IllegalActionException
public ParseTreeCodeGenerator getParseTreeCodeGenerator()
getParseTreeCodeGenerator
in class CodeGeneratorHelper
public java.util.Map<java.lang.String,java.lang.String> getRTMmodule()
protected java.lang.String getInfo(java.lang.String name, java.util.List<java.lang.String> parameters) throws IllegalActionException
name
- The name of the desired informationparameters
- The parameters for the information
IllegalActionException
protected java.lang.String _generateBlockCode(java.lang.String blockName, java.lang.String... args) throws IllegalActionException
blockName
- The name of the block.args
- The arguments for the block.
IllegalActionException
protected java.lang.String _generateTypeConvertMethod(java.lang.String ref, java.lang.String castType, java.lang.String refType) throws IllegalActionException
CodeGeneratorHelper
_generateTypeConvertMethod
in class CodeGeneratorHelper
ref
- The given variable expression.castType
- The given cast type.refType
- The given type of the variable.
IllegalActionException
protected java.lang.String _replaceMacro(java.lang.String macro, java.lang.String parameter) throws IllegalActionException
CodeGeneratorHelper
_replaceMacro
in class CodeGeneratorHelper
macro
- The given macro.parameter
- The given parameter to the macro.
IllegalActionException
- Thrown if the given macro or parameter
is not valid.protected java.lang.String getTranslatedExpression(java.lang.String expression) throws IllegalActionException
expression
- The expression to be parsed and translated.
IllegalActionException
- If thrown by the parser.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |