Package at.jku.ssw.fp.expr
Class Expr
- java.lang.Object
-
- at.jku.ssw.fp.expr.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Expr.And
Class representing and-expressions.(package private) static class
Expr.BinOp
Abstract base class for binary expressions.static class
Expr.Lit
Class representing literal expressions.static class
Expr.Not
Class representing not-expressions.static class
Expr.Or
Class representing or-expressions.static class
Expr.Var
The class representing variable expressions.
-
Constructor Summary
Constructors Constructor Description Expr()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Expr.And
mkAnd(Expr left, Expr right)
Returns an and-expression with a left and right subexpression.static Expr.Lit
mkLit(boolean value)
Creates an literal expression with a value.static Expr.Not
mkNot(Expr expr)
Creates an not-expression with a subexpression.static Expr.Or
mkOr(Expr left, Expr right)
Creates an or-expression with a left and right subexpression.static Expr.Var
mkVar(String name)
Creates an variable expression with a name.
-
-
-
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 subexpressionright
- 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 subexpressionright
- the right subexpression- Returns:
- the or-expression
-
-