Class ProgramCodeGeneratorAdapter

    • Field Detail

      • _component

        protected java.lang.Object _component
        The associated component.
      • _defaultBlocks

        protected static final java.lang.String[] _defaultBlocks
        The code block table that stores the code block body (StringBuffer) with the code block name (String) as key.
      • _eol

        protected static final java.lang.String _eol
        End of line character. Under Unix: "\n", under Windows: "\n\r". We use a end of line character so that the files we generate have the proper end of line character for use by other native tools.
      • _templateParser

        protected TemplateParser _templateParser
        The strategy for generating code for this adapter.
    • Constructor Detail

      • ProgramCodeGeneratorAdapter

        public ProgramCodeGeneratorAdapter​(java.lang.Object component)
        Construct the code generator adapter associated with the given component.
        Parameters:
        component - The associated component.
    • Method Detail

      • getComponent

        public java.lang.Object getComponent()
        Get the component associated with this adapter.
        Returns:
        The associated component.
      • processCode

        public final java.lang.String processCode​(java.lang.String code)
                                           throws IllegalActionException
        Process the specified code, replacing macros with their values.
        Parameters:
        code - The code to process.
        Returns:
        The processed code.
        Throws:
        IllegalActionException - If illegal macro names are found.
      • setTemplateParser

        public final void setTemplateParser​(TemplateParser templateParser)
        Set the template parser for this adapter.
        Parameters:
        templateParser - The template parser.
        See Also:
        getTemplateParser()
      • toString

        public java.lang.String toString()
        Description copied from class: NamedObj
        Return the class name and the full name of the object, with syntax "className {fullName}".
        Overrides:
        toString in class NamedObj
        Returns:
        The class name and the full name.
      • _generateBlockByName

        protected java.lang.String _generateBlockByName​(java.lang.String blockName)
                                                 throws IllegalActionException
        Generate code for a given block. The comment includes the portion of the blockName parameter up until the string "Block".
        Parameters:
        blockName - The name of the block, which usually ends with the string "Block".
        Returns:
        The generated wrapup code.
        Throws:
        IllegalActionException - If thrown while appending to the the block or processing the macros.