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.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDeclaredOptions()
java.lang.String
getDefaultOptions()
java.lang.String
getPhaseName()
protected void
internalTransform(java.lang.String phaseName, java.util.Map options)
Save the model as a .xml filestatic InterpretedWriter
v(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:
getDefaultOptions
in interfacesoot.HasPhaseOptions
-
getDeclaredOptions
public java.lang.String getDeclaredOptions()
- Specified by:
getDeclaredOptions
in interfacesoot.HasPhaseOptions
-
getPhaseName
public java.lang.String getPhaseName()
- Specified by:
getPhaseName
in 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.bar
Then we will create the directory $PTII/foo/bar/MyModel and place MyModel.xml in that directory.- Specified by:
internalTransform
in classsoot.SceneTransformer
- Parameters:
phaseName
- The name of the phase, for examplewjtp.interpretedWriter
.options
- The options Map. This method uses thetargetPackage
option to specify package to generate code in.
-
-