All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.qbicc.graph.ActionVisitor Maven / Gradle / Ivy

There is a newer version: 0.77.0
Show newest version
package org.qbicc.graph;

/**
 * A visitor over a graph of non-value action nodes.  Non-value action nodes form a directed acyclic graph (DAG).
 */
public interface ActionVisitor {
    default R visitUnknown(T t, Action node) {
        return null;
    }

    default R visit(T t, BlockEntry node) {
        return visitUnknown(t, node);
    }

    default R visit(T t, InitCheck node) {
        return visitUnknown(t, node);
    }

    default R visit(T t, DebugAddressDeclaration node) {
        return visitUnknown(t, node);
    }

    default R visit(T t, DebugValueDeclaration node) {
        return visitUnknown(t, node);
    }

    default R visit(T t, Fence node) {
        return visitUnknown(t, node);
    }

    default R visit(T t, MonitorEnter node) {
        return visitUnknown(t, node);
    }

    default R visit(T t, MonitorExit node) {
        return visitUnknown(t, node);
    }

    default R visit(T t, Reachable node) {
        return visitUnknown(t, node);
    }

    default R visit(T t, SafePoint node) {
        return visitUnknown(t, node);
    }

    default R visit(T t, Store node) {
        return visitUnknown(t, node);
    }

    interface Delegating extends ActionVisitor {
        ActionVisitor getDelegateActionVisitor();

        default R visitUnknown(T t, Action node) {
            return node.accept(getDelegateActionVisitor(), t);
        }

        default R visit(T t, BlockEntry node) {
            return getDelegateActionVisitor().visit(t, node);
        }

        default R visit(T t, InitCheck node) {
            return getDelegateActionVisitor().visit(t, node);
        }

        default R visit(T t, DebugAddressDeclaration node) {
            return getDelegateActionVisitor().visit(t, node);
        }

        default R visit(T t, DebugValueDeclaration node) {
            return getDelegateActionVisitor().visit(t, node);
        }

        default R visit(T t, Fence node) {
            return getDelegateActionVisitor().visit(t, node);
        }

        default R visit(T t, MonitorEnter node) {
            return getDelegateActionVisitor().visit(t, node);
        }

        default R visit(T t, MonitorExit node) {
            return getDelegateActionVisitor().visit(t, node);
        }

        default R visit(T t, Reachable node) {
            return getDelegateActionVisitor().visit(t, node);
        }

        default R visit(T t, SafePoint node) {
            return getDelegateActionVisitor().visit(t, node);
        }

        default R visit(T t, Store node) {
            return getDelegateActionVisitor().visit(t, node);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy