Package ptolemy.data.expr

Examples of ptolemy.data.expr.Variable


            code.append(comment(1, "Generate variable initialization for "
                    + "modified parameters"));
            Iterator modifiedVariables = _modifiedVariables.iterator();
            while (modifiedVariables.hasNext()) {
                // SetVariable needs this to be a Variable, not a Parameter.
                Variable variable = (Variable) modifiedVariables.next();

                NamedObj container = variable.getContainer();
                CodeGeneratorHelper containerHelper = (CodeGeneratorHelper) _getHelper(container);
                code.append(_INDENT1
                        + generateVariableName(variable)
                        + " = "
                        + containerHelper.getParameterValue(variable.getName(),
                                variable.getContainer()) + ";" + _eol);
            }
        }

        return code.toString();
    }
View Full Code Here


                }

                try {
                    // Parse the line.
                    if (_variable == null) {
                        _variable = new Variable(workspace());
                        _variable.setName("Expression evaluator");
                    }

                    _variable.setExpression(line);
View Full Code Here

            if (token != null) {
                return token;
            }

            Variable result = getScopedVariable(null, Expression.this, name);

            if (result != null) {
                return result.getToken();
            }

            return null;
        }
View Full Code Here

            if (port != null) {
                return port.getType();
            }

            Variable result = getScopedVariable(null, Expression.this, name);

            if (result != null) {
                return (Type) result.getTypeTerm().getValue();
            }

            return null;
        }
View Full Code Here

            if (port != null) {
                return port.getTypeTerm();
            }

            Variable result = getScopedVariable(null, Expression.this, name);

            if (result != null) {
                return result.getTypeTerm();
            }

            return null;
        }
View Full Code Here

                    // so don't create a type constraint.
                    return null;
                }

                if (attribute instanceof Variable) {
                    Variable parameter = (Variable) attribute;
                    InequalityTerm parameterTypeTerm = new ConstantTerm(
                            parameter.getType(), parameter);

                    if (methodName.equals("setToken")) {
                        // The type of the argument must be less than the
                        // type of the parameter.
                        InequalityTerm firstArgTerm = (InequalityTerm) objectToInequalityTerm
View Full Code Here

     */
    public ExpressionReader(CompositeEntity container, String name)
            throws IllegalActionException, NameDuplicationException {
        super(container, name);

        _expressionEvaluator = new Variable(this, "_expressionEvaluator");
    }
View Full Code Here

            try {
                workspace().getWriteAccess();

                // container might be null, so create the variable
                // in the container of this actor.
                _attribute = new Variable(getContainer(), variableNameValue);
            } catch (NameDuplicationException ex) {
                throw new InternalErrorException(ex);
            } finally {
                workspace().doneWriting();
            }
View Full Code Here

    public VariableScope(NamedObj container) {
        _container = container;
    }

    public Token get(String name) throws IllegalActionException {
        Variable result = getScopedVariable(null, _container, name);

        if (result != null) {
            return result.getToken();
        } else {
            return null;
        }
    }
View Full Code Here

            return null;
        }
    }

    public Type getType(String name) throws IllegalActionException {
        Variable result = getScopedVariable(null, _container, name);

        if (result != null) {
            return result.getType();
        } else {
            return null;
        }
    }
View Full Code Here

TOP

Related Classes of ptolemy.data.expr.Variable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.