Package r.nodes.ast

Examples of r.nodes.ast.Sequence


        }
        if (parent instanceof Function) {
            return true;
        }
        if (parent instanceof Sequence) {
            Sequence parentSeq = (Sequence) parent;
            ASTNode[] exprs = parentSeq.getExprs();
            return (exprs[exprs.length - 1] == n) && isTrailingInAFunction(parentSeq);
        }
        if (parent instanceof If) {
            If parentIf = (If) parent;
            ASTNode trueBranch = parentIf.getTrueCase();
View Full Code Here


                    RNode truePart = null;
                    RNode returnCallArg = returnCallArgument(trueBranch);
                    if (returnCallArg != null) {
                        truePart = null;
                    } else if (trueBranch instanceof Sequence) {
                        Sequence trueSequence = (Sequence) trueBranch;
                        ASTNode[] trueExprs = trueSequence.getExprs();
                        if (trueExprs.length > 1) {
                            // FIXME: in theory we could be looking recursively into the tree, but recovery would then become hard
                            ASTNode lastTrueExpr = trueExprs[trueExprs.length - 1];
                            returnCallArg = returnCallArgument(lastTrueExpr);
                            if (returnCallArg != null) {
View Full Code Here

    public static ASTNode skipTrivialSequences(ASTNode astArg) {
        ASTNode ast = astArg;
        for (;;) {
            if (ast == null || !(ast instanceof Sequence)) { return ast; }
            Sequence s = (Sequence) ast;
            ASTNode[] exprs = s.getExprs();
            if (exprs.length != 1) { return ast; }
            ast = exprs[0];
        }
    }
View Full Code Here

TOP

Related Classes of r.nodes.ast.Sequence

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.