Class ExpressionToToken

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class ExpressionToToken
    extends Converter
    This actor reads a string expression from the input port and outputs the token resulting from the evaluation. The type of the output port is by default undeclared. To use this actor, you may need to declare the output type. Depending on how the output is used, if backward type resolution is enabled in the model (the default, see the parameters of the top-level model), then the type will resolve to the most general type acceptable to the downstream actors. If the downstream actors all propagate type constraints backwards, then it might be possible for the output type to be inferred. If backward type resolution is not enabled, then you will always need to set the type of the output port to the type of the expression that is expected. If the input string parses to something that does not match the specified output data type, then a run-time type check error will occur when this actor tries to produce its output.

    The expression input can refer to any variable that is in scope for this actor.

    Since:
    Ptolemy II 2.1
    Version:
    $Id$
    Author:
    Steve Neuendorffer
    Pt.AcceptedRating:
    Red (liuj)
    Pt.ProposedRating:
    Yellow (neuendor)