Package ptolemy.copernicus.interpreted
Class InterpretedWriter
- java.lang.Object
-
- soot.Transformer
-
- soot.SceneTransformer
-
- ptolemy.copernicus.interpreted.InterpretedWriter
-
- All Implemented Interfaces:
soot.HasPhaseOptions
public class InterpretedWriter extends soot.SceneTransformer implements soot.HasPhaseOptionsA 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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDeclaredOptions()java.lang.StringgetDefaultOptions()java.lang.StringgetPhaseName()protected voidinternalTransform(java.lang.String phaseName, java.util.Map options)Save the model as a .xml filestatic InterpretedWriterv(CompositeEntity model)Return an instance of this transformer that will operate on the given model.
-
-
-
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:
getDefaultOptionsin interfacesoot.HasPhaseOptions
-
getDeclaredOptions
public java.lang.String getDeclaredOptions()
- Specified by:
getDeclaredOptionsin interfacesoot.HasPhaseOptions
-
getPhaseName
public java.lang.String getPhaseName()
- Specified by:
getPhaseNamein interfacesoot.HasPhaseOptions
-
internalTransform
protected void internalTransform(java.lang.String phaseName, java.util.Map options)Save the model as a .xml fileFor example, if the model is called MyModel, and this phase is called with:
-p wjtp.interpretedWriter targetPackage:foo.barThen we will create the directory $PTII/foo/bar/MyModel and place MyModel.xml in that directory.- Specified by:
internalTransformin classsoot.SceneTransformer- Parameters:
phaseName- The name of the phase, for examplewjtp.interpretedWriter.options- The options Map. This method uses thetargetPackageoption to specify package to generate code in.
-
-