ptolemy.actor.ptalon.gt
Class TransformationEvaluator

java.lang.Object
  extended by ptolemy.actor.ptalon.AbstractPtalonEvaluator
      extended by ptolemy.actor.ptalon.PtalonEvaluator
          extended by ptolemy.actor.ptalon.gt.TransformationEvaluator

public class TransformationEvaluator
extends PtalonEvaluator

Parse transformation actor or values and set parameters of actors.

Since:
Ptolemy II 8.0
Version:
$Id: TransformationEvaluator.java 59167 2010-09-21 17:08:02Z cxh $
Author:
Thomas Huining Feng
Accepted Rating:
Red (tfeng)
Proposed Rating:
Red (tfeng)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.actor.ptalon.AbstractPtalonEvaluator
AbstractPtalonEvaluator.IfTree, AbstractPtalonEvaluator.PtalonExpressionScope
 
Field Summary
private  boolean _isIncrementalTransformation
           
private  boolean _isInTransformation
           
private  java.util.List<NamedObj> _negatedObjects
           
private  java.util.List<NamedObj> _optionalObjects
           
private  java.util.List<NamedObj> _preservedObjects
           
private  java.util.List<NamedObj> _removedObjects
           
 
Fields inherited from class ptolemy.actor.ptalon.AbstractPtalonEvaluator
_actor, _currentIfTree, _imports, _scope, _transparentRelations
 
Constructor Summary
TransformationEvaluator(PtalonActor actor)
          Construct transformation evaluator.
 
Method Summary
private  NamedObj _getObject(java.lang.String name)
           
protected  void _processAttributes(NamedObj object)
          Process an attribute.
private  void _removeAttributes(NamedObj object, java.lang.Class<?>[] attributeClasses)
           
 void enterTransformation(boolean incremental)
          Enter the transformation.
 void exitTransformation()
          Exit the transformation.
 void negateObject(java.lang.String name)
          Negate an object.
 void optionalObject(java.lang.String name)
          Mark a NamedObj as optional.
 void preserveObject(java.lang.String name)
          Preserve an object.
 void removeObject(java.lang.String name)
          Remove an object.
 void startAtTop()
          Prepare the compiler to start at the outermost scope of the Ptalon program during run time.
 
Methods inherited from class ptolemy.actor.ptalon.PtalonEvaluator
addActor, addParameterAssign, addPortAssign, addPortAssign, addSymbol, addUnknownLeftSide, enterActorDeclaration, exitActorDeclaration, isActorReady, popActorDeclaration, pushActorDeclaration, setActorParameter, setActorSymbol, setDanglingPortsOkay
 
Methods inherited from class ptolemy.actor.ptalon.AbstractPtalonEvaluator
_getIndentPrefix, _getTimesEntered, _getType, _getTypeForScope, _inNewWhileIteration, _isPreservingTransformation, _resetParameters, _setPreservingTransformation, addActorParameter, addActorParameter, addInPort, addOutPort, addParameter, addParameter, addPort, addRelation, addTransparentRelation, assignInternalParameters, enterForScope, enterIfScope, evaluateBoolean, evaluateExpression, evaluateForScope, evaluateString, exitForScope, exitIfScope, getMappedName, hasUnassignedParameters, inScope, isCreated, isForReady, isIfReady, isReady, popForStatement, popIfStatement, pushForStatement, pushIfStatement, setActiveBranch, setCurrentBranch, setNextExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_isInTransformation

private boolean _isInTransformation

_isIncrementalTransformation

private boolean _isIncrementalTransformation

_negatedObjects

private java.util.List<NamedObj> _negatedObjects

_optionalObjects

private java.util.List<NamedObj> _optionalObjects

_preservedObjects

private java.util.List<NamedObj> _preservedObjects

_removedObjects

private java.util.List<NamedObj> _removedObjects
Constructor Detail

TransformationEvaluator

public TransformationEvaluator(PtalonActor actor)
Construct transformation evaluator.

Parameters:
actor - the Ptalon actor
Method Detail

enterTransformation

public void enterTransformation(boolean incremental)
                         throws PtalonRuntimeException
Enter the transformation.

Overrides:
enterTransformation in class AbstractPtalonEvaluator
Parameters:
incremental - True if this is an incremental transformation.
Throws:
PtalonRuntimeException - Not thrown in this baseclass.

exitTransformation

public void exitTransformation()
                        throws PtalonRuntimeException
Exit the transformation.

Overrides:
exitTransformation in class AbstractPtalonEvaluator
Throws:
PtalonRuntimeException - Not thrown in this baseclass.

negateObject

public void negateObject(java.lang.String name)
                  throws PtalonRuntimeException
Negate an object. A negated object is a NamedObj with a NegationAttribute.

Overrides:
negateObject in class AbstractPtalonEvaluator
Parameters:
name - The name of the NamedObj to be negated.
Throws:
PtalonRuntimeException - If we are in a transformation or if the object has already been negated.

optionalObject

public void optionalObject(java.lang.String name)
                    throws PtalonRuntimeException
Mark a NamedObj as optional. An optional object is a NamedObj with an OptionAttribute.

Overrides:
optionalObject in class AbstractPtalonEvaluator
Parameters:
name - The name of the NamedObj to be marked optional.
Throws:
PtalonRuntimeException - If we are in a transformation or if the object has already been marked optional

preserveObject

public void preserveObject(java.lang.String name)
                    throws PtalonRuntimeException
Preserve an object. A preserved object is a NamedObj with an OptionAttribute.

Overrides:
preserveObject in class AbstractPtalonEvaluator
Parameters:
name - The name of the NamedObj to be preserved
Throws:
PtalonRuntimeException - If we are in a transformation or if the object has already been preserved.

removeObject

public void removeObject(java.lang.String name)
                  throws PtalonRuntimeException
Remove an object.

Overrides:
removeObject in class AbstractPtalonEvaluator
Parameters:
name - The name of the NamedObj to be removed.
Throws:
PtalonRuntimeException - If we are in a transformation or if the object has already been marked as removed.

startAtTop

public void startAtTop()
Prepare the compiler to start at the outermost scope of the Ptalon program during run time.

Overrides:
startAtTop in class PtalonEvaluator

_processAttributes

protected void _processAttributes(NamedObj object)
                           throws PtalonRuntimeException
Process an attribute.

Overrides:
_processAttributes in class AbstractPtalonEvaluator
Parameters:
object - The NamedObj to be processed.
Throws:
PtalonRuntimeException - If thrown while processing the attribute.

_getObject

private NamedObj _getObject(java.lang.String name)
                     throws PtalonScopeException,
                            PtalonRuntimeException
Throws:
PtalonScopeException
PtalonRuntimeException

_removeAttributes

private void _removeAttributes(NamedObj object,
                               java.lang.Class<?>[] attributeClasses)
                        throws IllegalActionException,
                               NameDuplicationException
Throws:
IllegalActionException
NameDuplicationException