Examples of ParseTreeSpecializer


Examples of ptolemy.data.expr.ParseTreeSpecializer

     */
    public void visitFunctionDefinitionNode(ASTPtFunctionDefinitionNode node)
            throws IllegalActionException {
        ASTPtRootNode cloneTree;

        ParseTreeSpecializer specializer = new ParseTreeSpecializer();
        cloneTree = specializer.specialize(node.getExpressionTree(), node
                .getArgumentNameList(), _scope);

        // Infer the return type.
        if (_typeInference == null) {
            _typeInference = new ParseTreeTypeInference();
View Full Code Here

Examples of ptolemy.data.expr.ParseTreeSpecializer

                                        excludedVariables
                                                .add((String) variable);
                                    }
                                }
                            }
                            ParseTreeSpecializer specializer = new ParseTreeSpecializer();
                            parseTree = specializer.specialize(parseTree,
                                    excludedVariables, _scope);
                            ParseTreeWriter writer = new ParseTreeWriter();
                            String outputExpression = writer
                                    .printParseTree(parseTree);
                            parameter.setExpression(outputExpression);
                        }
                    } catch (ClassCastException ex) {
                        Settable parameter = (Settable) actor
                                .getAttribute(parameterName);
                        ParseTreeFreeVariableCollector collector = new ParseTreeFreeVariableCollector();
                        Set expressionVariables = collector
                                .collectFreeVariables(parseTree);
                        Set scopeVariables = _scope.identifierSet();
                        List<String> excludedVariables = new LinkedList<String>();
                        for (Object variable : expressionVariables) {
                            if (variable instanceof String) {
                                if (!scopeVariables.contains(variable)) {
                                    excludedVariables.add((String) variable);
                                }
                            }
                        }
                        ParseTreeSpecializer specializer = new ParseTreeSpecializer();
                        parseTree = specializer.specialize(parseTree,
                                excludedVariables, _scope);
                        ParseTreeWriter writer = new ParseTreeWriter();
                        String outputExpression = writer
                                .printParseTree(parseTree);
                        parameter.setExpression(outputExpression);
View Full Code Here

Examples of ptolemy.data.expr.ParseTreeSpecializer

     */
    public void visitFunctionDefinitionNode(ASTPtFunctionDefinitionNode node)
            throws IllegalActionException {
        ASTPtRootNode cloneTree;

        ParseTreeSpecializer specializer = new ParseTreeSpecializer();
        cloneTree = specializer.specialize(node.getExpressionTree(), node
                .getArgumentNameList(), _scope);

        // Infer the return type.
        if (_typeInference == null) {
            _typeInference = new ParseTreeTypeInference();
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.