Package ptolemy.actor.ptalon.gt
Class TransformationEvaluator
- java.lang.Object
-
- ptolemy.actor.ptalon.AbstractPtalonEvaluator
-
- ptolemy.actor.ptalon.PtalonEvaluator
-
- 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$
- Author:
- Thomas Huining Feng
- Pt.AcceptedRating:
- Red (tfeng)
- Pt.ProposedRating:
- Red (tfeng)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.actor.ptalon.AbstractPtalonEvaluator
AbstractPtalonEvaluator.IfTree, AbstractPtalonEvaluator.PtalonExpressionScope
-
-
Field Summary
-
Fields inherited from class ptolemy.actor.ptalon.AbstractPtalonEvaluator
_actor, _currentIfTree, _imports, _scope, _transparentRelations
-
-
Constructor Summary
Constructors Constructor Description TransformationEvaluator(PtalonActor actor)
Construct transformation evaluator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_processAttributes(NamedObj object)
Process an attribute.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
-
-
-
-
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 classAbstractPtalonEvaluator
- 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 classAbstractPtalonEvaluator
- 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 aNegationAttribute
.- Overrides:
negateObject
in classAbstractPtalonEvaluator
- 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 anOptionAttribute
.- Overrides:
optionalObject
in classAbstractPtalonEvaluator
- 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 anOptionAttribute
.- Overrides:
preserveObject
in classAbstractPtalonEvaluator
- 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 classAbstractPtalonEvaluator
- 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 classPtalonEvaluator
-
_processAttributes
protected void _processAttributes(NamedObj object) throws PtalonRuntimeException
Process an attribute.- Overrides:
_processAttributes
in classAbstractPtalonEvaluator
- Parameters:
object
- The NamedObj to be processed.- Throws:
PtalonRuntimeException
- If thrown while processing the attribute.
-
-