Examples of generateParseTree()


Examples of ptolemy.data.expr.PtParser.generateParseTree()

     @exception IllegalActionException If the string does
     *   not contain a parsable 2-D int matrix.
     */
    public IntMatrixToken(String init) throws IllegalActionException {
        PtParser parser = new PtParser();
        ASTPtRootNode tree = parser.generateParseTree(init);
        Token token = (new ParseTreeEvaluator()).evaluateParseTree(tree);

        if (token instanceof IntMatrixToken) {
            int[][] value = ((IntMatrixToken) token).intMatrix();
            _initialize(value);
View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

     @exception IllegalActionException If an error occurs, or the
     *  string cannot be parsed into a function.
     */
    public FunctionToken(String init) throws IllegalActionException {
        PtParser parser = new PtParser();
        ASTPtRootNode tree = parser.generateParseTree(init);
        ParseTreeTypeInference inference = new ParseTreeTypeInference();
        inference.inferTypes(tree);

        Token token = (new ParseTreeEvaluator()).evaluateParseTree(tree);

View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

     @exception IllegalActionException If the string does
     *   not contain a parsable 2-D double matrix.
     */
    public DoubleMatrixToken(String init) throws IllegalActionException {
        PtParser parser = new PtParser();
        ASTPtRootNode tree = parser.generateParseTree(init);
        Token token = (new ParseTreeEvaluator()).evaluateParseTree(tree);

        if (token instanceof DoubleMatrixToken) {
            double[][] value = ((DoubleMatrixToken) token).doubleMatrix();
            _initialize(value);
View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

            Map nameToType, JimpleBody body, Unit insertPoint) {
        Local local;

        try {
            PtParser parser = new PtParser();
            ASTPtRootNode parseTree = parser.generateParseTree(expression);
            ActorCodeGenerationScope scope = new ActorCodeGenerationScope(
                    entity, entityClass, nameToFieldOrLocal, nameToType, body,
                    insertPoint);
            ParseTreeCodeGenerator generator = new ParseTreeCodeGenerator();
            local = generator.generateCode(parseTree, body, insertPoint, scope);
View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

        try {
            // Note that the parser is NOT retained, since in most
            // cases the expression doesn't change, and the parser
            // requires a large amount of memory.
            PtParser parser = new PtParser();
            ASTPtRootNode parseTree = parser.generateParseTree(actor.expression
                    .getExpression());

            _cParseTreeCodeGenerator.evaluateParseTree(parseTree,
                    new VariableScope(actor));
        } catch (IllegalActionException ex) {
View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

                    if (expression == null) {
                        throw new PtalonRuntimeException(
                                "Unable to find expression label for "
                                        + "parameter " + parameterName);
                    }
                    ASTPtRootNode _parseTree = parser
                            .generateParseTree(expression);
                    Parameter parameter = (Parameter) actor
                            .getAttribute(parameterName);
                    if (parameter == null) {
                        String uniqueName = actor.uniqueName(parameterName);
View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

                    if (expression == null) {
                        throw new PtalonRuntimeException(
                                "Unable to find expression label for "
                                        + "parameter " + parameterName);
                    }
                    ASTPtRootNode parseTree = parser
                            .generateParseTree(expression);
                    try {
                        Parameter parameter = (Parameter) actor
                                .getAttribute(parameterName);
                        if (parameter == null) {
View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

            if (_parseTree == null) {
                // Note that the parser is NOT retained, since in most
                // cases the expression doesn't change, and the parser
                // requires a large amount of memory.
                PtParser parser = new PtParser();
                _parseTree = parser.generateParseTree(expression
                        .getExpression());
            }

            if (_parseTreeEvaluator == null) {
                _parseTreeEvaluator = new ParseTreeEvaluator();
View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

                if (_parseTree == null) {
                    // Note that the parser is NOT retained, since in most
                    // cases the expression doesn't change, and the parser
                    // requires a large amount of memory.
                    PtParser parser = new PtParser();
                    _parseTree = parser.generateParseTree(expression
                            .getExpression());
                }

                if (_scope == null) {
                    _scope = new VariableScope();
View Full Code Here

Examples of ptolemy.data.expr.PtParser.generateParseTree()

            // inputs and all of the parameters that are free variables for
            // the expression.
            try {
                if (_parseTree == null) {
                    PtParser parser = new PtParser();
                    _parseTree = parser.generateParseTree(expression
                            .getExpression());
                }

                if (_scope == null) {
                    _scope = new VariableScope();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.