Package org.geootols.filter.text.cql_2
Class CQL2Compiler
- Object
-
- CQL2Parser
-
- CQL2Compiler
-
- All Implemented Interfaces:
ICompiler
,CQL2ParserConstants
,CQL2ParserTreeConstants
public class CQL2Compiler extends CQL2Parser implements ICompiler
CQL2 compilerBuilds the filter, expression or arguments related with the visited node of syntax tree
- Author:
- Jody Garnett, Mauricio Pazos (Axios Engineering)
-
-
Field Summary
-
Fields inherited from class CQL2Parser
GEOOP, jj_nt, jjtree, lookingAhead, token, token_source
-
Fields inherited from interface CQL2ParserConstants
AFTER, AND, ANY, BEFORE, BETWEEN, COLON, COMMA, CONTAINS, CROSSES, DATE, DATE_OPEN, DATE_TIME, DATEFUNC, DE9IM_PATTERN, DEFAULT, DIGIT, DIMENSION_SYMBOL, DISJOINT, DOLLAR, DOUBLE_QUOTE, DUR_DATE, DUR_DAY, DUR_HOUR, DUR_MINUTE, DUR_MONTH, DUR_SECOND, DUR_TIME, DUR_YEAR, DURATION, DURING, ENVELOPE, EOF, EQ, EQUALS, EXPONENT, FALSE, FLOATING_LITERAL, FULL_DATE, GEOMETRYCOLLECTION, GT, GTE, IDENTIFIER, IN, INTEGER_LITERAL, INTERSECTS, INTERVAL, IS, LETTER, LIKE, LINESTRING, LP, LSP, LT, LTE, MINUS, MULT, MULTILINESTRING, MULTIPOINT, MULTIPOLYGON, NEQ, NOT, NULL, OR, OVERLAPS, PERIOD, PERIODFUNC, PLUS, POINT, POLYGON, QUOTE, RP, RSP, SENTENCE_SEPARATOR, SLASH, STRING_LITERAL, TEQUALS, TIME_ZONE, TIMESTAMPFUNC, tokenImage, TOUCHES, TRUE, UNKNOWN, UTC, UTC_TIME, WITHIN
-
Fields inherited from interface CQL2ParserTreeConstants
JJTADDNODE, JJTBETWEEN_NODE, JJTBOOLEAN_AND_NODE, JJTBOOLEAN_NOT_NODE, JJTBOOLEAN_OR_NODE, JJTCOMPARISONPREDICATE_EQ_NODE, JJTCOMPARISONPREDICATE_GT_NODE, JJTCOMPARISONPREDICATE_GTE_NODE, JJTCOMPARISONPREDICATE_LT_NODE, JJTCOMPARISONPREDICATE_LTE_NODE, JJTCOMPARISONPREDICATE_NOT_EQUAL_NODE, JJTCOMPOUND_ATTRIBUTE_NODE, JJTDATE_NODE, JJTDATEOPEN, JJTDATETIME_NODE, JJTDIVNODE, JJTENVELOPETAGGEDTEXT_NODE, JJTEXPRESSION_IN_LIST_NODE, JJTFALSENODE, JJTFLOATINGNODE, JJTFUNCTION_NODE, JJTFUNCTIONARG_NODE, JJTFUNCTIONNAME_NODE, JJTGEOMETRYCOLLECTIONTEXT_NODE, JJTGEOMETRYLITERAL, JJTIDENTIFIER_NODE, JJTIDENTIFIER_PART_NODE, JJTIN_PREDICATE_NODE, JJTINTEGERNODE, JJTINTERVAL, JJTLIKE_NODE, JJTLINESTRINGTEXT_NODE, JJTMULNODE, JJTMULTILINESTRINGTEXT_NODE, JJTMULTIPOINTTEXT_NODE, JJTMULTIPOLYGONTEXT_NODE, JJTNEGATIVENUMBER_NODE, jjtNodeName, JJTNOT_BETWEEN_NODE, JJTNOT_IN_PREDICATE_NODE, JJTNOT_LIKE_NODE, JJTNOTNULLPREDICATENODE, JJTNULLPREDICATENODE, JJTPOINT_NODE, JJTPOINTTEXT_NODE, JJTPOLYGONTEXT_NODE, JJTROUTINEINVOCATION_GEOOP_CONTAIN_NODE, JJTROUTINEINVOCATION_GEOOP_CROSS_NODE, JJTROUTINEINVOCATION_GEOOP_DISJOINT_NODE, JJTROUTINEINVOCATION_GEOOP_EQUAL_NODE, JJTROUTINEINVOCATION_GEOOP_INTERSECT_NODE, JJTROUTINEINVOCATION_GEOOP_OVERLAP_NODE, JJTROUTINEINVOCATION_GEOOP_TOUCH_NODE, JJTROUTINEINVOCATION_GEOOP_WITHIN_NODE, JJTSIMPLE_ATTRIBUTE_NODE, JJTSTRINGNODE, JJTSUBTRACTNODE, JJTTPAFTER_DATETIME_NODE, JJTTPBEFORE_DATETIME_NODE, JJTTPDURING_PERIOD_NODE, JJTTPTEQUALS_DATETIME_NODE, JJTTRUENODE, JJTVOID, JJTWKTNODE
-
-
Constructor Summary
Constructors Constructor Description CQL2Compiler(String txtSource, FilterFactory filterFactory)
new instance of TXTCompiler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
compileExpression()
compiles source to produce a Expressionvoid
compileFilter()
compile source to produce a Filter.void
compileFilterList()
Compiles a list of filtersExpression
getExpression()
Return the expression resultant of compiling processFilter
getFilter()
Return the filter resultant of compiling processList<Filter>
getFilterList()
Returns the list of Filters built as the result of calling {@link #FilterListCompilationUnit()()}String
getSource()
IToken
getTokenInPosition(int index)
Return the token presents in the position specified.void
jjtreeCloseNodeScope(Node n)
called by parser when the node is closed.void
jjtreeOpenNodeScope(Node n)
-
Methods inherited from class CQL2Parser
Attribute, AttributeTail, BetweenPredicate, BinaryExpression, BooleanFactor, BooleanLiteral, BooleanPrimary, BooleanTerm, BooleanValueExpression, CharacterPattern, ComparisonPredicate, CQL2Expression, DateLiteral, disable_tracing, enable_tracing, EnvelopeTaggedText, EnvelopText, Evaluate, Expression, ExpressionCompilationUnit, ExpressionInList, FilterCompilationUnit, FilterListCompilationUnit, FloatingLiteral, Function, FunctionArg, FunctionName, GeneralLiteral, generateParseException, GeometryCollectionTaggedText, GeometryCollectionText, GeometryLiteral, GeoRoutineArgumentList, getNextToken, getToken, Identifier, IdentifierPart, InPredicate, InPredicateList, InstantParameter, IntegerLiteral, Interval, isGeoOp, likePredicate, LineStringTaggedText, LineStringText, Literal, MultiLineStringTaggedText, MultiLineStringText, MultiplicativeExpression, MultiPointTaggedText, MultiPointText, MultiPolygonTaggedText, MultiPolygonText, NullPredicate, NumericLiteral, Point, PointTaggedText, PointText, PolygonTaggedText, PolygonText, Predicate, ReInit, ReInit, ReInit, ReInit, RoutineInvocation, RoutineInvocationGeneric, RoutineInvocationGeoOp, SearchCondition, SequenceOfSearchConditions, SimpleAttributeName, StringLiteral, TemporalExpression, TemporalExpressionInterval, TemporalPredicate, UnaryExpression, UnsignedNumericLiteral
-
-
-
-
Constructor Detail
-
CQL2Compiler
public CQL2Compiler(String txtSource, FilterFactory filterFactory)
new instance of TXTCompiler
-
-
Method Detail
-
compileFilter
public void compileFilter() throws CQLException
compile source to produce a Filter. The filter result must be retrieved withgetFilter()
.- Specified by:
compileFilter
in interfaceICompiler
- Throws:
CQLException
-
compileExpression
public void compileExpression() throws CQLException
compiles source to produce a Expression- Specified by:
compileExpression
in interfaceICompiler
- Throws:
CQLException
-
compileFilterList
public void compileFilterList() throws CQLException
Compiles a list of filters- Specified by:
compileFilterList
in interfaceICompiler
- Throws:
CQLException
-
getSource
public final String getSource()
-
getFilter
public final Filter getFilter() throws CQLException
Return the filter resultant of compiling process- Specified by:
getFilter
in interfaceICompiler
- Returns:
- Filter
- Throws:
CQLException
- See Also:
ICompiler.compileFilter()
-
getExpression
public final Expression getExpression() throws CQLException
Return the expression resultant of compiling process- Specified by:
getExpression
in interfaceICompiler
- Returns:
- Expression
- Throws:
CQLException
- See Also:
ICompiler.compileExpression()
-
getTokenInPosition
public IToken getTokenInPosition(int index)
Description copied from interface:ICompiler
Return the token presents in the position specified.- Specified by:
getTokenInPosition
in interfaceICompiler
- Returns:
- IToken
-
getFilterList
public List<Filter> getFilterList() throws CQLException
Returns the list of Filters built as the result of calling {@link #FilterListCompilationUnit()()}- Specified by:
getFilterList
in interfaceICompiler
- Returns:
- List
- Throws:
CQLException
- if a ClassCastException occurs while casting a built item to a Filter.- See Also:
ICompiler.compileFilterList()
-
jjtreeOpenNodeScope
public final void jjtreeOpenNodeScope(Node n)
- Overrides:
jjtreeOpenNodeScope
in classCQL2Parser
-
jjtreeCloseNodeScope
public final void jjtreeCloseNodeScope(Node n) throws ParseException
called by parser when the node is closed.- Overrides:
jjtreeCloseNodeScope
in classCQL2Parser
- Throws:
ParseException
-
-