Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


oracle.javatools.parser.util
Interface ExpressionObject


public interface ExpressionObject

This is the ExpressionObject interface used by the ExpressionStack. See the ExpressionStack for details. During processing, the expression tree is built via the methods addOperand(...) and closeOperator(...) which are called on operator expressions. Only classify() should be called on the atom expressions.


Field Summary
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.

 

Method Summary
 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.

 

Field Detail

ATOM

static final int ATOM
This ExpressionObject is not an operator.
See Also:
Constant Field Values

PREFIX_OP

static final int PREFIX_OP
This ExpressionObject is a prefix operator. It takes one operand.
See Also:
Constant Field Values

INFIX_OP

static final int INFIX_OP
This ExpressionObject is an infix operator. It takes two operands. The operands will be added via addOperand() in order.
See Also:
Constant Field Values

POSTFIX_OP

static final int POSTFIX_OP
This ExpressionObject is a postfix operator. It takes one operand.
See Also:
Constant Field Values

TERNARY_OP

static final int TERNARY_OP
This ExpressionObject is a ternary operator. It takes three operands. The infix stream order should be "operand op operand operand".
See Also:
Constant Field Values

MAX_PRECEDENCE

static final int MAX_PRECEDENCE
No ExpressionObject should return a precedence worse than this value.
See Also:
Constant Field Values

LEFT_ASSOC

static final int LEFT_ASSOC
This operator is left associativity.
See Also:
Constant Field Values

NON_ASSOC

static final int NON_ASSOC
This operator is non-associative.
See Also:
Constant Field Values

RIGHT_ASSOC

static final int RIGHT_ASSOC
This operator is right associative.
See Also:
Constant Field Values

Method Detail

classify

int classify()
Returns the whether an ExpressionObject is an atom, a prefix operator, an infix operator, or a postfix operator.

getPrecedence

int getPrecedence()
Returns a positive number representing the precedence of this ExpressionObject operator. The smaller the value, the more tightly binding this operator is. No precedence should exceed MAX_PRECEDENCE. Prefix and postfix operators should not have the same precedence. If so, you may get an incorrect tree.

getAssociativity

int getAssociativity()
Returns the associativity of this operator according to the above constants. Any two operators that have the same precedence must also share the same associativity. If not, you may get an incorrect tree.

addOperand

void addOperand(ExpressionObject e)
Adds an operand to this operator object.

closeOperator

void closeOperator(java.lang.Object closingArgument)
Called after all operands have been added to allow post-processing.
Parameters:
closingArgument - The closing argument passed to the ExpressionStack.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


Copyright © 1997, 2011, Oracle. All rights reserved.