Examples of ASTPtRootNode


Examples of ptolemy.data.expr.ASTPtRootNode

     @param node The specified node.
     *  @exception IllegalActionException If an parse error occurs.
     */
    public void visitFunctionDefinitionNode(ASTPtFunctionDefinitionNode node)
            throws IllegalActionException {
        ASTPtRootNode cloneTree;

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

View Full Code Here

Examples of ptolemy.data.expr.ASTPtRootNode

         if (value) {
         */
        //_fireCode.append(" ? ");
        result += " ? ";

        ASTPtRootNode tokenChild1 = (ASTPtRootNode) node.jjtGetChild(1);
        ASTPtRootNode tokenChild2 = (ASTPtRootNode) node.jjtGetChild(2);

        tokenChild1.visit(this);
        result += _childCode;

        //_fireCode.append(" : ");
        result += " : ";

        tokenChild2.visit(this);
        result += _childCode;

        _childCode = "(" + result + ")";

        ptolemy.data.Token token1 = _evaluatedChildToken;
View Full Code Here

Examples of ptolemy.data.expr.ASTPtRootNode

     @return The resulting token.
     *  @exception IllegalActionException If an parse error occurs.
     */
    protected ptolemy.data.Token _evaluateChild(ASTPtRootNode node, int i)
            throws IllegalActionException {
        ASTPtRootNode child = (ASTPtRootNode) node.jjtGetChild(i);
        _traceEnter(child);
        child.visit(this);
        _traceLeave(child);
        return _evaluatedChildToken;
    }
View Full Code Here

Examples of ptolemy.data.expr.ASTPtRootNode

                    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.ASTPtRootNode

                    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.ASTPtRootNode

     @param node The specified node.
     *  @exception IllegalActionException If an parse error occurs.
     */
    public void visitFunctionDefinitionNode(ASTPtFunctionDefinitionNode node)
            throws IllegalActionException {
        ASTPtRootNode cloneTree;

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

View Full Code Here

Examples of ptolemy.data.expr.ASTPtRootNode

         if (value) {
         */
        //_fireCode.append(" ? ");
        result += " ? ";

        ASTPtRootNode tokenChild1 = (ASTPtRootNode) node.jjtGetChild(1);
        ASTPtRootNode tokenChild2 = (ASTPtRootNode) node.jjtGetChild(2);

        tokenChild1.visit(this);
        result += _childCode;

        //_fireCode.append(" : ");
        result += " : ";

        tokenChild2.visit(this);
        result += _childCode;

        _childCode = "(" + result + ")";

        ptolemy.data.Token token1 = _evaluatedChildToken;
View Full Code Here

Examples of ptolemy.data.expr.ASTPtRootNode

     @return The resulting token.
     *  @exception IllegalActionException If an parse error occurs.
     */
    protected ptolemy.data.Token _evaluateChild(ASTPtRootNode node, int i)
            throws IllegalActionException {
        ASTPtRootNode child = (ASTPtRootNode) node.jjtGetChild(i);
        _traceEnter(child);
        child.visit(this);
        _traceLeave(child);
        return _evaluatedChildToken;
    }
View Full Code Here

Examples of ptolemy.data.expr.ASTPtRootNode

            Transition transition = (Transition) transitions.next();

            // generate code for guard expression
            String guard = transition.getGuardExpression();
            PtParser parser = new PtParser();
            ASTPtRootNode guardParseTree = parser.generateParseTree(guard);
            ParseTreeCodeGenerator parseTreeCodeGenerator = controllerHelper
                    .getParseTreeCodeGenerator();
            parseTreeCodeGenerator.evaluateParseTree(guardParseTree,
                    controllerHelper._scope);
            codeBuffer.append(parseTreeCodeGenerator.generateFireCode());
            codeBuffer.append(") {" + _eol);

            // generate code for commit action
            Iterator actions = transition.commitActionList().iterator();
            while (actions.hasNext()) {
                AbstractActionsAttribute action = (AbstractActionsAttribute) actions
                        .next();
                Iterator destinationNameList = action.getDestinationNameList()
                        .iterator();

                while (destinationNameList.hasNext()) {
                    String destinationName = (String) destinationNameList
                            .next();
                    NamedObj destination = action
                            .getDestination(destinationName);
                    ASTPtRootNode parseTree = action
                            .getParseTree(destinationName);
                    if (destination instanceof Variable) {
                        codeBuffer.append(_codeGenerator
                                .generateVariableName((Variable) destination)
                                + " = ");
View Full Code Here

Examples of ptolemy.data.expr.ASTPtRootNode

        return _value;
    }

    public Token getToken() throws IllegalActionException {
        if (_needReparse) {
            ASTPtRootNode tree = _TYPE_PARSER.generateParseTree(_value);
            _token = _TYPE_EVALUATOR.evaluateParseTree(tree, _variableScope);
            _needReparse = false;
        }
        return _token;
    }
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.