public class SyntacticCodeGenerator extends GenericCodeGenerator
To generate a syntactic representation, use:
java -classpath $PTII ptolemy.cg.kernel.generic.syntactic.SyntacticCodeGenerator
| red |
| red (shaver) |
NamedObj.ContainedObjectsIterator_codeFileName, _eol, _executeCommands, _generateInSubdirectory, _model, _sanitizedModelName, codeDirectory, generateInSubdirectory, generatorPackage, generatorPackageList, INDENT1, INDENT2, INDENT3, overwriteFiles_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS| Constructor and Description |
|---|
SyntacticCodeGenerator(NamedObj container,
java.lang.String name)
Create a new instance of the SyntacticCodeGenerator.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
_generateCode(java.lang.StringBuffer code)
Generate a syntactic representation and append it to the given string buffer.
|
protected java.lang.Class<?> |
_getAdapterClassFilter()
Return the filter class to find adapters.
|
protected void |
_showGraph()
Show the SyntacticGraph in a Tableau.
|
java.lang.String |
comment(java.lang.String comment)
Format a string as a code comment.
|
_copyCFilesTosrc, _copyCFileTosrc, _executeCommands, _getAdapter, _getAutoGeneratedAdapter, _getOutputFilename, _instantiateAdapter, _isTopLevel, _printTimeAndMemory, _reset, _resetAll, _writeCode, _writeCodeFileName, attributeChanged, clone, createDecoratorAttributes, decoratedObjects, generateCode, generateCode, generateCode, generateCopyright, getAdapter, getCodeFileName, getComponent, getExecuteCommands, getMethodExceptionString, getMethodVisibilityString, isGlobalDecorator, main, setCodeGenerator, setContainer, setExecuteCommands, updateCommandOptions_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspaceequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdescription, getContainer, getDisplayName, getFullName, getName, getName, setNamepublic SyntacticCodeGenerator(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
generic.syntacticcontainer - The container.name - The name of the SyntacticCodeGenerator.IllegalActionException - If the super class throws the
exception or error occurs when setting the file path.NameDuplicationException - If the super class throws the
exception or an error occurs when setting the file path.public java.lang.String comment(java.lang.String comment)
comment in class GenericCodeGeneratorcomment - The string to format as a comment.protected int _generateCode(java.lang.StringBuffer code)
throws KernelException
$HOME, the name of the
model is Foo and the generatorPackage
is ptolemy.cg.kernel.generic.syntactic, then the file that is
written will be $HOME/Foo.html
This method is the main entry point to generate code._generateCode in class GenericCodeGeneratorcode - The given string buffer.KernelException - If the target file cannot be overwritten
or write-to-file throw any exception.protected java.lang.Class<?> _getAdapterClassFilter()
_getAdapterClassFilter in class GenericCodeGeneratorprotected void _showGraph()
throws IllegalActionException
IllegalActionException - Thrown if there is a problem
getting the configuration, opening the instance of the
syntactic graph or showing the tableau.