ADQLParserConstantspublic class ADQLParser extends java.lang.Object implements ADQLParserConstants
Query() function.
This parser is able, thanks to a QueryChecker object, to check each
ADQLQuery just after its generation. It could be used to check the
consistency between the ADQL query to parse and the "database" on which the
query must be executed. By default, there is no QueryChecker. Thus
you must extend QueryChecker to check semantically all generated
ADQLQuery objects.
To create an object representation of the given ADQL query, this parser uses
a ADQLQueryFactory object. So if you want customize some object
(ie. CONTAINS) of this representation you just have to extend the
corresponding default object (ie. ContainsFunction) and to extend the
corresponding function of ADQLQueryFactory
(ie. createContains(...)).
WARNING: To modify this class it's strongly encouraged to modify the .jj file in the section between PARSER_BEGIN and PARSER_END and to re-compile it with JavaCC.
QueryChecker,
ADQLQueryFactory| Modifier and Type | Field | Description |
|---|---|---|
Token |
jj_nt |
Next token.
|
Token |
token |
Current token.
|
ADQLParserTokenManager |
token_source |
Generated Token Manager.
|
ABS, ACOS, AND, AREA, AS, ASC, ASIN, ASTERISK, ATAN, ATAN2, AVG, BETWEEN, BOX, BY, CEILING, CENTROID, CIRCLE, COMMA, CONCAT, CONTAINS, COORD1, COORD2, COORDSYS, COS, COT, COUNT, DEFAULT, DEGREES, DELIMITED_IDENTIFIER, DESC, DIGIT, DISTANCE, DIVIDE, DOT, EOF, EOQ, EQUAL, EXISTS, EXP, FLOOR, FROM, FULL, GREATER_EQUAL_THAN, GREATER_THAN, GROUP, HAVING, IN, INNER, INTERSECTS, IS, JOIN, LEFT, LEFT_PAR, LESS_EQUAL_THAN, LESS_THAN, Letter, LIKE, LOG, LOG10, MAX, MIN, MINUS, MOD, NATURAL, NOT, NOT_EQUAL, NULL, ON, OR, ORDER, OUTER, PI, PLUS, POINT, POLYGON, POWER, QUANTIFIER, RADIANS, RAND, REGION, REGULAR_IDENTIFIER, RIGHT, RIGHT_PAR, ROUND, SCIENTIFIC_NUMBER, SELECT, SIN, SQL_RESERVED_WORD, SQRT, STRING_LITERAL, SUM, TAN, tokenImage, TOP, TRUNCATE, UNSIGNED_FLOAT, UNSIGNED_INTEGER, USING, WHERE, WithinDelimitedId, WithinString| Constructor | Description |
|---|---|
ADQLParser() |
Builds an ADQL parser without a query to parse.
|
ADQLParser(ADQLParserTokenManager tm) |
Constructor with generated Token Manager.
|
ADQLParser(ADQLParserTokenManager tm,
ADQLQueryFactory factory) |
Builds a parser with another token manager.
|
ADQLParser(ADQLParserTokenManager tm,
QueryChecker checker) |
Builds a parser with another token manager.
|
ADQLParser(ADQLParserTokenManager tm,
QueryChecker checker,
ADQLQueryFactory factory) |
Builds a parser with another token manager.
|
ADQLParser(ADQLQueryFactory factory) |
Builds an ADQL parser without a query to parse but with a
ADQLQueryFactory. |
ADQLParser(QueryChecker checker) |
Builds an ADQL parser without a query to parse but with a
QueryChecker. |
ADQLParser(QueryChecker checker,
ADQLQueryFactory factory) |
Builds an ADQL parser without a query to parse but with a
QueryChecker and a ADQLQueryFactory. |
ADQLParser(java.io.InputStream stream) |
Constructor with InputStream.
|
ADQLParser(java.io.InputStream stream,
ADQLQueryFactory factory) |
Builds a parser with a stream containing the query to parse.
|
ADQLParser(java.io.InputStream stream,
QueryChecker checker) |
Builds a parser with a stream containing the query to parse.
|
ADQLParser(java.io.InputStream stream,
QueryChecker checker,
ADQLQueryFactory factory) |
Builds a parser with a stream containing the query to parse.
|
ADQLParser(java.io.InputStream stream,
java.lang.String encoding) |
Constructor with InputStream and supplied encoding
|
ADQLParser(java.io.InputStream stream,
java.lang.String encoding,
ADQLQueryFactory factory) |
Builds a parser with a stream containing the query to parse.
|
ADQLParser(java.io.InputStream stream,
java.lang.String encoding,
QueryChecker checker) |
Builds a parser with a stream containing the query to parse.
|
ADQLParser(java.io.InputStream stream,
java.lang.String encoding,
QueryChecker checker,
ADQLQueryFactory factory) |
Builds a parser with a stream containing the query to parse.
|
ADQLParser(java.io.Reader stream) |
Constructor.
|
ADQLParser(java.io.Reader reader,
ADQLQueryFactory factory) |
Builds a parser with a reader containing the query to parse.
|
ADQLParser(java.io.Reader reader,
QueryChecker checker) |
Builds a parser with a reader containing the query to parse.
|
ADQLParser(java.io.Reader reader,
QueryChecker checker,
ADQLQueryFactory factory) |
Builds a parser with a reader containing the query to parse.
|
public ADQLParserTokenManager token_source
public Token token
public Token jj_nt
public ADQLParser()
public ADQLParser(QueryChecker checker, ADQLQueryFactory factory)
QueryChecker and a ADQLQueryFactory.checker - The object to use to check each ADQLQuery.factory - The object to use to build an object representation of
the given ADQL query.public ADQLParser(QueryChecker checker)
QueryChecker.checker - The object to use to check each ADQLQuery.public ADQLParser(ADQLQueryFactory factory)
ADQLQueryFactory.factory - The object to use to build an object representation of
the given ADQL query.public ADQLParser(java.io.InputStream stream,
QueryChecker checker,
ADQLQueryFactory factory)
stream - The stream in which the ADQL query to parse is given.checker - The object to use to check each ADQLQuery.factory - The object to use to build an object representation of
the given ADQL query.public ADQLParser(java.io.InputStream stream,
QueryChecker checker)
stream - The stream in which the ADQL query to parse is given.checker - The object to use to check each ADQLQuery.public ADQLParser(java.io.InputStream stream,
ADQLQueryFactory factory)
stream - The stream in which the ADQL query to parse is given.factory - The object to use to build an object representation of
the given ADQL query.public ADQLParser(java.io.InputStream stream,
java.lang.String encoding,
QueryChecker checker,
ADQLQueryFactory factory)
stream - The stream in which the ADQL query to parse is given.encoding - The supplied encoding.checker - The object to use to check each ADQLQuery.factory - The object to use to build an object representation
of the given ADQL query.public ADQLParser(java.io.InputStream stream,
java.lang.String encoding,
QueryChecker checker)
stream - The stream in which the ADQL query to parse is given.encoding - The supplied encoding.checker - The object to use to check each ADQLQuery.public ADQLParser(java.io.InputStream stream,
java.lang.String encoding,
ADQLQueryFactory factory)
stream - The stream in which the ADQL query to parse is given.encoding - The supplied encoding.factory - The object to use to build an object representation
of the given ADQL query.public ADQLParser(java.io.Reader reader,
QueryChecker checker,
ADQLQueryFactory factory)
reader - The reader in which the ADQL query to parse is given.checker - The object to use to check each ADQLQuery.factory - The object to use to build an object representation
of the given ADQL query.public ADQLParser(java.io.Reader reader,
QueryChecker checker)
reader - The reader in which the ADQL query to parse is given.checker - The object to use to check each ADQLQuery.public ADQLParser(java.io.Reader reader,
ADQLQueryFactory factory)
reader - The reader in which the ADQL query to parse is given.factory - The object to use to build an object representation
of the given ADQL query.public ADQLParser(ADQLParserTokenManager tm, QueryChecker checker, ADQLQueryFactory factory)
tm - The manager which associates a token to a numeric code.checker - The object to use to check each ADQLQuery.factory - The object to use to build an object representation
of the given ADQL query.public ADQLParser(ADQLParserTokenManager tm, QueryChecker checker)
tm - The manager which associates a token to a numeric code.checker - The object to use to check each ADQLQuery.public ADQLParser(ADQLParserTokenManager tm, ADQLQueryFactory factory)
tm - The manager which associates a token to a numeric code.factory - The object to use to build an object representation of
the given ADQL query.public ADQLParser(java.io.InputStream stream)
public ADQLParser(java.io.InputStream stream,
java.lang.String encoding)
public ADQLParser(java.io.Reader stream)
public ADQLParser(ADQLParserTokenManager tm)
public final ADQLQuery parseQuery() throws ParseException
ParseException - If there is at least one syntactic error.Query()public final ADQLQuery parseQuery(java.lang.String q) throws ParseException
q - The ADQL query to parse.ParseException - If there is at least one syntactic error.ReInit(java.io.InputStream),
setDebug(boolean),
Query()public final ADQLQuery parseQuery(java.io.InputStream stream) throws ParseException
stream - The stream which contains the ADQL query to parse.ParseException - If there is at least one syntactic error.ReInit(java.io.InputStream),
setDebug(boolean),
Query()public final void setDebug(boolean debug)
public final QueryChecker getQueryChecker()
public final void setQueryChecker(QueryChecker checker)
public final ADQLQueryFactory getQueryFactory()
public final void setQueryFactory(ADQLQueryFactory factory)
public static final void main(java.lang.String[] args)
throws java.lang.Exception
ONLY the syntax is checked: the query is NOT EXECUTED !
Supplied parameters are:
args - java.lang.Exceptionpublic final ADQLQuery Query() throws ParseException
ReInit(java.io.InputStream)
or in the parseQuery functions.ParseException - If the query syntax is incorrect.public final ADQLQuery QueryExpression() throws ParseException
ParseExceptionpublic final ADQLQuery SubQueryExpression() throws ParseException
ParseExceptionpublic final void Select()
throws ParseException
ParseExceptionpublic final SelectItem SelectItem() throws ParseException
ParseExceptionpublic final void From()
throws ParseException
ParseExceptionpublic final void Where()
throws ParseException
ParseExceptionpublic final void GroupBy()
throws ParseException
ParseExceptionpublic final void Having()
throws ParseException
ParseExceptionpublic final void OrderBy()
throws ParseException
ParseExceptionpublic final IdentifierItems.IdentifierItem Identifier() throws ParseException
ParseExceptionpublic final IdentifierItems TableName() throws ParseException
IdentifierItems which contains at most three items: catalogName, schemaName and tableName.ParseExceptionpublic final IdentifierItems ColumnName() throws ParseException
IdentifierItems which contains at most four items: catalogName, schemaName, tableName and columnName.ParseExceptionpublic final ADQLColumn Column() throws ParseException
ParseExceptionpublic final ADQLOrder OrderItem() throws ParseException
ParseExceptionpublic final FromContent SimpleTableRef() throws ParseException
ParseExceptionpublic final FromContent TableRef() throws ParseException
ParseExceptionpublic final FromContent JoinedTable() throws ParseException
ParseExceptionpublic final ADQLJoin JoinSpecification(FromContent leftTable) throws ParseException
ParseExceptionpublic final StringConstant String() throws ParseException
ParseExceptionpublic final NumericConstant UnsignedNumeric() throws ParseException
ParseExceptionpublic final NumericConstant UnsignedFloat() throws ParseException
ParseExceptionpublic final NumericConstant SignedInteger() throws ParseException
ParseExceptionpublic final ADQLOperand NumericValueExpressionPrimary() throws ParseException
ParseExceptionpublic final ADQLOperand StringValueExpressionPrimary() throws ParseException
ParseExceptionpublic final ADQLOperand ValueExpression() throws ParseException
ParseExceptionpublic final ADQLOperand NumericExpression() throws ParseException
ParseExceptionpublic final ADQLOperand NumericTerm() throws ParseException
ParseExceptionpublic final ADQLOperand Factor() throws ParseException
ParseExceptionpublic final ADQLOperand StringExpression() throws ParseException
ParseExceptionpublic final ADQLOperand StringFactor() throws ParseException
ParseExceptionpublic final GeometryFunction.GeometryValue<GeometryFunction> GeometryExpression() throws ParseException
ParseExceptionpublic final ClauseConstraints ConditionsList(ClauseConstraints clause) throws ParseException
ParseExceptionpublic final ADQLConstraint Constraint() throws ParseException
ParseExceptionpublic final ADQLConstraint Predicate() throws ParseException
ParseExceptionpublic final Comparison ComparisonEnd(ADQLOperand leftOp) throws ParseException
ParseExceptionpublic final Between BetweenEnd(ADQLOperand leftOp) throws ParseException
ParseExceptionpublic final In InEnd(ADQLOperand leftOp) throws ParseException
ParseExceptionpublic final SQLFunction SqlFunction() throws ParseException
ParseExceptionpublic final ADQLOperand[] Coordinates() throws ParseException
ParseExceptionpublic final GeometryFunction GeometryFunction() throws ParseException
ParseExceptionpublic final ADQLOperand CoordinateSystem() throws ParseException
ParseExceptionpublic final GeometryFunction GeometryValueFunction() throws ParseException
ParseExceptionpublic final PointFunction Point() throws ParseException
ParseExceptionpublic final GeometryFunction ExtractCoordSys() throws ParseException
ParseExceptionpublic final ADQLFunction NumericFunction() throws ParseException
ParseExceptionpublic final MathFunction MathFunction() throws ParseException
ParseExceptionpublic final MathFunction TrigFunction() throws ParseException
ParseExceptionpublic final UserDefinedFunction UserDefinedFunction() throws ParseException
ParseExceptionpublic void ReInit(java.io.InputStream stream)
public void ReInit(java.io.InputStream stream,
java.lang.String encoding)
public void ReInit(java.io.Reader stream)
public void ReInit(ADQLParserTokenManager tm)
public final Token getNextToken()
public final Token getToken(int index)
public ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()