Package uk.ac.starlink.vo
Class AdqlSyntax
java.lang.Object
uk.ac.starlink.table.jdbc.SqlSyntax
uk.ac.starlink.vo.AdqlSyntax
public class AdqlSyntax
extends uk.ac.starlink.table.jdbc.SqlSyntax
SqlSyntax instance for the ADQL 2.0 grammar.
This class is a singleton.
- Since:
- 22 Jun 2011
- Author:
- Mark Taylor
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]
ADQL reserved words additional to the SQL92 set, taken from the ADQL standard.Fields inherited from class uk.ac.starlink.table.jdbc.SqlSyntax
SQL92_IDENTIFIER_REGEX, SQL92_RESERVED
-
Method Summary
Modifier and TypeMethodDescriptioncharacterLiteral
(String txt) Returns ADQL text representing a character literal.String[]
getCatalogSchemaTable
(String tableName) Takes an ADQL<table_name>
token and returns a 3-element array giving the catalog, schema and table (delimited or regular) identifiers.static AdqlSyntax
Returns the sole instance of this class.boolean
isAdqlColumnName
(String token) Indicates whether the given token matches the ADQL<column_name>
production.boolean
isAdqlDelimitedIdentifier
(String token) Indicates whether the given token matches the ADQL<delimited_identifier>
production.boolean
isAdqlTableName
(String token) Indicates whether the given token matches the ADQL<table_name>
production.Takes a regular-or-delimited-identifier and returns its raw form.Methods inherited from class uk.ac.starlink.table.jdbc.SqlSyntax
getParanoidReservedWords, getReservedWords, isIdentifier, isReserved, quote, quoteIfNecessary
-
Field Details
-
ADQL_RESERVED
ADQL reserved words additional to the SQL92 set, taken from the ADQL standard.
-
-
Method Details
-
isAdqlDelimitedIdentifier
Indicates whether the given token matches the ADQL<delimited_identifier>
production.- Parameters:
token
- token to test- Returns:
- true iff token is a delimited_identifier
-
isAdqlColumnName
Indicates whether the given token matches the ADQL<column_name>
production.- Parameters:
token
- token to test- Returns:
- true iff token is a column_name
-
isAdqlTableName
Indicates whether the given token matches the ADQL<table_name>
production.- Parameters:
token
- token to test- Returns:
- true iff token is a table_name
-
getCatalogSchemaTable
Takes an ADQL<table_name>
token and returns a 3-element array giving the catalog, schema and table (delimited or regular) identifiers.For a non-null result, the input token must match the ADQL
<table_name>
production, which is the same rule that TAP_SCHEMA table_name columns must follow, which roughly means it's of the form [catalog.[schema.[table]]]. Either catalog alone, or both catalog and schema, may be null. The return value is either a three-element array (with 1, 2 or 3 non-null elements) in case of a legal table_name input, or null in case of an illegal table_name input.- Parameters:
tableName
- table_name string- Returns:
- 3-element array giving (catalog, schema, table) identifiers, or null for parse failure
-
unquote
Takes a regular-or-delimited-identifier and returns its raw form. For a regular identifier, the output is the same as the input.- Parameters:
identifier
- regular or delimited identifier, or null- Returns:
- identifier with no surrounding quotes or other escaping, or null for null input
-
characterLiteral
Returns ADQL text representing a character literal. This quotes the supplied string by surrounding it with single quotes, escaping any internal single quote characters appropriately.- Parameters:
txt
- raw text- Returns:
- character literal suitable for insertion into ADQL text
-
getInstance
Returns the sole instance of this class.- Returns:
- AdqlSyntax instance
-