Package com.gengoai.parsing
Class BinaryInfixOperatorExpression
- java.lang.Object
-
- com.gengoai.parsing.BaseExpression
-
- com.gengoai.parsing.BinaryInfixOperatorExpression
-
- All Implemented Interfaces:
Expression
,Serializable
public class BinaryInfixOperatorExpression extends BaseExpression
AnExpression
representing a binary operation, eg. plus, minus, etc.- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static PostfixHandler
HANDLER
Generic Handler for generatingBinaryInfixOperatorExpression
s for infix operators usingParser.parseExpression()
to generate the right-hand value of the operator.static PostfixHandler
RIGHT_ASSOCIATIVE_HANDLER
-
Constructor Summary
Constructors Constructor Description BinaryInfixOperatorExpression(ParserToken token, Expression left, Expression right)
Instantiates a new BinaryInfixOperatorExpression.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Expression
getLeft()
Gets the left-hand expressionString
getOperator()
Gets the operator.Expression
getRight()
Gets the right-hand expression.String
toString()
-
Methods inherited from class com.gengoai.parsing.BaseExpression
getType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.gengoai.parsing.Expression
apply, as, isInstance, isInstance, isInstance, when, when
-
-
-
-
Field Detail
-
HANDLER
public static PostfixHandler HANDLER
Generic Handler for generatingBinaryInfixOperatorExpression
s for infix operators usingParser.parseExpression()
to generate the right-hand value of the operator.
-
RIGHT_ASSOCIATIVE_HANDLER
public static PostfixHandler RIGHT_ASSOCIATIVE_HANDLER
-
-
Constructor Detail
-
BinaryInfixOperatorExpression
public BinaryInfixOperatorExpression(ParserToken token, Expression left, Expression right)
Instantiates a new BinaryInfixOperatorExpression.- Parameters:
token
- the token representing the operatorleft
- the left-hand expressionright
- the right-hand expression
-
-
Method Detail
-
getLeft
public Expression getLeft()
Gets the left-hand expression- Returns:
- the left-hand expression
-
getOperator
public String getOperator()
Gets the operator.- Returns:
- the operator
-
getRight
public Expression getRight()
Gets the right-hand expression.- Returns:
- the right-hand expression.
-
-