|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.codegen.kernel.CodeStream.CodeBlockTable
private class CodeStream.CodeBlockTable
The code block table class. A code block table contains code objects, which consists of the file path of the code block, the code block content, and the parameter list. The table is represented using a LinkedList of scopes, where the first element is scope for the left child class and each latter element is parent scope of the prior.
Field Summary | |
---|---|
private java.util.LinkedList<java.util.LinkedHashMap> |
_codeTableList
LinkedList of LinkedHashMap of code blocks. |
Constructor Summary | |
---|---|
CodeStream.CodeBlockTable()
Constructor for a code block table. |
Method Summary | |
---|---|
private java.lang.StringBuffer |
_getCode(CodeStream.Signature signature,
java.util.List arguments,
java.util.List scopeList)
Return the code block content of the given signature and substitute parameters with the given list of arguments. |
private java.lang.String |
_getHeader(CodeStream.Signature signature,
java.util.List scopeList)
|
private java.util.List |
_getParameters(CodeStream.Signature signature,
java.util.List scopeList)
Get the parameters for the code block with the given signature. |
private int |
_indexOfMacro(java.lang.StringBuffer codeBlock,
java.lang.String macro,
int start,
boolean allowDot)
|
private java.lang.StringBuffer |
_substituteSuperAndThis(CodeStream.Signature signature,
java.util.List scopeList,
java.lang.Object[] codeObject,
java.lang.StringBuffer codeBlock)
|
void |
addScope()
Add a new scope to the code block table. |
java.lang.StringBuffer |
getCode(CodeStream.Signature signature,
java.util.List arguments)
Return the code block content of the given signature and substitute parameters with the given list of arguments. |
java.util.List |
getParameters(CodeStream.Signature signature)
Get the list of parameters for the code block with the given signature. |
java.lang.StringBuffer |
getTemplateCode(CodeStream.Signature signature)
Return the code block content of the given signature without substituting parameters. |
private java.util.Iterator |
keys()
Return all contained signature keys. |
private java.util.Set |
keySet()
Return all the keys contained in this code block table. |
void |
putCode(CodeStream.Signature signature,
java.lang.String filePath,
java.lang.StringBuffer code)
Put the given file path and code content into the current scope using the given signature as the key. |
void |
putParameters(CodeStream.Signature signature,
java.util.List parameters)
Put the given list parameters into the current scope using the given signature as the key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.LinkedList<java.util.LinkedHashMap> _codeTableList
Constructor Detail |
---|
public CodeStream.CodeBlockTable()
Method Detail |
---|
public void addScope()
public java.lang.StringBuffer getCode(CodeStream.Signature signature, java.util.List arguments) throws IllegalActionException
signature
- The given code block signature.arguments
- The given list of arguments.
IllegalActionException
- Thrown if
getCode(Signature, List, List) throws it.public java.lang.StringBuffer getTemplateCode(CodeStream.Signature signature) throws IllegalActionException
signature
- The given code block signature.
IllegalActionException
- Thrown if
getCode(Signature, List, List) throws it.public java.util.List getParameters(CodeStream.Signature signature)
signature
- The given code block signature.
public void putCode(CodeStream.Signature signature, java.lang.String filePath, java.lang.StringBuffer code)
signature
- The given signature.filePath
- The given file path.code
- The given code content.public void putParameters(CodeStream.Signature signature, java.util.List parameters) throws IllegalActionException
signature
- The given signature.parameters
- The given list of parameters.
IllegalActionException
- Thrown if the given signature
already exists in the current scope.private java.lang.StringBuffer _getCode(CodeStream.Signature signature, java.util.List arguments, java.util.List scopeList) throws IllegalActionException
signature
- The given signature.arguments
- The given list of arguments.scopeList
- The given list of scopes.
IllegalActionException
- Thrown if the code block for a
super call cannot be found, or if substituteParameters(
StringBuffer, List, List) throws it.private java.lang.String _getHeader(CodeStream.Signature signature, java.util.List scopeList) throws IllegalActionException
IllegalActionException
private java.lang.StringBuffer _substituteSuperAndThis(CodeStream.Signature signature, java.util.List scopeList, java.lang.Object[] codeObject, java.lang.StringBuffer codeBlock) throws IllegalActionException
IllegalActionException
private int _indexOfMacro(java.lang.StringBuffer codeBlock, java.lang.String macro, int start, boolean allowDot)
private java.util.List _getParameters(CodeStream.Signature signature, java.util.List scopeList)
signature
- The given signature.scopeList
- The given list of scopes.
private java.util.Set keySet()
private java.util.Iterator keys()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |