public class Optimizer extends antlr.TreeParser implements OptimizerTokenTypes
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
_tokenNames |
protected ErrorMsg |
errorMsg
The error message support class.
|
protected static org.apache.jdo.util.I18NHelper |
msg
I18N support
|
protected boolean |
optimizeParameters
Flag indicating whether query parameers should be included.
|
protected ParameterTable |
paramtab
The query parameter table
|
protected org.apache.jdo.pm.PersistenceManagerInternal |
pm
The persistence manager of the query instance.
|
_retTree, astFactory, ASTNULL, inputState, returnAST, tokenNames, traceDepth
AND, ARG_LIST, ASCENDING, ASSIGN, BAND, BAND_ASSIGN, BNOT, BOOLEAN, BOOLEAN_LITERAL, BOR, BOR_ASSIGN, BYTE, BYTE_LITERAL, CANDIDATE_CLASS, CAST, CHAR, CHAR_LITERAL, COLLECTION_EQUAL, COLLECTION_NOT_EQUAL, COMMA, CONCAT, CONSTANT, CONTAINS, DEC, DESCENDING, DIV, DIV_ASSIGN, DOT, DOUBLE, DOUBLE_LITERAL, ENDS_WITH, EOF, EQUAL, ESC, EXPONENT, FALSE, FIELD_ACCESS, FLOAT, FLOAT_LITERAL, FLOATINGPOINT_SUFFIX, GE, GT, HEX_DIGIT, IDENT, IMPORT, IMPORT_ON_DEMAND, INC, INT, INT_LITERAL, IS_EMPTY, LE, LNOT, LONG, LONG_LITERAL, LPAREN, LT, MINUS, MINUS_ASSIGN, NAVIGATION, NEWLINE, NOT_EQUAL, NULL, NULL_TREE_LOOKAHEAD, OBJECT_EQUAL, OBJECT_NOT_EQUAL, OR, PARAMETER_ACCESS, PARAMETER_DECL, PLUS, PLUS_ASSIGN, QUERY_TREE, RPAREN, SEMI, SHORT, SHORT_LITERAL, SL, SR, STAR, STAR_ASSIGN, STARTS_WITH, STATIC_FIELD_ACCESS, STRING_LITERAL, THIS, TRUE, TYPE, UNARY_MINUS, UNARY_PLUS, UNICODE_CHAR, UNICODE_ESCAPE, VARIABLE_ACCESS, VARIABLE_DECL, WS
Constructor and Description |
---|
Optimizer() |
Modifier and Type | Method and Description |
---|---|
void |
binaryArithmeticExpr(antlr.collections.AST _t) |
void |
bitwiseExpr(antlr.collections.AST _t) |
void |
candidateClass(antlr.collections.AST _t) |
protected JDOQLAST |
checkAnd(JDOQLAST op,
JDOQLAST left,
JDOQLAST right)
Check an AND operation (BAND, AND) for constant operands
that could be optimized.
|
protected JDOQLAST |
checkBinaryMinusOp(JDOQLAST op,
JDOQLAST left,
JDOQLAST right)
Check a binary minus operation (MINUS) for constant operands
that could be optimized.
|
protected JDOQLAST |
checkBinaryPlusOp(JDOQLAST op,
JDOQLAST left,
JDOQLAST right)
Check a binary plus operation (PLUS) for constant operands
that could be optimized.
|
protected JDOQLAST |
checkCollectionEqualityOp(JDOQLAST op,
JDOQLAST left,
JDOQLAST right,
boolean negate)
Check a collection equality operation (COLLECTION_EQUAL,
COLLECTION_NOT_EQUAL) for constant operands that could be optimized.
|
protected JDOQLAST |
checkConcatOp(JDOQLAST op,
JDOQLAST left,
JDOQLAST right)
Check a string concatenation operation (CONCAT) for constant operands
that could be optimized.
|
protected JDOQLAST |
checkDivisionOp(JDOQLAST op,
JDOQLAST left,
JDOQLAST right)
Check a binary division operation (DIV) for constant operands
that could be optimized.
|
protected JDOQLAST |
checkEqualityOp(JDOQLAST op,
JDOQLAST left,
JDOQLAST right,
boolean negate)
Check a equality operation (EQUAL, NOT_EQUAL) for constant operands
that could be optimized.
|
protected JDOQLAST |
checkLogicalNotOp(JDOQLAST op,
JDOQLAST arg)
Check a logical not operation (LNOT) for a constant operand
that could be optimized.
|
protected JDOQLAST |
checkMultiplicationOp(JDOQLAST op,
JDOQLAST left,
JDOQLAST right)
Check a binary multiplication operation (STAR) for constant operands
that could be optimized.
|
protected JDOQLAST |
checkObjectEqualityOp(JDOQLAST op,
JDOQLAST left,
JDOQLAST right,
boolean negate)
Check a object equality operation (OBJECT_EQUAL, OBJECT_NOT_EQUAL)
for constant operands that could be optimized.
|
protected JDOQLAST |
checkOr(JDOQLAST op,
JDOQLAST left,
JDOQLAST right)
Check an OR operation (BOR, OR) for constant operands
that could be optimized.
|
protected JDOQLAST |
checkUnaryMinusOp(JDOQLAST op,
JDOQLAST arg)
Check a unary minus operation (UNARY_MINUS) for a constant operand
that could be optimized.
|
void |
complementExpr(antlr.collections.AST _t) |
void |
conditionalExpr(antlr.collections.AST _t) |
void |
contains(antlr.collections.AST _t) |
void |
declareParameter(antlr.collections.AST _t) |
void |
declareVariable(antlr.collections.AST _t) |
void |
endsWith(antlr.collections.AST _t) |
void |
expression(antlr.collections.AST _t) |
void |
fieldAccess(antlr.collections.AST _t) |
void |
filter(antlr.collections.AST _t) |
protected java.math.BigDecimal |
getBigDecimalValue(java.lang.Object value)
Converts the specified value into a BigDecimal value.
|
protected java.math.BigInteger |
getBigIntegerValue(java.lang.Object value)
Converts the specified value into a BigInteger value.
|
protected JDOQLAST |
handleValueEqValue(JDOQLAST op,
JDOQLAST left,
JDOQLAST right,
boolean negate)
This method is called in the case of an equality operation having two
constant operands.
|
void |
init(org.apache.jdo.pm.PersistenceManagerInternal pm,
ParameterTable paramtab,
ErrorMsg errorMsg) |
void |
integralLiteral(antlr.collections.AST _t,
boolean negate) |
protected boolean |
isBooleanValueAST(JDOQLAST ast)
Returns true if the specified AST represents a constant boolean value.
|
void |
isEmpty(antlr.collections.AST _t) |
void |
literal(antlr.collections.AST _t) |
void |
navigation(antlr.collections.AST _t) |
void |
ordering(antlr.collections.AST _t) |
void |
orderSpec(antlr.collections.AST _t) |
void |
parameterAccess(antlr.collections.AST _t) |
void |
parameters(antlr.collections.AST _t) |
protected static char |
parseChar(java.lang.String text)
Converts the string argument into a single char.
|
void |
primary(antlr.collections.AST _t) |
void |
query(antlr.collections.AST _t) |
void |
relationalExpr(antlr.collections.AST _t) |
void |
reportError(antlr.RecognitionException ex) |
void |
reportError(java.lang.String s) |
void |
startsWith(antlr.collections.AST _t) |
void |
staticFieldAccess(antlr.collections.AST _t) |
void |
unaryArithmeticExpr(antlr.collections.AST _t) |
void |
variableAccess(antlr.collections.AST _t) |
void |
variables(antlr.collections.AST _t) |
protected org.apache.jdo.pm.PersistenceManagerInternal pm
protected ErrorMsg errorMsg
protected ParameterTable paramtab
protected boolean optimizeParameters
protected static final org.apache.jdo.util.I18NHelper msg
public static final java.lang.String[] _tokenNames
public void init(org.apache.jdo.pm.PersistenceManagerInternal pm, ParameterTable paramtab, ErrorMsg errorMsg)
public void reportError(antlr.RecognitionException ex)
reportError
in class antlr.TreeParser
public void reportError(java.lang.String s)
reportError
in class antlr.TreeParser
protected static char parseChar(java.lang.String text)
protected JDOQLAST checkAnd(JDOQLAST op, JDOQLAST left, JDOQLAST right)
op
- the AND operatorleft
- the left operandright
- the right operandprotected JDOQLAST checkOr(JDOQLAST op, JDOQLAST left, JDOQLAST right)
op
- the OR operatorleft
- the left operandright
- the right operandprotected JDOQLAST checkEqualityOp(JDOQLAST op, JDOQLAST left, JDOQLAST right, boolean negate)
op
- the equality operatorleft
- the left operandright
- the right operandnegate
- true for not equal operation, false otherwiseprotected JDOQLAST checkObjectEqualityOp(JDOQLAST op, JDOQLAST left, JDOQLAST right, boolean negate)
op
- the object equality operatorleft
- the left operandright
- the right operandnegate
- true for not equal operation, false otherwiseprotected JDOQLAST checkCollectionEqualityOp(JDOQLAST op, JDOQLAST left, JDOQLAST right, boolean negate)
op
- the collection equality operatorleft
- the left operandright
- the right operandnegate
- true for not equal operation, false otherwiseprotected JDOQLAST checkLogicalNotOp(JDOQLAST op, JDOQLAST arg)
op
- the logical not operatorarg
- the operandprotected JDOQLAST checkBinaryPlusOp(JDOQLAST op, JDOQLAST left, JDOQLAST right)
op
- the plus operatorleft
- the left operandright
- the right operandprotected JDOQLAST checkConcatOp(JDOQLAST op, JDOQLAST left, JDOQLAST right)
op
- the concat operatorleft
- the left operandright
- the right operandprotected JDOQLAST checkBinaryMinusOp(JDOQLAST op, JDOQLAST left, JDOQLAST right)
op
- the minus operatorleft
- the left operandright
- the right operandprotected JDOQLAST checkMultiplicationOp(JDOQLAST op, JDOQLAST left, JDOQLAST right)
op
- the multiplication operatorleft
- the left operandright
- the right operandprotected JDOQLAST checkDivisionOp(JDOQLAST op, JDOQLAST left, JDOQLAST right)
op
- the division operatorleft
- the left operandright
- the right operandprotected JDOQLAST checkUnaryMinusOp(JDOQLAST op, JDOQLAST arg)
op
- the unary minus operatorarg
- the operandprotected java.math.BigDecimal getBigDecimalValue(java.lang.Object value)
value
- value to be convertedprotected java.math.BigInteger getBigIntegerValue(java.lang.Object value)
value
- value to be convertedprotected JDOQLAST handleValueEqValue(JDOQLAST op, JDOQLAST left, JDOQLAST right, boolean negate)
op
- the equality operatorleft
- the left operandright
- the right operandnegate
- true for not equal operation, false otherwiseprotected boolean isBooleanValueAST(JDOQLAST ast)
public final void query(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void candidateClass(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void parameters(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void variables(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void ordering(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void filter(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void declareParameter(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void declareVariable(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void orderSpec(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void expression(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void primary(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void bitwiseExpr(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void conditionalExpr(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void relationalExpr(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void binaryArithmeticExpr(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void unaryArithmeticExpr(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void complementExpr(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void integralLiteral(antlr.collections.AST _t, boolean negate) throws antlr.RecognitionException
antlr.RecognitionException
public final void literal(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void parameterAccess(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void variableAccess(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void staticFieldAccess(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void fieldAccess(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void navigation(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void contains(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void startsWith(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void endsWith(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void isEmpty(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.