package de.bmoth.parser.ast;

import de.bmoth.parser.ast.nodes.*;

public abstract class AbstractVisitor<R, P> {

    public R visitPredicateNode(PredicateNode node, P expected) {
        if (node instanceof PredicateOperatorNode) {
            return visitPredicateOperatorNode((PredicateOperatorNode) node, expected);
        } else if (node instanceof PredicateOperatorWithExprArgsNode) {
            return visitPredicateOperatorWithExprArgs((PredicateOperatorWithExprArgsNode) node, expected);
        } else if (node instanceof IdentifierPredicateNode) {
            return visitIdentifierPredicateNode((IdentifierPredicateNode) node, expected);
        } else if (node instanceof QuantifiedPredicateNode) {
            return visitQuantifiedPredicateNode((QuantifiedPredicateNode) node, expected);
        }
        throw new AssertionError(node);
    }

    public R visitExprNode(ExprNode node, P expected) {
        if (node instanceof ExpressionOperatorNode) {
            return visitExprOperatorNode((ExpressionOperatorNode) node, expected);
        } else if (node instanceof IdentifierExprNode) {
            return visitIdentifierExprNode((IdentifierExprNode) node, expected);
        } else if (node instanceof NumberNode) {
            return visitNumberNode((NumberNode) node, expected);
        } else if (node instanceof QuantifiedExpressionNode) {
            return visitQuantifiedExpressionNode((QuantifiedExpressionNode) node, expected);
        } else if (node instanceof CastPredicateExpressionNode) {
            return visitCastPredicateExpressionNode((CastPredicateExpressionNode) node, expected);
        }
        throw new AssertionError();
    }

    public R visitSubstitutionNode(SubstitutionNode node, P expected) {
        if (node instanceof SelectSubstitutionNode) {
            return visitSelectSubstitutionNode((SelectSubstitutionNode) node, expected);
        } else if (node instanceof SingleAssignSubstitutionNode) {
            return visitSingleAssignSubstitution((SingleAssignSubstitutionNode) node, expected);
        } else if (node instanceof ParallelSubstitutionNode) {
            return visitParallelSubstitutionNode((ParallelSubstitutionNode) node, expected);
        } else if (node instanceof AnySubstitutionNode) {
            return visitAnySubstitution((AnySubstitutionNode) node, expected);
        }
        throw new AssertionError();
    }

    public abstract R visitPredicateOperatorNode(PredicateOperatorNode node, P expected);

    public abstract R visitPredicateOperatorWithExprArgs(PredicateOperatorWithExprArgsNode node, P expected);

    public abstract R visitExprOperatorNode(ExpressionOperatorNode node, P expected);

    public abstract R visitIdentifierExprNode(IdentifierExprNode node, P expected);

    public abstract R visitCastPredicateExpressionNode(CastPredicateExpressionNode node, P expected);

    public abstract R visitNumberNode(NumberNode node, P expected);

    public abstract R visitSelectSubstitutionNode(SelectSubstitutionNode node, P expected);

    public abstract R visitSingleAssignSubstitution(SingleAssignSubstitutionNode node, P expected);

    public abstract R visitAnySubstitution(AnySubstitutionNode node, P expected);

    public abstract R visitParallelSubstitutionNode(ParallelSubstitutionNode node, P expected);

    public abstract R visitIdentifierPredicateNode(IdentifierPredicateNode node, P expected);

    public abstract R visitQuantifiedExpressionNode(QuantifiedExpressionNode node, P expected);

    public abstract R visitQuantifiedPredicateNode(QuantifiedPredicateNode node, P expected);
}

@@ -71,22 +71,17 @@
 lic 
-abstract class
+interface
  Abs
@@ -102,30 +102,31 @@
 , P%3E %7B%0A%0A    
-public
+default
  R visitPred
@@ -847,38 +847,39 @@
 de);%0A    %7D%0A%0A    
-public
+default
  R visitExprNode
@@ -1675,22 +1675,23 @@
  %7D%0A%0A    
-public
+default
  R visit
@@ -2401,32 +2401,16 @@
  %7D%0A%0A    
-public abstract 
 R visitP
@@ -2476,32 +2476,16 @@
 );%0A%0A    
-public abstract 
 R visitP
@@ -2571,32 +2571,16 @@
 );%0A%0A    
-public abstract 
 R visitE
@@ -2642,32 +2642,16 @@
 );%0A%0A    
-public abstract 
 R visitI
@@ -2711,32 +2711,16 @@
 );%0A%0A    
-public abstract 
 R visitC
@@ -2798,32 +2798,16 @@
 );%0A%0A    
-public abstract 
 R visitN
@@ -2851,32 +2851,16 @@
 );%0A%0A    
-public abstract 
 R visitS
@@ -2928,32 +2928,16 @@
 );%0A%0A    
-public abstract 
 R visitS
@@ -3013,32 +3013,16 @@
 );%0A%0A    
-public abstract 
 R visitA
@@ -3080,32 +3080,16 @@
 );%0A%0A    
-public abstract 
 R visitP
@@ -3161,32 +3161,16 @@
 );%0A%0A    
-public abstract 
 R visitI
@@ -3240,32 +3240,16 @@
 );%0A%0A    
-public abstract 
 R visitQ
@@ -3325,24 +3325,8 @@
     
-public abstract 
 R vi

use interface instead of abstract class