Class Expr

  • Direct Known Subclasses:
    Expr.BinOp, Expr.Lit, Expr.Not, Expr.Var

    public abstract class Expr
    extends Object
    Abstract base class of Boolean expressions. Contains static factory methods for creating the various Boolean expressions.
    Author:
    Herbert Praehofer
    • Constructor Detail

      • Expr

        public Expr()
    • Method Detail

      • mkLit

        public static Expr.Lit mkLit​(boolean value)
        Creates an literal expression with a value.
        Parameters:
        value - the Boolean value of the literal
        Returns:
        the literal expression
      • mkVar

        public static Expr.Var mkVar​(String name)
        Creates an variable expression with a name.
        Parameters:
        name - the variable name
        Returns:
        the variable expression
      • mkAnd

        public static Expr.And mkAnd​(Expr left,
                                     Expr right)
        Returns an and-expression with a left and right subexpression.
        Parameters:
        left - the left subexpression
        right - the right subexpression
        Returns:
        the and-expression
      • mkOr

        public static Expr.Or mkOr​(Expr left,
                                   Expr right)
        Creates an or-expression with a left and right subexpression.
        Parameters:
        left - the left subexpression
        right - the right subexpression
        Returns:
        the or-expression
      • mkNot

        public static Expr.Not mkNot​(Expr expr)
        Creates an not-expression with a subexpression.
        Parameters:
        expr - the subexpression
        Returns:
        the not-expression
      • accept

        public abstract <R> R accept​(Visitor<R> v)
        Accepts a visitor.
        Type Parameters:
        R - the type of the return value of the visitor.
        Parameters:
        v - the visitor
        Returns:
        the return value