Package oracle.rules.sdk2.ruleset
Class ExprParser
java.lang.Object
oracle.rules.sdk2.ruleset.ExprParser
Scans an input expression string, and if successful, parses the string.
Creates an ordered array of
Tokens
. Determines
which token the cursor is in. Analyzes the expression to determine if
it will yield the correct type.
TODO: reorg so there is one constructor and various getters that scan/parse/analyze on demand as needed, so user is shielded from knowing how much analysis is needed for a particular getter (like getResultType v. getValue)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Token represents a lexeme in a parsed expression. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExprParser
Deprecated.used for testing onlyboolean
hasError()
static boolean
higherPrecedence
(String op1, String op2) Determine whether op1 has higher precedence than op2.void
Force invalidation of this expression parserstatic boolean
isCalendar
(DOID typeID) static ExprParser
usageOnly
(ExprParser parser, RuleComponent parent)
-
Field Details
-
TOKEN_TYPE_OPERAND
public static final int TOKEN_TYPE_OPERAND- See Also:
-
TOKEN_IDENTIFIER
public static final int TOKEN_IDENTIFIER- See Also:
-
TOKEN_FUNCTION
public static final int TOKEN_FUNCTION- See Also:
-
TOKEN_CONSTRUCTOR
public static final int TOKEN_CONSTRUCTOR- See Also:
-
TOKEN_NUMBER
public static final int TOKEN_NUMBER- See Also:
-
TOKEN_STRINGLIT
public static final int TOKEN_STRINGLIT- See Also:
-
TOKEN_CHARLIT
public static final int TOKEN_CHARLIT- See Also:
-
TOKEN_BOOLEAN_CONSTANT
public static final int TOKEN_BOOLEAN_CONSTANT- See Also:
-
TOKEN_NULL
public static final int TOKEN_NULL- See Also:
-
TOKEN_TYPE_OP
public static final int TOKEN_TYPE_OP- See Also:
-
TOKEN_LPAREN
public static final int TOKEN_LPAREN- See Also:
-
TOKEN_RPAREN
public static final int TOKEN_RPAREN- See Also:
-
TOKEN_BINARYOP
public static final int TOKEN_BINARYOP- See Also:
-
TOKEN_PRE_UNARYOP
public static final int TOKEN_PRE_UNARYOP- See Also:
-
TOKEN_UNARY_OR_BINARY_OP
public static final int TOKEN_UNARY_OR_BINARY_OP- See Also:
-
TOKEN_LBRACKET
public static final int TOKEN_LBRACKET- See Also:
-
TOKEN_RBRACKET
public static final int TOKEN_RBRACKET- See Also:
-
TOKEN_TYPE_UNKNOWN
public static final int TOKEN_TYPE_UNKNOWN- See Also:
-
TOKEN_UNKNOWN
public static final int TOKEN_UNKNOWN- See Also:
-
-
Method Details
-
usageOnly
-
getParser
Deprecated.used for testing only -
hasError
public boolean hasError() -
getResultID
-
getReferences
-
higherPrecedence
Determine whether op1 has higher precedence than op2. E.g., "*" has higher precedence than "+".- Parameters:
op1
-op2
-- Returns:
-
isCalendar
-
getTokens
-
getConcatTokens
-
invalidate
public void invalidate()Force invalidation of this expression parser
-