Package eu.clarin.sru.fcs.qlparser
Class AbstractQueryParser<Q extends AbstractQueryNode<Q,T,V>,T extends AbstractQueryNode.AbstractQueryNodeType,V extends AbstractQueryNode.AbstractQueryVisitor>
- java.lang.Object
-
- eu.clarin.sru.fcs.qlparser.AbstractQueryParser<Q,T,V>
-
- Direct Known Subclasses:
QueryParser
,QueryParser
public abstract class AbstractQueryParser<Q extends AbstractQueryNode<Q,T,V>,T extends AbstractQueryNode.AbstractQueryNodeType,V extends AbstractQueryNode.AbstractQueryVisitor> extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractQueryParser.ErrorListener
protected static class
AbstractQueryParser.ExpressionTreeBuilderException
-
Field Summary
Fields Modifier and Type Field Description protected boolean
enableSourceLocations
-
Constructor Summary
Constructors Constructor Description AbstractQueryParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
isEnableSourceLocations()
Whether source locations are computed for each query node.abstract Q
parse(String query)
Parse query.void
setEnableSourceLocations(boolean addNodeLocations)
Set whether source locations for query nodes should be computed.
-
-
-
Method Detail
-
parse
public abstract Q parse(String query) throws QueryParserException
Parse query.- Parameters:
query
- the query- Returns:
- a query expression tree
- Throws:
QueryParserException
- if an error occurred
-
isEnableSourceLocations
public boolean isEnableSourceLocations()
Whether source locations are computed for each query node.- Returns:
true
if source locations are added,false
otherwise
-
setEnableSourceLocations
public void setEnableSourceLocations(boolean addNodeLocations)
Set whether source locations for query nodes should be computed.- Parameters:
addNodeLocations
-true
if source locations are to be added,false
otherwise
-
-