package accrue.analysis.preciseExceptions;

import polyglot.ast.ProcedureDecl;
import polyglot.types.SemanticException;
import accrue.AccrueExtensionInfo;
import accrue.analysis.AnalysisTopics;
import accrue.analysis.interprocanalysis.AnalysisFactory;
import accrue.analysis.interprocanalysis.AnalysisUnit;
import accrue.analysis.interprocanalysis.AnalysisUtil;
import accrue.analysis.interprocanalysis.WorkQueue;

public class PreciseExAnalysisFactory extends AnalysisFactory<PreciseExAbsVal> {
    public PreciseExAnalysisFactory(AccrueExtensionInfo extInfo) {
        super(extInfo);
    }

    public static final String ANALYSIS_NAME =
            "accrue.analysis.preciseExceptions";

    @Override
    public String analysisName() {
        return ANALYSIS_NAME;
    }

    @Override
    public String analysisReportName() {
        return AnalysisTopics.PRECISE_EX_ANALYSIS;
    }

    @Override
    public PreciseExAbsVal startItem(AnalysisUtil<PreciseExAbsVal> autil,
            ProcedureDecl startProc) throws SemanticException {
        // the DFIContext for main(String[] args)
        return PreciseExAbsVal.EMPTY;
    }

    @Override
    public AnalysisUtil<PreciseExAbsVal> analysisUtil(
            WorkQueue<PreciseExAbsVal> wq, AnalysisUnit aunit) {
        return new PreciseExAnalysisUtil(wq, aunit, extInfo);
    }

}
