Examples of ParseTreeTypeInference


Examples of ptolemy.data.expr.ParseTreeTypeInference

     *  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);

        if (token instanceof FunctionToken) {
            _function = ((FunctionToken) token)._function;
View Full Code Here

Examples of ptolemy.data.expr.ParseTreeTypeInference

     */
    public ptolemy.data.Token evaluateParseTree(ASTPtRootNode node,
            ParserScope scope) throws IllegalActionException {

        // Make a first pass to infer types.
        ParseTreeTypeInference typeInference = new ParseTreeTypeInference();
        typeInference.inferTypes(node, scope);

        _scope = scope;

        // Evaluate the value of the root node.
        node.visit(this);
View Full Code Here

Examples of ptolemy.data.expr.ParseTreeTypeInference

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

        // Infer the return type.
        if (_typeInference == null) {
            _typeInference = new ParseTreeTypeInference();
        }

        _typeInference.inferTypes(node, _scope);

        FunctionType type = (FunctionType) node.getType();
View Full Code Here

Examples of ptolemy.data.expr.ParseTreeTypeInference

     */
    public ptolemy.data.Token evaluateParseTree(ASTPtRootNode node,
            ParserScope scope) throws IllegalActionException {

        // Make a first pass to infer types.
        ParseTreeTypeInference typeInference = new ParseTreeTypeInference();
        typeInference.inferTypes(node, scope);

        _scope = scope;

        // Evaluate the value of the root node.
        node.visit(this);
View Full Code Here

Examples of ptolemy.data.expr.ParseTreeTypeInference

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

        // Infer the return type.
        if (_typeInference == null) {
            _typeInference = new ParseTreeTypeInference();
        }

        _typeInference.inferTypes(node, _scope);

        FunctionType type = (FunctionType) node.getType();
View Full Code Here

Examples of ptolemy.data.expr.ParseTreeTypeInference

    }

    public Local generateCode(ASTPtRootNode node, JimpleBody body,
            Unit insertPoint, CodeGenerationScope scope)
            throws IllegalActionException {
        ParseTreeTypeInference typeInference = new ParseTreeTypeInference();
        typeInference.inferTypes(node, scope);
        _scope = scope;
        _body = body;
        _nodeToLocal = new HashMap();
        _units = body.getUnits();
        _insertPoint = insertPoint;
View Full Code Here

Examples of ptolemy.data.expr.ParseTreeTypeInference

                .collectFreeVariables(node));
        Collections.sort(freeVariableList);
        System.out.println("freeVariableList = " + freeVariableList);

        // Infer the type of the function.
        ParseTreeTypeInference inference = new ParseTreeTypeInference();
        inference.inferTypes(node, _scope);

        FunctionType functionType = (FunctionType) node.getType();

        ASTPtRootNode cloneTree = (ASTPtRootNode) node.getExpressionTree(); //.clone();
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.