Examples of JCTree


Examples of com.sun.tools.javac.tree.JCTree

    }

    /** Find the position for reporting an error about a symbol, where
     *  that symbol is defined somewhere in the given tree. */
    public static int positionFor(final Symbol sym, final JCTree tree) {
        JCTree decl = declarationFor(sym, tree);
        return ((decl != null) ? decl : tree).pos;
    }
View Full Code Here

Examples of com.sun.tools.javac.tree.JCTree

    }

    /** Find the position for reporting an error about a symbol, where
     *  that symbol is defined somewhere in the given tree. */
    public static DiagnosticPosition diagnosticPositionFor(final Symbol sym, final JCTree tree) {
        JCTree decl = declarationFor(sym, tree);
        return ((decl != null) ? decl : tree).pos();
    }
View Full Code Here

Examples of com.sun.tools.javac.tree.JCTree

    /** Return the statement referenced by a label.
     *  If the label refers to a loop or switch, return that switch
     *  otherwise return the labelled statement itself
     */
    public static JCTree referencedStatement(JCLabeledStatement tree) {
        JCTree t = tree;
        do t = ((JCLabeledStatement) t).body;
        while (t.getTag() == JCTree.LABELLED);
        switch (t.getTag()) {
        case JCTree.DOLOOP: case JCTree.WHILELOOP: case JCTree.FORLOOP: case JCTree.FOREACHLOOP: case JCTree.SWITCH:
            return t;
        default:
            return tree;
        }
View Full Code Here

Examples of com.sun.tools.javac.tree.JCTree

    public <T extends JCTree> T translate(T tree) {
        if (tree == null) {
            return null;
        } else {
            tree.accept(this);
            JCTree result = this.result;
            this.result = null;
            return (T)result; // XXX cast
        }
    }
View Full Code Here

Examples of com.sun.tools.javac.tree.JCTree

    // where
        /** Add any variables defined in stats to inits and uninits. */
        private static void addVars(List<JCStatement> stats, Bits inits,
                                    Bits uninits) {
            for (;stats.nonEmpty(); stats = stats.tail) {
                JCTree stat = stats.head;
                if (stat.getTag() == JCTree.VARDEF) {
                    int adr = ((JCVariableDecl) stat).sym.adr;
                    inits.excl(adr);
                    uninits.incl(adr);
                }
            }
View Full Code Here

Examples of com.sun.tools.javac.tree.JCTree

        inits = initsExit;
        uninits = uninitsExit;
    }

    public void visitAssign(JCAssign tree) {
        JCTree lhs = TreeInfo.skipParens(tree.lhs);
        if (!(lhs instanceof JCIdent)) scanExpr(lhs);
        scanExpr(tree.rhs);
        letInit(lhs);
    }
View Full Code Here

Examples of com.sun.tools.javac.tree.JCTree

    /** Perform definite assignment/unassignment analysis on a tree.
     */
    public void analyzeTree(Env<AttrContext> env, TreeMaker make) {
        try {
            attrEnv = env;
            JCTree tree = env.tree;
            this.make = make;
            inits = new Bits();
            uninits = new Bits();
            uninitsTry = new Bits();
            initsWhenTrue = initsWhenFalse =
View Full Code Here

Examples of com.sun.tools.javac.tree.JCTree

        memberEnter(tree.defs, env);
    }

    // process the non-static imports and the static imports of types.
    public void visitImport(JCImport tree) {
        JCTree imp = tree.qualid;
        Name name = TreeInfo.name(imp);
        TypeSymbol p;

        // Create a local environment pointing to this tree to disable
        // effects of other imports in Resolve.findGlobalType
View Full Code Here

Examples of com.sun.tools.javac.tree.JCTree

                            based = true;
                        }
                        thrown = superConstrType.getThrownTypes();
                    }
                }
                JCTree constrDef = DefaultConstructor(make.at(tree.pos), c,
                                                    typarams, argtypes, thrown,
                                                    ctorFlags, based);
                tree.defs = tree.defs.prepend(constrDef);
            }
View Full Code Here

Examples of com.sun.tools.javac.tree.JCTree

            // constructors of true enums are private
            flags = (flags & ~AccessFlags) | PRIVATE | GENERATEDCONSTR;
        } else
            flags |= (c.flags() & AccessFlags) | GENERATEDCONSTR;
        if (c.name.isEmpty()) flags |= ANONCONSTR;
        JCTree result = make.MethodDef(
            make.Modifiers(flags),
            names.init,
            null,
            make.TypeParams(typarams),
            params,
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.