Examples of AJCTree


Examples of joust.tree.annotatedtree.AJCTree

            AJCVariableDecl decl = null;
            // Find the declaration. Should be first.
            Iterator<AJCTree> usageIterator = fixableHere.iterator();
            while (usageIterator.hasNext()) {
                AJCTree usage = usageIterator.next();
                if (usage instanceof AJCVariableDecl) {
                    decl = (AJCVariableDecl) usage;
                    usageIterator.remove();
                    break;
                }
            }

            if (decl == null) {
                log.fatal("Unable to find decl for {}!", sym);
                return;
            }

            UnboxMapper mapper = new UnboxMapper(sym);

            // Fix up all usages, including the init...
            for (AJCTree usage : fixableHere) {
                AJCForest.getInstance().increment("Boxed Usages Removed:");
                log.info("Fixing usage: {}", usage);
                AJCTree replacement = mapper.replacementTree(usage);
                log.info("Swapping {} for {}", usage, replacement);
                log.debug("Parent: {}:{}", usage.mParentNode, usage.mParentNode.getClass().getCanonicalName());
                usage.swapFor(replacement);
            }
View Full Code Here

Examples of joust.tree.annotatedtree.AJCTree

            AJCVariableDecl decl = null;
            // Find the declaration. Should be first.
            Iterator<AJCTree> usageIterator = fixableHere.iterator();
            while (usageIterator.hasNext()) {
                AJCTree usage = usageIterator.next();
                if (usage instanceof AJCVariableDecl) {
                    decl = (AJCVariableDecl) usage;
                    usageIterator.remove();
                    break;
                }
            }

            if (decl == null) {
                log.fatal("Unable to find decl for {}!", sym);
                return;
            }

            UnboxMapper mapper = new UnboxMapper(sym);

            // Fix up all usages, including the init...
            for (AJCTree usage : fixableHere) {
                AJCForest.getInstance().increment("Boxed Usages Removed:");
                log.info("Fixing usage: {}", usage);
                AJCTree replacement = mapper.replacementTree(usage);
                log.info("Swapping {} for {}", usage, replacement);
                log.debug("Parent: {}:{}", usage.mParentNode, usage.mParentNode.getClass().getCanonicalName());
                usage.swapFor(replacement);
            }
View Full Code Here

Examples of joust.tree.annotatedtree.AJCTree

    public void visitBinary(AJCBinary binary) {
        super.visitBinary(binary);
        if (TreeUtils.operatorIsCommutative(binary.getTag())) {
            CommutativitySorter sorter = new CommutativitySorter(binary);
            log.debug("Commutativity sorter running on: {}", binary);
            AJCTree result = sorter.process();
            binary.swapFor(result);

            log.debug("Commutativity sorter returned: {}", result);
        }
    }
View Full Code Here

Examples of joust.tree.annotatedtree.AJCTree

    public void visitBinary(AJCBinary binary) {
        super.visitBinary(binary);
        if (TreeUtils.operatorIsCommutative(binary.getTag())) {
            CommutativitySorter sorter = new CommutativitySorter(binary);
            log.debug("Commutativity sorter running on: {}", binary);
            AJCTree result = sorter.process();
            binary.swapFor(result);

            log.debug("Commutativity sorter returned: {}", result);
        }
    }
View Full Code Here

Examples of joust.tree.annotatedtree.AJCTree

    /**
     * Extract the final result from the converter after all processing has been completed.
     * The input tree must be fed to this scanner before calling this for the result to be a victory...
     */
    public AJCTree getResult() {
        AJCTree result =  results.pop();
        if (!results.isEmpty()) {
            log.fatal("Failed to convert input tree. Result remaining: " + results.pop() + " and " + results.size() + " more.");
        }

        return result;
View Full Code Here

Examples of joust.tree.annotatedtree.AJCTree

                    continue;
                }

                log.debug("Field {} : {}", fieldName, fieldType.getCanonicalName());
                if (!"com.sun.tools.javac.util.List".equals(fieldType.getCanonicalName())) {
                    AJCTree value = results.pop();
                    log.debug("Assigning: {}:{}", value, value.getClass().getCanonicalName());
                    value.mParentNode = destinationTree;
                    destField.set(destinationTree, value);
                    continue;
                }
View Full Code Here

Examples of joust.tree.annotatedtree.AJCTree

    }

    private List<AJCTree> listFromIntermediatesWithParent(int length, AJCTree parent) {
        List<AJCTree> list = List.nil();
        while (length > 0) {
            AJCTree value = results.pop();
            value.mParentNode = parent;
            list = list.prepend(value);
            length--;
        }
View Full Code Here

Examples of joust.tree.annotatedtree.AJCTree

        List<AJCMethodDecl> methodDefs = List.nil();
        List<AJCClassDecl> classDefs = List.nil();

        int requiredDefs = jcClassDecl.defs.size();
        while (requiredDefs > 0) {
            AJCTree decl = results.pop();
            if (decl instanceof AJCVariableDecl) {
                varDefs = varDefs.prepend((AJCVariableDecl) decl);
            } else if (decl instanceof AJCMethodDecl) {
                methodDefs = methodDefs.prepend((AJCMethodDecl) decl);
            } else if (decl instanceof AJCClassDecl) {
View Full Code Here

Examples of joust.tree.annotatedtree.AJCTree

    /**
     * Extract the final result from the converter after all processing has been completed.
     * The input tree must be fed to this scanner before calling this for the result to be a victory...
     */
    public AJCTree getResult() {
        AJCTree result =  results.pop();
        if (!results.isEmpty()) {
            log.fatal("Failed to convert input tree. Result remaining: " + results.pop() + " and " + results.size() + " more.");
        }

        return result;
View Full Code Here

Examples of joust.tree.annotatedtree.AJCTree

                    continue;
                }

                log.debug("Field {} : {}", fieldName, fieldType.getCanonicalName());
                if (!"com.sun.tools.javac.util.List".equals(fieldType.getCanonicalName())) {
                    AJCTree value = results.pop();
                    log.debug("Assigning: {}:{}", value, value.getClass().getCanonicalName());
                    value.mParentNode = destinationTree;
                    destField.set(destinationTree, value);
                    continue;
                }
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.