Package tests.unittests.utils

Source Code of tests.unittests.utils.VisitorResultPurger

package tests.unittests.utils;

import joust.analysers.sideeffects.Effects;
import joust.tree.annotatedtree.AJCTree;
import joust.tree.annotatedtree.AJCTreeVisitor;
import joust.tree.annotatedtree.treeinfo.EffectSet;

import static joust.tree.annotatedtree.AJCTree.*;

/**
* A tree visitor to strip the results of analysis from all tree nodes, ready for the next test run.
*/
public class VisitorResultPurger extends AJCTreeVisitor {
    @Override
    public void visit(AJCTree that) {
        if (that instanceof AJCEffectAnnotatedTree) {
            AJCEffectAnnotatedTree cast = (AJCEffectAnnotatedTree) that;
            cast.effects = new Effects(EffectSet.ALL_EFFECTS);
            cast.liveVariables = null;
        }

        super.visit(that);
    }
}
TOP

Related Classes of tests.unittests.utils.VisitorResultPurger

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.