public class Operators
extends java.lang.Object
| Constructor and Description |
|---|
Operators() |
| Modifier and Type | Method and Description |
|---|---|
static Primitives.BooleanExpression |
and(Node left,
Node right)
'
&' or 'and' logical and operator |
static Node |
division(Node left,
Node right)
'
/' division operator |
static Primitives.BooleanExpression |
equal(Node left,
Node right)
'
=' equal operator |
static Primitives.BooleanExpression |
greaterEqual(Node left,
Node right)
'
>=' greater equal operator |
static Primitives.BooleanExpression |
greaterThan(Node left,
Node right)
'
>' greater than operator |
static Primitives.BooleanExpression |
is(Node left,
Node right)
'
is' is operator (to check for string equality) |
static Primitives.BooleanExpression |
lessEqual(Node left,
Node right)
'
<=' less equal operator |
static Primitives.BooleanExpression |
lessThan(Node left,
Node right)
'
<' less than operator |
static Node |
minus(Node left,
Node right)
'
-' minus operator |
static Primitives.BooleanExpression |
not(Node expr)
'
!' or 'not' logical not operator |
static Primitives.BooleanExpression |
or(Node left,
Node right)
'
|' or 'or' logical or operator |
static Node |
plus(Node left,
Node right)
'
+' plus operator |
static Node |
pow(Node left,
Node right)
'
^' power operator |
static Primitives.BooleanExpression |
regexp(Node left,
Node right)
'
regexp' regexp operator (to check for string matching a given
regular expression) |
static Node |
times(Node left,
Node right)
'
*' times operator |
static Node |
uminus(Node expr)
'
-' unary minus operator |
static Node |
uplus(Node expr)
'
+' unary plus operator |
public static Node plus(Node left, Node right) throws SemanticException
+' plus operatorSemanticExceptionpublic static Node minus(Node left, Node right) throws SemanticException
-' minus operatorSemanticExceptionpublic static Node times(Node left, Node right) throws SemanticException
*' times operatorSemanticExceptionpublic static Node division(Node left, Node right) throws SemanticException
/' division operatorSemanticExceptionpublic static Node uplus(Node expr) throws SemanticException
+' unary plus operatorSemanticExceptionpublic static Node uminus(Node expr) throws SemanticException
-' unary minus operatorSemanticExceptionpublic static Node pow(Node left, Node right) throws SemanticException
^' power operatorSemanticExceptionpublic static Primitives.BooleanExpression lessThan(Node left, Node right) throws SemanticException
<' less than operatorSemanticExceptionpublic static Primitives.BooleanExpression lessEqual(Node left, Node right) throws SemanticException
<=' less equal operatorSemanticExceptionpublic static Primitives.BooleanExpression greaterThan(Node left, Node right) throws SemanticException
>' greater than operatorSemanticExceptionpublic static Primitives.BooleanExpression greaterEqual(Node left, Node right) throws SemanticException
>=' greater equal operatorSemanticExceptionpublic static Primitives.BooleanExpression equal(Node left, Node right) throws SemanticException
=' equal operatorSemanticExceptionpublic static Primitives.BooleanExpression not(Node expr) throws SemanticException
!' or 'not' logical not operatorSemanticExceptionpublic static Primitives.BooleanExpression and(Node left, Node right) throws SemanticException
&' or 'and' logical and operatorSemanticExceptionpublic static Primitives.BooleanExpression or(Node left, Node right) throws SemanticException
|' or 'or' logical or operatorSemanticExceptionpublic static Primitives.BooleanExpression is(Node left, Node right) throws SemanticException
is' is operator (to check for string equality)SemanticExceptionpublic static Primitives.BooleanExpression regexp(Node left, Node right) throws SemanticException
regexp' regexp operator (to check for string matching a given
regular expression)SemanticException