Class SyntacticCodeGeneratorAdapter

  • All Implemented Interfaces:
    java.lang.Cloneable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public abstract class SyntacticCodeGeneratorAdapter
    extends CodeGeneratorAdapter
    Base class for a syntactic representation generator adapter.

    Subclasses should override generateSyntax().

    Subclasses should be sure to properly indent the code by either using the code block functionality in methods like _generateBlockCode(String) or by calling CodeStream.indent(String), for example:

         StringBuffer code = new StringBuffer();
         code.append(super.generateWrapupCode());
         code.append("// Local wrapup code");
         return processCode(CodeStream.indent(code.toString()));
     
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Bert Rodiers, Chris Shaver
    Pt.AcceptedRating:
    Red
    Pt.ProposedRating:
    Red (shaver)
    • Field Detail

      • _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.
      • _codeGenerator

        protected GenericCodeGenerator _codeGenerator
        The code generator that contains this adapter class.
    • Constructor Detail

      • SyntacticCodeGeneratorAdapter

        public SyntacticCodeGeneratorAdapter​(NamedObj component)
        Construct the code generator adapter associated with the given component.
        Parameters:
        component - The associated component.