public interface ExpressionObject
Modifier and Type | Field and Description |
---|---|
static int |
ATOM
This ExpressionObject is not an operator.
|
static int |
INFIX_OP
This ExpressionObject is an infix operator.
|
static int |
LEFT_ASSOC
This operator is left associativity.
|
static int |
MAX_PRECEDENCE
No ExpressionObject should return a precedence worse than this value.
|
static int |
NON_ASSOC
This operator is non-associative.
|
static int |
POSTFIX_OP
This ExpressionObject is a postfix operator.
|
static int |
PREFIX_OP
This ExpressionObject is a prefix operator.
|
static int |
RIGHT_ASSOC
This operator is right associative.
|
static int |
TERNARY_OP
This ExpressionObject is a ternary operator.
|
Modifier and Type | Method and Description |
---|---|
void |
addOperand(ExpressionObject e)
Adds an operand to this operator object.
|
int |
classify()
Returns the whether an ExpressionObject is an atom, a prefix operator,
an infix operator, or a postfix operator.
|
void |
closeOperator(java.lang.Object closingArgument)
Called after all operands have been added to allow post-processing.
|
int |
getAssociativity()
Returns the associativity of this operator according to the above
constants.
|
int |
getPrecedence()
Returns a positive number representing the precedence of this
ExpressionObject operator.
|
static final int ATOM
static final int PREFIX_OP
static final int INFIX_OP
static final int POSTFIX_OP
static final int TERNARY_OP
static final int MAX_PRECEDENCE
static final int LEFT_ASSOC
static final int NON_ASSOC
static final int RIGHT_ASSOC
int classify()
int getPrecedence()
int getAssociativity()
void addOperand(ExpressionObject e)
void closeOperator(java.lang.Object closingArgument)
closingArgument
- The closing argument passed to the ExpressionStack.