package accrue.analysis.interprocanalysis;

import java.util.Map;

import polyglot.ast.ArrayAccess;
import polyglot.ast.ArrayAccessAssign;
import polyglot.ast.ArrayInit;
import polyglot.ast.Assert;
import polyglot.ast.Assign;
import polyglot.ast.Binary;
import polyglot.ast.Block;
import polyglot.ast.Branch;
import polyglot.ast.Call;
import polyglot.ast.Cast;
import polyglot.ast.Catch;
import polyglot.ast.Conditional;
import polyglot.ast.ConstructorCall;
import polyglot.ast.ConstructorDecl;
import polyglot.ast.Do;
import polyglot.ast.Empty;
import polyglot.ast.Eval;
import polyglot.ast.Expr;
import polyglot.ast.Field;
import polyglot.ast.FieldAssign;
import polyglot.ast.FieldDecl;
import polyglot.ast.Formal;
import polyglot.ast.If;
import polyglot.ast.Initializer;
import polyglot.ast.Instanceof;
import polyglot.ast.Labeled;
import polyglot.ast.Lit;
import polyglot.ast.Local;
import polyglot.ast.LocalAssign;
import polyglot.ast.LocalDecl;
import polyglot.ast.MethodDecl;
import polyglot.ast.New;
import polyglot.ast.NewArray;
import polyglot.ast.Return;
import polyglot.ast.Special;
import polyglot.ast.Synchronized;
import polyglot.ast.Throw;
import polyglot.ast.Try;
import polyglot.ast.TypeNode;
import polyglot.ast.Unary;
import polyglot.ast.While;
import polyglot.visit.DataFlow;
import polyglot.visit.FlowGraph;
import polyglot.visit.FlowGraph.EdgeKey;
import polyglot.visit.FlowGraph.Peer;
import accrue.analysis.ast.Suppress;

public abstract class AbstractDataFlowDispatch<DFItem extends DataFlow.Item>
        implements DataFlowDispatch<DFItem> {

    @Override
    public Map<EdgeKey, DFItem> flowArrayAccess(ArrayAccess n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowExpr(n, dfIn, graph, peer);
    }

    @Override
    public Map<EdgeKey, DFItem> flowArrayAccessAssign(ArrayAccessAssign n,
            DFItem dfIn, FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowAssign(n, dfIn, graph, peer);
    }

    public Map<EdgeKey, DFItem> flowAssign(Assign n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowExpr(n, dfIn, graph, peer);
    }

    @Override
    public Map<EdgeKey, DFItem> flowArrayInit(ArrayInit n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowExpr(n, dfIn, graph, peer);
    }

    @Override
    public Map<EdgeKey, DFItem> flowAssert(Assert n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowBinary(Binary n, DFItem dfIn,
            DFItem trueItem, DFItem falseItem, FlowGraph<DFItem> graph,
            Peer<DFItem> peer) {
        return flowExpr(n, dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowBlock(Block n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowBranch(Branch n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowCall(Call n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowExpr(n, dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowCast(Cast n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowExpr(n, dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowCatch(Catch n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowConditional(Conditional n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowExpr(n, dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowConstructorCall(ConstructorCall n,
            DFItem dfIn, FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowConstructorDecl(ConstructorDecl n,
            DFItem dfIn, FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowDo(Do n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowEmpty(Empty n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowEval(Eval n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowExpr(Expr n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowField(Field n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowExpr(n, dfIn, graph, peer);
    }

    @Override
    public Map<EdgeKey, DFItem> flowFieldDecl(FieldDecl n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowFieldAssign(FieldAssign n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowAssign(n, dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowFormal(Formal n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);
    }

    @Override
    public Map<EdgeKey, DFItem> flowIf(If n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowInitializer(Initializer n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowInstanceof(Instanceof n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowExpr(n, dfIn, graph, peer);
    }

    @Override
    public Map<EdgeKey, DFItem> flowLabeled(Labeled n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowLit(Lit n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowExpr(n, dfIn, graph, peer);
    }

    @Override
    public Map<EdgeKey, DFItem> flowLocal(Local n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowExpr(n, dfIn, graph, peer);
    }

    @Override
    public Map<EdgeKey, DFItem> flowLocalAssign(LocalAssign n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowAssign(n, dfIn, graph, peer);
    }

    @Override
    public Map<EdgeKey, DFItem> flowLocalDecl(LocalDecl n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowMethodDecl(MethodDecl n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowNew(New n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowExpr(n, dfIn, graph, peer);
    }

    @Override
    public Map<EdgeKey, DFItem> flowNewArray(NewArray n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowExpr(n, dfIn, graph, peer);
    }

    @Override
    public Map<EdgeKey, DFItem> flowReturn(Return n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowSpecial(Special n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowExpr(n, dfIn, graph, peer);
    }

    @Override
    public Map<EdgeKey, DFItem> flowSuppress(Suppress n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return flowExpr(n, dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowSynchronized(Synchronized n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowThrow(Throw n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowTry(Try n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);

    }

    @Override
    public Map<EdgeKey, DFItem> flowFinally(Block n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);
    }

    @Override
    public Map<EdgeKey, DFItem> flowTypeNode(TypeNode n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);
    }

    @Override
    public Map<EdgeKey, DFItem> flowUnary(Unary n, DFItem dfIn,
            DFItem trueItem, DFItem falseItem, FlowGraph<DFItem> graph,
            Peer<DFItem> peer) {
        return flowExpr(n, dfIn, graph, peer);
    }

    @Override
    public Map<EdgeKey, DFItem> flowWhile(While n, DFItem dfIn,
            FlowGraph<DFItem> graph, Peer<DFItem> peer) {
        return ignoreNode(dfIn, graph, peer);
    }
}
