Class InterpretedWriter

  • All Implemented Interfaces:
    soot.HasPhaseOptions

    public class InterpretedWriter
    extends soot.SceneTransformer
    implements soot.HasPhaseOptions
    A transformer that writes an interpreted version of a model. This transformer is very similar to 'Save As'. This transformer is used as a control case to compare the effects of other code generators against a purely interpreted (non-code generation) run. This transformer is the smallest standalone Ptolemy II transformer.

    For a model called Foo, we generate Foo.xml, in the directory named by the outputDirectory parameter.

    Since:
    Ptolemy II 2.0
    Version:
    $Id$
    Author:
    Christopher Hylands
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Method Detail

      • v

        public static InterpretedWriter v​(CompositeEntity model)
        Return an instance of this transformer that will operate on the given model. The model is assumed to already have been properly initialized so that resolved types and other static properties of the model can be inspected.
        Parameters:
        model - The model that this class will operate on.
        Returns:
        An instance of the AppletWriter transformer.
      • getDefaultOptions

        public java.lang.String getDefaultOptions()
        Specified by:
        getDefaultOptions in interface soot.HasPhaseOptions
      • getDeclaredOptions

        public java.lang.String getDeclaredOptions()
        Specified by:
        getDeclaredOptions in interface soot.HasPhaseOptions
      • getPhaseName

        public java.lang.String getPhaseName()
        Specified by:
        getPhaseName in interface soot.HasPhaseOptions
      • internalTransform

        protected void internalTransform​(java.lang.String phaseName,
                                         java.util.Map options)
        Save the model as a .xml file

        For example, if the model is called MyModel, and this phase is called with:

                -p wjtp.interpretedWriter targetPackage:foo.bar
          
        Then we will create the directory $PTII/foo/bar/MyModel and place MyModel.xml in that directory.
        Specified by:
        internalTransform in class soot.SceneTransformer
        Parameters:
        phaseName - The name of the phase, for example wjtp.interpretedWriter.
        options - The options Map. This method uses the targetPackage option to specify package to generate code in.