public class Semantic extends antlr.TreeParser implements SemanticTokenTypes
TBD:
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
_tokenNames |
static antlr.collections.impl.BitSet |
_tokenSet_0 |
protected JavaType |
candidateClass
Candidate class.
|
protected ErrorMsg |
errorMsg
The error message support class.
|
protected static I18NHelper |
msg
I18N support
|
protected ParameterTable |
paramtab
The query parameter table
|
protected SymbolTable |
symtab
Symbol table handling names of variables and parameters.
|
protected TypeNames |
typeNames
Table of type names handling imports.
|
protected TypeSupport |
typeSupport
The type support.
|
protected VariableChecker |
varChecker
The variable checker.
|
protected VariableTable |
vartab
The variable table.
|
_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 |
---|
Semantic() |
Modifier and Type | Method and Description |
---|---|
protected JDOQLAST |
addCharacterCast(JDOQLAST ast,
JavaType common)
The query runtime has a problem with binary or relational expressions
having an operand of type char or Character.
|
protected JDOQLAST |
analyseBinaryArithmeticExpr(JDOQLAST op,
JDOQLAST leftAST,
JDOQLAST rightAST)
Analyses a binary arithmetic expression +, -, *, /.
|
protected JavaType |
analyseBitwiseExpr(JDOQLAST op,
JDOQLAST leftAST,
JDOQLAST rightAST)
Analyses a bitwise/logical operation (&, |, ^)
|
protected JDOQLAST |
analyseCollectionCall(JDOQLAST dot,
JDOQLAST collection,
JDOQLAST method,
JDOQLAST args)
Analyses a call for an object that implements Collection.
|
protected JDOQLAST |
analyseComplementExpr(JDOQLAST op,
JDOQLAST argAST)
Analyses a complement expression.
|
protected JavaType |
analyseComplementExprType(JDOQLAST op,
JDOQLAST argAST)
Analyses a complement expression.
|
protected JavaType |
analyseConditionalExpr(JDOQLAST op,
JDOQLAST leftAST,
JDOQLAST rightAST)
Analyses a boolean conditional operation (&&, ||)
|
protected JDOQLAST |
analyseDefinedIdentifier(JDOQLAST ident)
This method analyses an identifier defined in the current scope which
is a field, variable or parameter defined in the symbol table.
|
protected JDOQLAST |
analyseDotExpr(JDOQLAST dot,
JDOQLAST expr,
JDOQLAST ident,
JDOQLAST args)
This method analyses a dot expression of the form expr.ident or
expr.ident(params) where expr itself can again be a dot expression.
|
protected JDOQLAST |
analyseFieldAccess(JDOQLAST objectExpr,
JDOQLAST ident,
JavaType classType,
JavaField javaField) |
protected void |
analyseOrderingExpression(JDOQLAST expr)
This method analyses the expression of a single ordering definition.
|
protected JDOQLAST |
analyseRelationalExpr(JDOQLAST op,
JDOQLAST leftAST,
JDOQLAST rightAST)
Analyses a relational operation.
|
protected JDOQLAST |
analyseStaticFieldAccess(JDOQLAST typename,
JDOQLAST ident,
JavaType classType,
JavaField javaField) |
protected JDOQLAST |
analyseStringCall(JDOQLAST dot,
JDOQLAST string,
JDOQLAST method,
JDOQLAST args)
Analyses a call for an object of type String.
|
protected JDOQLAST |
analyseUnaryArithmeticExpr(JDOQLAST op,
JDOQLAST argAST)
Analyses a unary expression + and -
|
protected JavaType |
analyseUnaryArithmeticExprType(JDOQLAST op,
JDOQLAST argAST)
Analyses a unary expression + and -
|
void |
argList(antlr.collections.AST _t) |
void |
args(antlr.collections.AST _t) |
void |
binaryArithmeticExpr(antlr.collections.AST _t) |
void |
bitwiseExpr(antlr.collections.AST _t) |
void |
candidateClass(antlr.collections.AST _t) |
protected void |
checkConstraints(JDOQLAST ast,
java.lang.String dependentVariable,
VariableChecker tab) |
protected void |
checkConstraints(JDOQLAST ast,
VariableChecker tab) |
protected void |
checkContainsArgs(JDOQLAST collection,
JDOQLAST method,
JDOQLAST args)
Check the arguments of a contains call.
|
protected void |
checkIsEmptyArgs(JDOQLAST args)
Check the arguments of a isEmpty call.
|
protected void |
checkStringCallArgs(JDOQLAST method,
JDOQLAST args)
Check the arguments of a startWith or endWith call.
|
void |
complementExpr(antlr.collections.AST _t) |
void |
conditionalExpr(antlr.collections.AST _t) |
void |
contains(antlr.collections.AST _t) |
JDOQLAST |
createQueryTree(java.lang.Class candidateClass,
JDOQLAST importsAST,
JDOQLAST paramsAST,
JDOQLAST varsAST,
JDOQLAST orderingAST,
JDOQLAST filterAST)
Combines partial ASTs into one query AST.
|
void |
declareImport(antlr.collections.AST _t) |
void |
declareParameter(antlr.collections.AST _t) |
void |
declareVariable(antlr.collections.AST _t) |
java.lang.String |
dotExpr(antlr.collections.AST _t) |
void |
endsWith(antlr.collections.AST _t) |
void |
expression(antlr.collections.AST _t) |
java.lang.String |
exprNoCheck(antlr.collections.AST _t,
boolean insideDotExpr) |
void |
fieldAccess(antlr.collections.AST _t) |
void |
filter(antlr.collections.AST _t) |
protected JavaField |
getCollectionField(JDOQLAST expr) |
protected JavaType |
getCommonOperandType(JavaType left,
JavaType right)
Returns the common type info for the specified operand types.
|
java.lang.String |
identifier(antlr.collections.AST _t,
boolean insideDotExpr) |
void |
imports(antlr.collections.AST _t) |
void |
init(TypeSupport typeSupport,
ParameterTable paramtab,
VariableTable vartab,
ErrorMsg errorMsg) |
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) |
java.lang.String |
primary(antlr.collections.AST _t,
boolean insideDotExpr) |
void |
primitiveType(antlr.collections.AST _t) |
java.lang.String |
qualifiedName(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 |
type(antlr.collections.AST _t) |
void |
unaryArithmeticExpr(antlr.collections.AST _t) |
void |
variableAccess(antlr.collections.AST _t) |
void |
variables(antlr.collections.AST _t) |
protected ErrorMsg errorMsg
protected SymbolTable symtab
protected TypeNames typeNames
protected TypeSupport typeSupport
protected ParameterTable paramtab
protected VariableTable vartab
protected VariableChecker varChecker
protected JavaType candidateClass
protected static final I18NHelper msg
public static final java.lang.String[] _tokenNames
public static final antlr.collections.impl.BitSet _tokenSet_0
public void init(TypeSupport typeSupport, ParameterTable paramtab, VariableTable vartab, 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
public JDOQLAST createQueryTree(java.lang.Class candidateClass, JDOQLAST importsAST, JDOQLAST paramsAST, JDOQLAST varsAST, JDOQLAST orderingAST, JDOQLAST filterAST)
protected void analyseOrderingExpression(JDOQLAST expr)
expr
- the expression of an ordering definitionprotected JDOQLAST analyseDotExpr(JDOQLAST dot, JDOQLAST expr, JDOQLAST ident, JDOQLAST args)
expr
- the left hand side of the dot expressionident
- the right hand side of the dot expressionargs
- arguments (in the case of a call)protected JDOQLAST analyseFieldAccess(JDOQLAST objectExpr, JDOQLAST ident, JavaType classType, JavaField javaField)
protected JDOQLAST analyseStaticFieldAccess(JDOQLAST typename, JDOQLAST ident, JavaType classType, JavaField javaField)
protected JDOQLAST analyseDefinedIdentifier(JDOQLAST ident)
ident
- the identifier ASTprotected JDOQLAST analyseCollectionCall(JDOQLAST dot, JDOQLAST collection, JDOQLAST method, JDOQLAST args)
protected void checkContainsArgs(JDOQLAST collection, JDOQLAST method, JDOQLAST args)
protected void checkIsEmptyArgs(JDOQLAST args)
protected JDOQLAST analyseStringCall(JDOQLAST dot, JDOQLAST string, JDOQLAST method, JDOQLAST args)
protected void checkStringCallArgs(JDOQLAST method, JDOQLAST args)
protected JavaType analyseBitwiseExpr(JDOQLAST op, JDOQLAST leftAST, JDOQLAST rightAST)
op
- the bitwise/logical operatorleftAST
- left operandrightAST
- right operandprotected JavaType analyseConditionalExpr(JDOQLAST op, JDOQLAST leftAST, JDOQLAST rightAST)
op
- the conditional operatorleftAST
- left operandrightAST
- right operandprotected JDOQLAST analyseRelationalExpr(JDOQLAST op, JDOQLAST leftAST, JDOQLAST rightAST)
op
- the relational operatorleftAST
- left operandrightAST
- right operandprotected JDOQLAST analyseBinaryArithmeticExpr(JDOQLAST op, JDOQLAST leftAST, JDOQLAST rightAST)
op
- the operatorleftAST
- left operandrightAST
- right operandprotected JDOQLAST addCharacterCast(JDOQLAST ast, JavaType common)
ast
- the ast to be checkedcommon
- the type to be used inside the castprotected JavaType getCommonOperandType(JavaType left, JavaType right)
left
- type info of left operandright
- type info of right operandprotected JDOQLAST analyseUnaryArithmeticExpr(JDOQLAST op, JDOQLAST argAST)
op
- the operatorargAST
- the opreandprotected JavaType analyseUnaryArithmeticExprType(JDOQLAST op, JDOQLAST argAST)
op
- the operatorargAST
- the operandprotected JDOQLAST analyseComplementExpr(JDOQLAST op, JDOQLAST argAST)
op
- the operatorargAST
- the operandprotected JavaType analyseComplementExprType(JDOQLAST op, JDOQLAST argAST)
op
- the operatorargAST
- the operandprotected void checkConstraints(JDOQLAST ast, VariableChecker tab)
protected void checkConstraints(JDOQLAST ast, java.lang.String dependentVariable, VariableChecker tab)
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 imports(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 type(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void declareImport(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final java.lang.String qualifiedName(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 java.lang.String exprNoCheck(antlr.collections.AST _t, boolean insideDotExpr) 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 java.lang.String primary(antlr.collections.AST _t, boolean insideDotExpr) throws antlr.RecognitionException
antlr.RecognitionException
public final void literal(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final java.lang.String dotExpr(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final java.lang.String identifier(antlr.collections.AST _t, boolean insideDotExpr) 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 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 isEmpty(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 argList(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void args(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 primitiveType(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.