org.basex.query
Class QueryParser

java.lang.Object
  extended by org.basex.util.InputParser
      extended by org.basex.query.QueryParser
Direct Known Subclasses:
QuerySuggest

public class QueryParser
extends InputParser

Simple query parser; can be overwritten to support more complex parsings.

Author:
Workgroup DBIS, University of Konstanz 2005-10, ISC License, Christian Gruen

Field Summary
 TokenList modLoaded
          List of loaded modules.
 
Fields inherited from class org.basex.util.InputParser
file, ql, qm, qp, qu
 
Constructor Summary
QueryParser(QueryContext c)
          Constructor.
 
Method Summary
 Expr parse(String q, IO f, Uri u)
          Parses the specified query.
 Expr parse(Uri u, boolean end)
          Parses the specified query.
 Expr path()
          [ 68] Parses a PathExpr
 
Methods inherited from class org.basex.util.InputParser
init
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modLoaded

public TokenList modLoaded
List of loaded modules.

Constructor Detail

QueryParser

public QueryParser(QueryContext c)
Constructor.

Parameters:
c - query context
Method Detail

parse

public final Expr parse(String q,
                        IO f,
                        Uri u)
                 throws QueryException
Parses the specified query. If uri != null, the query is treated as a module

Parameters:
q - input query
f - optional input file
u - module uri
Returns:
resulting expression
Throws:
QueryException - query exception

parse

public final Expr parse(Uri u,
                        boolean end)
                 throws QueryException
Parses the specified query. If uri != null, the query is treated as a module [ 1] Parses a Module.

Parameters:
u - module uri
end - if true, input must be completely evaluated
Returns:
resulting expression
Throws:
QueryException - query exception

path

public final Expr path()
                throws QueryException
[ 68] Parses a PathExpr. [ 69] Parses a RelativePathExpr.

Returns:
query expression
Throws:
QueryException - query exception