diff --git a/examples/tap/examples_endpoint/Examples_DALI.class.violet.html b/examples/vollt_examples/tap/examples_endpoint/Examples_DALI.class.violet.html similarity index 100% rename from examples/tap/examples_endpoint/Examples_DALI.class.violet.html rename to examples/vollt_examples/tap/examples_endpoint/Examples_DALI.class.violet.html diff --git a/examples/tap/examples_endpoint/Examples_DALI.png b/examples/vollt_examples/tap/examples_endpoint/Examples_DALI.png similarity index 100% rename from examples/tap/examples_endpoint/Examples_DALI.png rename to examples/vollt_examples/tap/examples_endpoint/Examples_DALI.png diff --git a/examples/tap/examples_endpoint/Examples_TAPNotes.class.violet.html b/examples/vollt_examples/tap/examples_endpoint/Examples_TAPNotes.class.violet.html similarity index 100% rename from examples/tap/examples_endpoint/Examples_TAPNotes.class.violet.html rename to examples/vollt_examples/tap/examples_endpoint/Examples_TAPNotes.class.violet.html diff --git a/examples/tap/examples_endpoint/Examples_TAPNotes.png b/examples/vollt_examples/tap/examples_endpoint/Examples_TAPNotes.png similarity index 100% rename from examples/tap/examples_endpoint/Examples_TAPNotes.png rename to examples/vollt_examples/tap/examples_endpoint/Examples_TAPNotes.png diff --git a/examples/tap/examples_endpoint/examples_DALI.html b/examples/vollt_examples/tap/examples_endpoint/examples_DALI.html similarity index 100% rename from examples/tap/examples_endpoint/examples_DALI.html rename to examples/vollt_examples/tap/examples_endpoint/examples_DALI.html diff --git a/examples/tap/examples_endpoint/examples_TAPNotes.html b/examples/vollt_examples/tap/examples_endpoint/examples_TAPNotes.html similarity index 100% rename from examples/tap/examples_endpoint/examples_TAPNotes.html rename to examples/vollt_examples/tap/examples_endpoint/examples_TAPNotes.html diff --git a/examples/tap/tap_schema/migration_1.1.sql b/examples/vollt_examples/tap/tap_schema/migration_1.1.sql similarity index 100% rename from examples/tap/tap_schema/migration_1.1.sql rename to examples/vollt_examples/tap/tap_schema/migration_1.1.sql diff --git a/examples/tap/tap_schema/tap_schema_1.0.sql b/examples/vollt_examples/tap/tap_schema/tap_schema_1.0.sql similarity index 100% rename from examples/tap/tap_schema/tap_schema_1.0.sql rename to examples/vollt_examples/tap/tap_schema/tap_schema_1.0.sql diff --git a/examples/tap/tap_schema/tap_schema_1.1.sql b/examples/vollt_examples/tap/tap_schema/tap_schema_1.1.sql similarity index 100% rename from examples/tap/tap_schema/tap_schema_1.1.sql rename to examples/vollt_examples/tap/tap_schema/tap_schema_1.1.sql diff --git a/examples/tap/tap_schema/tap_schema_adaptation_1.0_1.1.sql b/examples/vollt_examples/tap/tap_schema/tap_schema_adaptation_1.0_1.1.sql similarity index 100% rename from examples/tap/tap_schema/tap_schema_adaptation_1.0_1.1.sql rename to examples/vollt_examples/tap/tap_schema/tap_schema_adaptation_1.0_1.1.sql diff --git a/src/adql/db/DBChecker.java b/src/adql/db/DBChecker.java index 485b0c41b171316b1df7805566ded0c269a165c1..eda5159b0eb4e5b739d073b33cfb859c82ecc573 100644 --- a/src/adql/db/DBChecker.java +++ b/src/adql/db/DBChecker.java @@ -38,8 +38,8 @@ import adql.db.exception.UnresolvedColumnException; import adql.db.exception.UnresolvedFunctionException; import adql.db.exception.UnresolvedIdentifiersException; import adql.db.exception.UnresolvedTableException; -import adql.parser.ParseException; import adql.parser.QueryChecker; +import adql.parser.grammar.ParseException; import adql.query.ADQLIterator; import adql.query.ADQLObject; import adql.query.ADQLQuery; diff --git a/src/adql/db/FunctionDef.java b/src/adql/db/FunctionDef.java index 645ede93a1cc12295998ab20c3b79183b9a6d573..a465344f1dd8345a5a55a42f3a27c69ce3f36b7e 100644 --- a/src/adql/db/FunctionDef.java +++ b/src/adql/db/FunctionDef.java @@ -26,11 +26,10 @@ import java.util.regex.Pattern; import adql.db.DBType.DBDatatype; import adql.parser.ADQLParser; -import adql.parser.ADQLParserFactory; -import adql.parser.ADQLParserFactory.ADQLVersion; -import adql.parser.ParseException; -import adql.parser.Token; +import adql.parser.ADQLParser.ADQLVersion; import adql.parser.feature.LanguageFeature; +import adql.parser.grammar.ParseException; +import adql.parser.grammar.Token; import adql.query.operand.ADQLOperand; import adql.query.operand.function.ADQLFunction; import adql.query.operand.function.DefaultUDF; @@ -334,7 +333,7 @@ public class FunctionDef implements Comparable<FunctionDef> { * of the ADQL grammar. */ public FunctionDef(final String fctName, final DBType returnType, final FunctionParam[] params) throws ParseException { - this(fctName, returnType, params, ADQLParserFactory.DEFAULT_VERSION); + this(fctName, returnType, params, ADQLParser.DEFAULT_VERSION); } /** @@ -415,8 +414,8 @@ public class FunctionDef implements Comparable<FunctionDef> { // Tokenize the given function name: try { - parser = (new ADQLParserFactory()).createParser(adqlVersion == null ? ADQLParserFactory.DEFAULT_VERSION : adqlVersion); - tokens = parser.tokenize(fctName); + parser = new ADQLParser(adqlVersion); + tokens = parser.tokenize(fctName, true); } catch(ParseException ex) { throw new ParseException("Invalid UDF name: " + ex.getMessage()); } @@ -428,7 +427,7 @@ public class FunctionDef implements Comparable<FunctionDef> { throw new ParseException("Invalid UDF name: too many words (a function name must be a single Regular Identifier)!"); // ...that it is a regular identifier: - if (!parser.isRegularIdentifier(tokens[0].image)) + if (!parser.getGrammarParser().isRegularIdentifier(tokens[0].image)) throw new ParseException("Invalid UDF name: \"" + fctName + "\" is not a Regular Identifier!"); // ...that it is not already an existing ADQL function name: diff --git a/src/adql/db/STCS.java b/src/adql/db/STCS.java index ffeec759814652e0dd47cba3495f6feb2f97689e..e7d6a927c813741084b7e987c4e115961494e42c 100644 --- a/src/adql/db/STCS.java +++ b/src/adql/db/STCS.java @@ -24,7 +24,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import adql.parser.ADQLQueryFactory; -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; import adql.query.TextPosition; import adql.query.operand.ADQLOperand; import adql.query.operand.NegativeOperand; diff --git a/src/adql/db/exception/UnresolvedColumnException.java b/src/adql/db/exception/UnresolvedColumnException.java index dffd8f6c1c4bd267c3d42b09f954683ebd246ea9..bff55a4fea5c246e7bf868de09960852a9fc1921 100644 --- a/src/adql/db/exception/UnresolvedColumnException.java +++ b/src/adql/db/exception/UnresolvedColumnException.java @@ -20,7 +20,7 @@ package adql.db.exception; */ import adql.db.DBChecker; -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; import adql.query.operand.ADQLColumn; /** diff --git a/src/adql/db/exception/UnresolvedFunctionException.java b/src/adql/db/exception/UnresolvedFunctionException.java index 4042537893d91c2337c89b8e10ae65529612f247..bbf3bb15c292f0c48c6435cf21d594f5e2305579 100644 --- a/src/adql/db/exception/UnresolvedFunctionException.java +++ b/src/adql/db/exception/UnresolvedFunctionException.java @@ -19,7 +19,7 @@ package adql.db.exception; * Copyright 2014-2015 - Astronomisches Rechen Institut (ARI) */ -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; import adql.query.TextPosition; import adql.query.operand.function.ADQLFunction; diff --git a/src/adql/db/exception/UnresolvedIdentifiersException.java b/src/adql/db/exception/UnresolvedIdentifiersException.java index 608eb73c78d4e0dcf460c6f2a866519006028d3a..bf48b1052ce74669f352292ae71836ee43ce2a9b 100644 --- a/src/adql/db/exception/UnresolvedIdentifiersException.java +++ b/src/adql/db/exception/UnresolvedIdentifiersException.java @@ -24,7 +24,7 @@ import java.util.ArrayList; import java.util.Iterator; import adql.db.DBChecker; -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; /** * This exception is thrown by {@link DBChecker} when several columns, tables, diff --git a/src/adql/db/exception/UnresolvedJoinException.java b/src/adql/db/exception/UnresolvedJoinException.java index c73e464f3b367c1ed5fd4a95faaea19eadc96152..e566a513030dadb96afc6e2988f7058a0d6d40bb 100644 --- a/src/adql/db/exception/UnresolvedJoinException.java +++ b/src/adql/db/exception/UnresolvedJoinException.java @@ -19,7 +19,7 @@ package adql.db.exception; * Copyright 2013-2015 - Astronomisches Rechen Institut (ARI) */ -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; import adql.query.TextPosition; /** diff --git a/src/adql/db/exception/UnresolvedTableException.java b/src/adql/db/exception/UnresolvedTableException.java index f08e629a15275c7b348c9685dafe1e5886edca71..0df9fa761027f1e55be338c09db542b6c568e6bf 100644 --- a/src/adql/db/exception/UnresolvedTableException.java +++ b/src/adql/db/exception/UnresolvedTableException.java @@ -20,8 +20,7 @@ package adql.db.exception; */ import adql.db.DBChecker; -import adql.parser.ParseException; - +import adql.parser.grammar.ParseException; import adql.query.from.ADQLTable; import adql.query.operand.ADQLColumn; diff --git a/src/adql/db/exception/UnsupportedFeatureException.java b/src/adql/db/exception/UnsupportedFeatureException.java index 1c46fda686d9e2fc2a231cb1a5feb448301d2e6a..d1716838be82079c4ce7f308d738c0e2ec22abcd 100644 --- a/src/adql/db/exception/UnsupportedFeatureException.java +++ b/src/adql/db/exception/UnsupportedFeatureException.java @@ -19,8 +19,8 @@ package adql.db.exception; * Copyright 2019 - UDS/Centre de Données astronomiques de Strasbourg (CDS) */ -import adql.parser.ParseException; import adql.parser.feature.LanguageFeature; +import adql.parser.grammar.ParseException; import adql.query.ADQLObject; /** diff --git a/src/adql/parser/ADQLParser.java b/src/adql/parser/ADQLParser.java index 9292f13f2173278a8acf35bf97137a14b829b294..8452e3d5d5b073309f63b796d1b5d924bea23394 100644 --- a/src/adql/parser/ADQLParser.java +++ b/src/adql/parser/ADQLParser.java @@ -19,12 +19,24 @@ package adql.parser; * Copyright 2019 - UDS/Centre de Données astronomiques de Strasbourg (CDS) */ +import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; -import java.io.Reader; +import java.util.ArrayList; -import adql.parser.ADQLParserFactory.ADQLVersion; +import adql.db.DBChecker; +import adql.db.exception.UnresolvedIdentifiersException; +import adql.db.exception.UnsupportedFeatureException; import adql.parser.feature.FeatureSet; +import adql.parser.feature.LanguageFeature; +import adql.parser.grammar.ADQLGrammar; +import adql.parser.grammar.ADQLGrammar.Tokenizer; +import adql.parser.grammar.ADQLGrammar200; +import adql.parser.grammar.ADQLGrammar201; +import adql.parser.grammar.ParseException; +import adql.parser.grammar.Token; +import adql.parser.grammar.TokenMgrError; +import adql.query.ADQLObject; import adql.query.ADQLOrder; import adql.query.ADQLQuery; import adql.query.ClauseADQL; @@ -32,108 +44,1317 @@ import adql.query.ClauseConstraints; import adql.query.ClauseSelect; import adql.query.from.FromContent; import adql.query.operand.ADQLColumn; -import adql.query.operand.ADQLOperand; +import adql.query.operand.function.geometry.ContainsFunction; +import adql.search.SearchOptionalFeaturesHandler; +import adql.translator.PostgreSQLTranslator; +import adql.translator.TranslationException; /** - * TODO + * Parser of ADQL expressions. + * + * <h3>Usage</h3> + * + * <p> + * The simplest way to use this parser is just to create a default ADQL + * parser, and call the function {@link #parseQuery(String)} on the ADQL query + * to evaluate. + * </p> + * + * <i> + * <p><b>Example:</b></p> + * <pre> + * try { + * // 1. CREATE A PARSER: + * ADQLParser parser = new {@link #ADQLParser()}; + * + * // 2. PARSE AN ADQL QUERY: + * ADQLQuery query = parser.{@link #parseQuery(String) parseQuery}("SELECT foo FROM bar WHERE stuff = 1"); + * + * System.out.println("((i)) Correct ADQL query ((i))"); + * System.out.println("((i)) As interpreted: ((i))\n " + query.toADQL().replaceAll("\n", "\n ")); + * } + * // 3. EVENTUALLY DEAL WITH ERRORS: + * catch({@link ParseException} ex) { + * System.err.println("((X)) INCORRECT QUERY! " + ex.getClass().getSimpleName() + " ((X))\n" + ex.getPosition() + " " + ex.getMessage()); + * }</pre> + * </i> + * + * <p> + * In the above example, the parser runs with the minimal set of options. It + * means that only the default optional language features are available, any + * UDF (even if undeclared) is allowed and no consistency with a list of tables + * and columns is performed. These points can be customized at creation with + * {@link #ADQLParser(ADQLVersion, QueryChecker, ADQLQueryFactory, FeatureSet)} + * but also after creation with {@link #setSupportedFeatures(FeatureSet)} and + * {@link #setQueryChecker(QueryChecker)}. + * </p> + * + * <h3>Runnable class</h3> + * + * <p> + * This class includes a main function and thus, can be executed directly. + * Its execution allows to parse an ADQL query. Then, in function of the passed + * parameters, it is possible to just check its syntax, translate it into SQL + * or try to fix the query. + * </p> + * + * <i> + * <p> + * To get help about this program, just run it with the argument + * <code>-h</code> or <code>--help</code>: + * </p> + * <pre>java -jar adqllib.jar --help</pre> + * </i> + * + * <h3>ADQL version</h3> + * + * <p> + * It is able to deal with all versions of the ADQL grammar supported by this + * library. All these versions are listed in the enumeration + * {@link ADQLVersion}. + * </p> + * + * <p> + * If a specific version of the grammar must be used, it must be specified in + * the constructor of the parser. + * </p> + * + * <p><i><b>Example: </b></i> + * <code>new {@link #ADQLParser(ADQLVersion) ADQLParser}({@link ADQLVersion#V2_1})</code> + * </p> + * + * <h3>Main functions</h3> + * + * <p>Here are the key functions to use:</p> + * <ul> + * <li>{@link #parseQuery(String)} (or any its alternative with an InputStream) + * to parse an input ADQL query String and get its corresponding ADQL tree + * </li> + * <li>{@link #tryQuickFix(String)} to try fixing the most common + * issues with ADQL queries (e.g. Unicode confusable characters, + * unescaped ADQL identifiers, SQL reserved keywords, ...)</li> + * <li>{@link #setSupportedFeatures(FeatureSet)} to set which optional ADQL + * features are supported or not ; all optional features used in the query + * while being declared as un-supported will throw an error at the end of + * the parsing</li> + * </ul> + * + * <h3>Custom checks</h3> + * + * <p> + * This parser is able, thanks to a {@link QueryChecker} object, to check each + * {@link ADQLQuery} just after its generation. It could be used, for + * instance, to check the consistency between the ADQL query to parse and the + * "database" on which the query must be executed. + * </p> + * + * <p> + * By default, there is no {@link QueryChecker}. Thus you must either use an + * already existing {@link QueryChecker} or extend this latter to run your own + * tests on the parsed ADQL queries. + * </p> + * + * <p> + * {@link DBChecker} is an extension of {@link QueryChecker} able to check that + * table and column names used in a query exist in a given set of DB metadata. + * </p> + * + * <h3>Custom Query Factory</h3> + * + * <p> + * To create an object representation of the given ADQL query, this parser + * uses a {@link ADQLQueryFactory} object. All parts of the ADQL grammar can + * already be created with this object. + * </p> + * + * <p> + * However, in some special cases, you may need to change the type of some + * specific nodes of the generated ADQL tree (e.g. <code>CONTAINS</code>). In + * such case, you just have to extend the corresponding default object + * (i.e. {@link ContainsFunction}) and to extend the corresponding function of + * {@link ADQLQueryFactory} (i.e. createContains(...)). Then, give an instance + * of this custom factory to the {@link ADQLParser}, at + * {@link #ADQLParser(ADQLVersion, QueryChecker, ADQLQueryFactory, FeatureSet) creation} + * or with the setter {@link #setQueryFactory(ADQLQueryFactory)}. + * </p> * * @author Grégory Mantelet (CDS) - * @version 2.0 (07/2019) + * @version 2.0 (08/2019) * @since 2.0 */ -public interface ADQLParser { +public class ADQLParser { + + /** Grammar parser to use. + * <p><i><b>Implementation note:</b> Never NULL.</i></p> */ + protected final ADQLGrammar grammarParser; + + /** List of all supported features. + * <p><i><b>Note:</b> + * The default set of features can be set with the function + * {@link #setDefaultFeatures()}. + * </i></p> + * <p><i><b>Implementation note:</b> Never NULL.</i></p> */ + protected FeatureSet supportedFeatures; + + /** API to check {@link ADQLQuery ADQL queries} (sub-queries or not) just + * after their generation. + * <p><i><b>Note:</b> + * This check step is optional. To ignore it, set this attribute to NULL. + * </i></p> */ + protected QueryChecker queryChecker = null; + + /** This object is used only when one of the {@link #tryQuickFix(String)} + * functions is called. It allows to try fixing common errors in the given + * ADQL query. + * <p><i><b>Implementation note:</b> Never NULL.</i></p> */ + protected QueryFixer quickFixer; /* ********************************************************************** - * GETTERS & SETTERS - * ********************************************************************** */ + * VERSION MANAGEMENT * + ********************************************************************** */ + + /** + * Enumeration of all supported versions of the ADQL grammar. + * + * @author Grégory Mantelet (CDS) + * @version 2.0 (08/2019) + * @since 2.0 + */ + public static enum ADQLVersion { + /** Version REC-2.0 - <a href="http://www.ivoa.net/documents/cover/ADQL-20081030.html">http://www.ivoa.net/documents/cover/ADQL-20081030.html</a>. */ + V2_0, + /** Version PR-2.1 - <a href="http://www.ivoa.net/documents/ADQL/20180112/index.html">http://www.ivoa.net/documents/ADQL/20180112/index.html</a>. */ + V2_1; // TODO Move 2.1 as default when it becomes REC + + @Override + public String toString() { + return name().toLowerCase().replace('_', '.'); + } - public ADQLVersion getADQLVersion(); + /** + * Parse the given string as an ADQL version number. + * + * <p>This function should work with the following syntaxes:</p> + * <ul> + * <li><code>2.0</code></li> + * <li><code>2_0</code></li> + * <li><code>v2.0</code> or <code>V2.0</code></li> + * <li><code>v2_0</code> or <code>V2_0</code></li> + * </ul> + * + * @param str String to parse as an ADQL version specification. + * + * @return The identified ADQL version. + */ + public static ADQLVersion parse(String str) { + if (str == null) + return null; - public QueryChecker getQueryChecker(); + str = str.trim().toUpperCase(); - public void setQueryChecker(final QueryChecker checker); + if (str.isEmpty()) + return null; - public ADQLQueryFactory getQueryFactory(); + if (str.charAt(0) != 'V') + str = 'V' + str; - public void setQueryFactory(final ADQLQueryFactory factory); + try { + return ADQLVersion.valueOf(str.replaceAll("\\.", "_")); + } catch(IllegalArgumentException iae) { + return null; + } + } + } - public FeatureSet getSupportedFeatures(); + /** Version of the ADQL grammar to use when none is specified: + * {@link ADQLVersion#V2_0 2.0}. */ + public final static ADQLVersion DEFAULT_VERSION = ADQLVersion.V2_0; // TODO Move 2.1 as default when it becomes REC - public void setSupportedFeatures(final FeatureSet features); + /** + * Get the list of all supported ADQL grammar versions. + * + * @return List of all supported ADQL versions. + * + * @see ADQLVersion#values() + */ + public static ADQLVersion[] getSupportedVersions() { + return ADQLVersion.values(); + } + + /** + * Build on the fly a human list of all supported ADQL grammar versions. + * + * <p> + * The default version item will be suffixed by the string + * <code>(default)</code>. + * </p> + * + * <i> + * <p><b>Example:</b></p> + * <pre>v2.0, v2.1 (default)</pre> + * </i> + * + * @return List of all supported ADQL versions. + */ + public static String getSupportedVersionsAsString() { + StringBuilder buf = new StringBuilder(); + for(ADQLVersion v : ADQLVersion.values()) { + if (buf.length() > 0) + buf.append(", "); + buf.append(v.toString()); + if (v == DEFAULT_VERSION) + buf.append(" (default)"); + } + return buf.toString(); + } /* ********************************************************************** - * PARSING DEBUG FUNCTIONS - * ********************************************************************** */ + * PARSER CREATION * + ********************************************************************** */ + + /** + * Builds an ADQL query parser for the default (i.e. last stable) version + * of the ADQL grammar. + * + * <p>This parser is set with:</p> + * <ul> + * <li>the {@link #DEFAULT_VERSION default version} of the ADQL + * grammar,</li> + * <li>the {@link #setDefaultFeatures() default set} of optional features,</li> + * <li>the default {@link ADQLQueryFactory ADQL query factory},</li> + * <li>and no custom check (i.e. no {@link QueryChecker} is set).</li> + * </ul> + * + * @see #DEFAULT_VERSION + */ + public ADQLParser() { + this(DEFAULT_VERSION, null, null, null); + } + + /** + * Builds an ADQL query parser for the specified version of the ADQL + * grammar. + * + * <p>This parser is set with:</p> + * <ul> + * <li>the specified version of the ADQL grammar,</li> + * <li>the {@link #setDefaultFeatures() default set} of optional features,</li> + * <li>the default {@link ADQLQueryFactory ADQL query factory},</li> + * <li>and no custom check (i.e. no {@link QueryChecker} is set).</li> + * </ul> + * + * @param version Version of the ADQL grammar that the parser must + * implement. + * <i>If NULL, the {@link #DEFAULT_VERSION} will be used.</i> + */ + public ADQLParser(ADQLVersion version) { + this(version, null, null, null); + } + + /** + * Builds a parser whose the query to parse will have to be given as a + * String in parameter of + * {@link ADQLParser#parseQuery(java.lang.String) parseQuery(String)}. + * + * @param version Version of the ADQL grammar that the parser must + * implement. + * <i>If NULL, the {@link #DEFAULT_VERSION} will be + * used.</i> + * @param queryChecker The custom checks to perform. + * <i>If NULL, only the general checks (e.g. supported + * features, UDFs, types) will be run.</i> + * @param factory The factory of ADQL objects to use. + * <i>If NULL, the default query factory will be + * used.</i> + * @param features The set of supported features. + * <i>If NULL, the default set of supported features + * will be used (see {@link #setDefaultFeatures()}).</i> + */ + public ADQLParser(ADQLVersion version, final QueryChecker queryChecker, final ADQLQueryFactory factory, final FeatureSet features) { + // Prevent the NULL value by setting the default version if necessary: + if (version == null) + version = DEFAULT_VERSION; + + // Create the appropriate parser in function of the specified version: + switch(version) { + case V2_0: + grammarParser = new ADQLGrammar200(new java.io.ByteArrayInputStream("".getBytes())); + break; + case V2_1: + default: + grammarParser = new ADQLGrammar201(new java.io.ByteArrayInputStream("".getBytes())); + break; + } - public void setDebug(final boolean debug); + // Set the query fixer to use (a default one): + setQuickFixer(new QueryFixer(grammarParser)); + + // Set the appropriate feature set: + if (features == null) + setDefaultFeatures(); + else + setSupportedFeatures(features); + + // Set the query factory: + setQueryFactory((factory == null) ? new ADQLQueryFactory() : factory); + + // Set the query checker, if any: + setQueryChecker(queryChecker); + + // Disable debugging messages by default: + setDebug(false); + } /* ********************************************************************** - * PARSING FUNCTIONS - * ********************************************************************** */ + * GETTERS & SETTERS * + ********************************************************************** */ - public void ReInit(InputStream stream); + /** + * Get the ADQL grammar version followed by this parser. + * + * @return The target ADQL version. + */ + public final ADQLVersion getADQLVersion() { + return grammarParser.getVersion(); + } + + /** + * Get the internal grammar parser specific to the target ADQL version. + * + * <p><i><b>Warning:</b> + * Changing the configuration of this internal parser might break the + * normal functioning of this {@link ADQLParser} instance. It is + * recommended to not use directly this internal parser. The goal of + * {@link ADQLParser} is to provide a nice and safe parser API. If + * something is missing or incorrect, please, contact the library + * developer so that this API can be completed/fixed. + * </i></p> + * + * @return The internal grammar parser. + */ + public final ADQLGrammar getGrammarParser() { + return grammarParser; + } + + /** + * Get the API used to attempt fixing given ADQL queries with the functions + * {@link #tryQuickFix(InputStream)} and {@link #tryQuickFix(String)}. + * + * @return The query fixer tool. + */ + public final QueryFixer getQuickFixer() { + return quickFixer; + } - public void ReInit(Reader reader); + /** + * Set the tool to use in order to attempt fixing any given ADQL query with + * the functions {@link #tryQuickFix(InputStream)} and + * {@link #tryQuickFix(String)}. + * + * @param fixer The tool to use. + * + * @throws NullPointerException If the given fixer is NULL. + */ + public final void setQuickFixer(final QueryFixer fixer) throws NullPointerException { + if (fixer == null) + throw new NullPointerException("Missing new QuickFixer! An ADQLParser can not try to fix ADQL queries without a QuickFixer instance."); + quickFixer = fixer; + } - public ADQLQuery parseQuery() throws ParseException; + /** + * Get the query factory used to create ADQL objects during the parsing + * of an ADQL query. + * + * @return The used ADQL query factory. + */ + public final ADQLQueryFactory getQueryFactory() { + return grammarParser.getQueryFactory(); + } - public ADQLQuery parseQuery(final String query) throws ParseException; + /** + * Set the query factory to use when creating ADQL objects during the + * parsing of an ADQL query. + * + * @param factory The ADQL query factory to use. + * + * @throws NullPointerException If the given factory is NULL. + */ + public final void setQueryFactory(ADQLQueryFactory factory) throws NullPointerException { + if (factory == null) + throw new NullPointerException("Missing ADQLQueryFactory to use! It is required for ADQL query parsing."); + grammarParser.setQueryFactory(factory); + } - public ADQLQuery parseQuery(final InputStream stream) throws ParseException; + /** + * Get the list of all supported features. + * + * <p><i><b>Note:</b> + * To customize the list of supported features, either get the set with + * this function and then update it directly, or set a new + * {@link FeatureSet} instance with + * {@link #setSupportedFeatures(FeatureSet)}. + * </i></p> + * + * @return Set of supported features. + */ + public final FeatureSet getSupportedFeatures() { + return supportedFeatures; + } - public ClauseSelect parseSelect(final String adql) throws ParseException; + /** + * Set a default set of supported language features in function of the + * target ADQL version. + * + * <ul> + * <li><b>ADQL-2.0:</b> the geometric functions are the only supported + * features.</li> + * <li><b>ADQL-2.1:</b> all optional features are supported.</li> + * </ul> + * + * <p><i><b>Note:</b> + * To customize the list of supported features, either get the set with + * {@link #getSupportedFeatures()} and then update it directly, or set a + * new {@link FeatureSet} instance with + * {@link #setSupportedFeatures(FeatureSet)}. + * </i></p> + */ + public final void setDefaultFeatures() { + switch(getADQLVersion()) { + case V2_0: + // any UDF is allowed and no optional feature supported...: + this.supportedFeatures = new FeatureSet(false, true); + // ...except geometries which are all supported by default: + supportedFeatures.supportAll(LanguageFeature.TYPE_ADQL_GEO); + break; + case V2_1: + default: + // all available features are considered as supported: + this.supportedFeatures = new FeatureSet(true, true); + break; + } + } - public FromContent parseFrom(final String adql) throws ParseException; + /** + * Set a new set of supported features. + * + * @param features The new list of supported features. + * + * @throws NullPointerException If the given object is NULL. + */ + public final void setSupportedFeatures(final FeatureSet features) throws NullPointerException { + if (features == null) + throw new NullPointerException("Missing list of supported features! It is required for ADQL query parsing."); + supportedFeatures = features; + } - public ClauseConstraints parseWhere(final String adql) throws ParseException; + /** + * Get the custom checker of parsed ADQL queries. + * + * @return Custom query checker, + * or NULL if no custom check is available. + */ + public final QueryChecker getQueryChecker() { + return queryChecker; + } - public ClauseADQL<ADQLOrder> parseOrderBy(final String adql) throws ParseException; + /** + * Set a custom checker of parsed ADQL queries. + * + * @param checker The custom query checks to run, + * or NULL to have no custom check. + */ + public final void setQueryChecker(QueryChecker checker) { + queryChecker = checker; + } - public ClauseADQL<ADQLColumn> parseGroupBy(final String adql) throws ParseException; + /** + * Enable/Disable the debugging messages while parsing an ADQL expression. + * + * @param debug <code>true</code> to enable debugging, + * <code>false</code> to disable it. + */ + public final void setDebug(final boolean debug) { + if (debug) + grammarParser.enable_tracing(); + else + grammarParser.disable_tracing(); + } /* ********************************************************************** - * AUTO-FIX FUNCTIONS - * ********************************************************************** */ + * PARSING FUNCTIONS * + ********************************************************************** */ - public String tryQuickFix(final InputStream input) throws IOException, ParseException; + /** + * Parses the query string given in parameter. + * + * @param q The ADQL query to parse. + * + * @return The object representation of the given ADQL query. + * + * @throws ParseException If there is at least one error. + * + * @see #effectiveParseQuery() + */ + public final ADQLQuery parseQuery(final String q) throws ParseException { + // Reset the parser with the string to parse: + try { + grammarParser.reset(new ByteArrayInputStream(q.getBytes())); + } catch(Exception ex) { + throw grammarParser.generateParseException(ex); + } - public String tryQuickFix(final String adqlQuery) throws ParseException; + // Run the query parsing: + return effectiveParseQuery(); + } /** - * Tell whether the given string is a valid ADQL regular identifier. + * Parses the query contained in the stream given in parameter. + * + * @param stream The stream which contains the ADQL query to parse. + * + * @return The object representation of the given ADQL query. + * + * @throws ParseException If there is at least one error. + * + * @see #effectiveParseQuery() + */ + public final ADQLQuery parseQuery(final InputStream stream) throws ParseException { + // Reset the parser with the stream to parse: + try { + grammarParser.reset(stream); + } catch(Exception ex) { + throw grammarParser.generateParseException(ex); + } + + // Run the query parsing: + return effectiveParseQuery(); + } + + /** + * Run the query parsing, then, if successful, the general and the custom + * checks (if any) on the parsing result (i.e. the query tree). + * + * <p>This function follows these steps:</p> + * <ol> + * <li>Parse the full ADQL query,</li> + * <li>Run the general checks on the parsing result (i.e. the ADQL + * tree),</li> + * <li>Run the custom checks (if any).</li> + * </ol> * * <p> - * According to the ADQL grammar, a regular identifier (i.e. not - * delimited ; not between double quotes) must be a letter followed by a - * letter, digit or underscore. So, the following regular expression: + * When a step is successful, this function run the next one. But, if it + * fails, a {@link ParseException} is immediately thrown. This exception + * may represent more than one error ; especially during the steps 2. and + * 3. * </p> * - * <pre> - * [a-zA-Z]+[a-zA-Z0-9_]* - * </pre> + * @return The object representation of the successfully parsed query + * (i.e. the ADQL tree). + * + * @throws ParseException If syntax is incorrect (i.e. no ADQL tree can be + * generated), or if any check on the parsing + * result fails. + * + * @see #generalChecks(ADQLQuery) + * @see QueryChecker#check(ADQLQuery) + */ + protected ADQLQuery effectiveParseQuery() throws ParseException { + // 1. Parse the full ADQL query: + ADQLQuery parsedQuery; + try { + parsedQuery = grammarParser.Query(); + } catch(TokenMgrError tme) { + throw new ParseException(tme); + } + + /* 2. Run the general checks on the parsed query: + * (note: this check is very close to grammar check...hence its higher + * priority) */ + generalChecks(parsedQuery); + + // 3. Run the custom checks (if any): + if (queryChecker != null) + queryChecker.check(parsedQuery); + + // If no syntactic error and that all checks passed, return the result: + return parsedQuery; + } + + /** + * Run the general and common checks on the given ADQL tree. * * <p> - * This is what this function tests on the given string. + * By default, this function only checks whether or not language features + * found in the given ADQL tree are supported. If not, a + * {@link ParseException} is thrown. + * </p> + * + * <p><i><b>Implementation note:</b> + * By default, when a part of the ADQL tree uses an unsupported language + * feature, an {@link UnsupportedFeatureException} is created. This + * function does not stop at the first encountered unsupported feature. It + * keeps reading the ADQL tree and appends all created + * {@link UnsupportedFeatureException}s into an + * {@link UnresolvedIdentifiersException}. Finally, when the tree has been + * entirely read and if unsupported features have been encountered, this + * {@link UnresolvedIdentifiersException} is thrown. + * </p> + * + * @param q The ADQL query to check. + * + * @throws ParseException If any unsupported language feature is used in + * the given ADQL tree. + */ + protected void generalChecks(final ADQLQuery q) throws ParseException { + // Create the exception in which errors have to be appended: + UnresolvedIdentifiersException exUnsupportedFeatures = new UnresolvedIdentifiersException("unsupported expression"); + + // Search recursively for all optional features inside the given tree: + SearchOptionalFeaturesHandler sFeaturesHandler = new SearchOptionalFeaturesHandler(true, false); + sFeaturesHandler.search(q); + + // Append an error for each unsupported one: + for(ADQLObject obj : sFeaturesHandler) { + if (!supportedFeatures.isSupporting(obj.getFeatureDescription())) + exUnsupportedFeatures.addException(new UnsupportedFeatureException(obj)); + } + + // If unsupported features have been found, throw a ParseException: + if (exUnsupportedFeatures.getNbErrors() > 0) + throw exUnsupportedFeatures; + } + + /** + * Parse the given <code>SELECT</code> clause. + * + * <i> + * <p><b>Important note:</b> + * The given string MUST start with <code>SELECT</code> (case insensitive). + * It MUST also follow the syntax of the FULL clause as described in the + * appropriate version of the ADQL Grammar. + * </p> + * <p><b>Examples of INcorrect parameter:</b></p> + * <ul> + * <li><code>SELECT</code></li> + * <li><code>aColumn</code></li> + * <li><code>DISTINCT TOP 10 aColumn, bColumn AS "B"</code></li> + * </ul> + * <p><b>Example of correct parameter:</b></p> + * <pre>SELECT DISTINCT TOP 10 aColumn, bColumn AS "B"</pre> + * </i> + * + * @param adql The <code>SELECT</code> clause to parse. + * + * @return The corresponding object representation of the given clause. + * + * @throws ParseException If the syntax of the given clause is incorrect. + */ + public final ClauseSelect parseSelect(final String adql) throws ParseException { + // Reset the parser with the string to parse: + try { + grammarParser.reset(new java.io.ByteArrayInputStream(adql.getBytes())); + } catch(Exception ex) { + throw grammarParser.generateParseException(ex); + } + + // Parse the string: + try { + + // Parse the string as a SELECT clause: + grammarParser.Select(); + + // Return what's just got parsed: + return grammarParser.getQuery().getSelect(); + + } catch(TokenMgrError tme) { + throw new ParseException(tme); + } + } + + /** + * Parse the given <code>FROM</code> clause. + * + * <i> + * <p><b>Important note:</b> + * The given string MUST start with <code>FROM</code> (case insensitive). + * It MUST also follow the syntax of the FULL clause as described in the + * appropriate version of the ADQL Grammar. + * </p> + * <p><b>Examples of INcorrect parameter:</b></p> + * <ul> + * <li><code>FROM</code></li> + * <li><code>aTable</code></li> + * <li><code>aTable JOIN bTable</code></li> + * <li><code>aTable JOIN bTable AS "B" USING(id)</code></li> + * </ul> + * <p><b>Example of correct parameter:</b></p> + * <pre>FROM aTable JOIN bTable AS "B" USING(id)</pre> + * </i> + * + * @param adql The <code>FROM</code> clause to parse. + * + * @return The corresponding object representation of the given clause. + * + * @throws ParseException If the syntax of the given clause is incorrect. + */ + public final FromContent parseFrom(java.lang.String adql) throws ParseException { + // Reset the parser with the string to parse: + try { + grammarParser.reset(new java.io.ByteArrayInputStream(adql.getBytes())); + } catch(Exception ex) { + throw grammarParser.generateParseException(ex); + } + + // Parse the string: + try { + + // Parse the string as a FROM clause: + grammarParser.From(); + + // Return what's just got parsed: + return grammarParser.getQuery().getFrom(); + + } catch(TokenMgrError tme) { + throw new ParseException(tme); + } + } + + /** + * Parse the given <code>WHERE</code> clause. + * + * <i> + * <p><b>Important note:</b> + * The given string MUST start with <code>WHERE</code> (case insensitive). + * It MUST also follow the syntax of the FULL clause as described in the + * appropriate version of the ADQL Grammar. + * </p> + * <p><b>Examples of INcorrect parameter:</b></p> + * <ul> + * <li><code>WHERE</code></li> + * <li><code>foo</code></li> + * <li><code>foo = 'bar'</code></li> + * </ul> + * <p><b>Example of correct parameter:</b></p> + * <pre>WHERE foo = 'bar'</pre> + * </i> + * + * @param adql The <code>WHERE</code> clause to parse. + * + * @return The corresponding object representation of the given clause. + * + * @throws ParseException If the syntax of the given clause is incorrect. + */ + public final ClauseConstraints parseWhere(java.lang.String adql) throws ParseException { + // Reset the parser with the string to parse: + try { + grammarParser.reset(new java.io.ByteArrayInputStream(adql.getBytes())); + } catch(Exception ex) { + throw grammarParser.generateParseException(ex); + } + + // Parse the string: + try { + + // Parse the string as a WHERE clause: + grammarParser.Where(); + + // Return what's just got parsed: + return grammarParser.getQuery().getWhere(); + + } catch(TokenMgrError tme) { + throw new ParseException(tme); + } + } + + /** + * Parse the given <code>ORDER BY</code> clause. + * + * <i> + * <p><b>Important note:</b> + * The given string MUST start with <code>ORDER BY</code> (case insensitive). + * It MUST also follow the syntax of the FULL clause as described in the + * appropriate version of the ADQL Grammar. + * </p> + * <p><b>Examples of INcorrect parameter:</b></p> + * <ul> + * <li><code>ORDER BY</code></li> + * <li><code>aColumn DESC</code></li> + * </ul> + * <p><b>Example of correct parameter:</b></p> + * <pre>ORDER BY aColumn DESC</pre> + * </i> + * + * @param adql The <code>ORDER BY</code> clause to parse. + * + * @return The corresponding object representation of the given clause. + * + * @throws ParseException If the syntax of the given clause is incorrect. + */ + public final ClauseADQL<ADQLOrder> parseOrderBy(java.lang.String adql) throws ParseException { + // Reset the parser with the string to parse: + try { + grammarParser.reset(new java.io.ByteArrayInputStream(adql.getBytes())); + } catch(Exception ex) { + throw grammarParser.generateParseException(ex); + } + + // Parse the string: + try { + + // Parse the string as a ORDER BY clause: + grammarParser.OrderBy(); + + // Return what's just got parsed: + return grammarParser.getQuery().getOrderBy(); + + } catch(TokenMgrError tme) { + throw new ParseException(tme); + } catch(Exception ex) { + throw grammarParser.generateParseException(ex); + } + } + + /** + * Parse the given <code>GROUP BY</code> clause. + * + * <i> + * <p><b>Important note:</b> + * The given string MUST start with <code>GROUP BY</code> (case insensitive). + * It MUST also follow the syntax of the FULL clause as described in the + * appropriate version of the ADQL Grammar. + * </p> + * <p><b>Examples of INcorrect parameter:</b></p> + * <ul> + * <li><code>GROUP BY</code></li> + * <li><code>aColumn</code></li> + * </ul> + * <p><b>Example of correct parameter:</b></p> + * <pre>GROUP BY aColumn</pre> + * </i> + * + * @param adql The <code>GROUP BY</code> clause to parse. + * + * @return The corresponding object representation of the given clause. + * + * @throws ParseException If the syntax of the given clause is incorrect. + */ + public final ClauseADQL<ADQLColumn> parseGroupBy(java.lang.String adql) throws ParseException { + // Reset the parser with the string to parse: + try { + grammarParser.reset(new java.io.ByteArrayInputStream(adql.getBytes())); + } catch(Exception ex) { + throw grammarParser.generateParseException(ex); + } + + // Parse the string: + try { + + // Parse the string as a GROUP BY clause: + grammarParser.GroupBy(); + + // Return what's just got parsed: + return grammarParser.getQuery().getGroupBy(); + + } catch(TokenMgrError tme) { + throw new ParseException(tme); + } + } + + /* ********************************************************************** + * TOKENIZATION FUNCTION * + ********************************************************************** */ + + /** + * Parse the given ADQL expression and split it into {@link Token}s. + * + * <i> + * <p><b>Note:</b> + * If <code>stopAtEnd=true</code>, the encountered EOQ (i.e. End Of Query + * = <code>;</code>) or EOF (i.e. End Of File) are NOT included in the + * returned array. * </p> * - * @param idCandidate The string to test. + * <p><b>Example:</b> + * <pre> tokenize("SELECT ; FROM", <b>false</b>); // = { SELECT, EOQ, FROM } + * tokenize("SELECT ; FROM", <b>true</b>); // = { SELECT }</pre> + * </i> * - * @return <code>true</code> if the given string is a valid regular - * identifier, - * <code>false</code> otherwise. + * @param expr The ADQL expression to tokenize. + * @param stopAtEnd <code>true</code> to stop the tokenization process when + * an EOQ or an EOF is encountered, + * <code>false</code> to stop when the end of the string is + * reached. * - * @see #testRegularIdentifier(adql.parser.Token) + * @return The corresponding ordered list of tokens. + * + * @throws ParseException If an unknown token is encountered. */ - public boolean isRegularIdentifier(final String idCandidate); + public Token[] tokenize(final String expr, final boolean stopAtEnd) throws ParseException { + // Start tokenizing the given expression: + /* (note: if the given expression is NULL, behave exactly as an empty + * string) */ + Tokenizer tokenizer = grammarParser.getTokenizer((expr == null) ? "" : expr); - public void testRegularIdentifier(final Token token) throws ParseException; + // Iterate over all the tokens: + try { + ArrayList<Token> tokens = new ArrayList<Token>(); + Token token = tokenizer.nextToken(); + while(token != null && (!stopAtEnd || !grammarParser.isEnd(token))) { + tokens.add(token); + token = tokenizer.nextToken(); + } + return tokens.toArray(new Token[tokens.size()]); + } catch(TokenMgrError err) { + // wrap such errors and propagate them: + throw new ParseException(err); + } + } /* ********************************************************************** - * FUNCTIONS JUST FOR JUNIT + * CORRECTION SUGGESTION * + ********************************************************************** */ + + /** + * Try fixing tokens/terms of the input ADQL query. + * + * <p> + * <b>This function does not try to fix syntactical or semantical errors.</b> + * It just try to fix the most common issues in ADQL queries, such as: + * </p> + * <ul> + * <li>some Unicode characters confusable with ASCII characters (like a + * space, a dash, ...) ; this function replace them by their ASCII + * alternative,</li> + * <li>any of the following are double quoted: + * <ul> + * <li>non regular ADQL identifiers + * (e.g. <code>_RAJ2000</code>),</li> + * <li>ADQL function names used as identifiers + * (e.g. <code>distance</code>)</li> + * <li>and SQL reserved keywords + * (e.g. <code>public</code>).</li> + * </ul> + * </li> + * </ul> + * + * <p><i><b>Note 1:</b> + * The given stream is NOT closed by this function even if the EOF is + * reached. It is the responsibility of the caller to close it. + * </i></p> + * + * <p><i><b>Note 2:</b> + * This function does not use any instance variable of this parser + * (especially the InputStream or Reader provided at initialisation or + * ReInit). + * </i></p> + * + * @param input Stream containing the input ADQL query to fix. + * + * @return The suggested correction of the input ADQL query. + * + * @throws java.io.IOException If there is any error while reading from the + * given input stream. + * @throws ParseException If any unrecognised character is encountered, + * or if anything else prevented the tokenization + * of some characters/words/terms. + * + * @see QueryFixer#fix(String) + * + * @since 1.5 + */ + public final String tryQuickFix(final InputStream input) throws IOException, ParseException { + // Fetch everything into a single string: + StringBuffer buf = new StringBuffer(); + byte[] cBuf = new byte[1024]; + int nbChar; + while((nbChar = input.read(cBuf)) > -1) { + buf.append(new String(cBuf, 0, nbChar)); + } + + // Convert the buffer into a String and now try to fix it: + return quickFixer.fix(buf.toString()); + } + + /** + * Try fixing tokens/terms of the given ADQL query. + * + * <p> + * <b>This function does not try to fix syntactical or semantical errors.</b> + * It just try to fix the most common issues in ADQL queries, such as: + * </p> + * <ul> + * <li>some Unicode characters confusable with ASCII characters (like a + * space, a dash, ...) ; this function replace them by their ASCII + * alternative,</li> + * <li>any of the following are double quoted: + * <ul> + * <li>non regular ADQL identifiers + * (e.g. <code>_RAJ2000</code>),</li> + * <li>ADQL function names used as identifiers + * (e.g. <code>distance</code>)</li> + * <li>and SQL reserved keywords + * (e.g. <code>public</code>).</li> + * </ul> + * </li> + * </ul> + * + * <p><i><b>Note:</b> + * This function does not use any instance variable of this parser + * (especially the InputStream or Reader provided at initialisation or + * ReInit). + * </i></p> + * + * @param adqlQuery The input ADQL query to fix. + * + * @return The suggested correction of the given ADQL query. + * + * @throws ParseException If any unrecognised character is encountered, + * or if anything else prevented the tokenization + * of some characters/words/terms. + * + * @see QueryFixer#fix(String) + * + * @since 1.5 + */ + public final String tryQuickFix(String adqlQuery) throws ParseException { + return quickFixer.fix(adqlQuery); + } + + /* ********************************************************************** + * MAIN FUNCTION * ********************************************************************** */ - ADQLOperand StringExpression() throws ParseException; + /** + * Parse the given ADQL query. + * + * <h3>Usage</h3> + * + * <pre>adqlParser.jar [--version=...] [-h] [-d] [-v] [-e] [-a|-s] [-f] [<FILE>|<URL>]</pre> + * + * <p><i><b>Note:</b> + * If no file or URL is given, the ADQL query is expected in the standard + * input. This query must end with a ';' or <Ctrl+D>! + * </i></p> + * + * <h3>Parameters</h3> + * + * <ul> + * <li><b><code>--version=...</code>:</b> + * Set the version of the ADQL grammar to follow. + * It must be one among: <i>v2.0, v2.1 (default)</i>.</li> + * <li><b><code>-h</code> or <code>--help</code>:</b> + * Display this help.</li> + * <li><b><code>-v</code> or <code>--verbose</code>:</b> + * Print the main steps of the parsing.</li> + * <li><b><code>-d</code> or <code>--debug</code>:</b> + * Print stack traces when a grave error occurs.</li> + * <li><b><code>-e</code> or <code>--explain</code>:</b> + * Explain the ADQL parsing (or Expand the parsing tree).</li> + * <li><b><code>-a</code> or <code>--adql</code>:</b> + * Display the understood ADQL query.</li> + * <li><b><code>-s</code> or <code>--sql</code>:</b> + * Ask the SQL translation of the given ADQL query (SQL compatible with + * PostgreSQL).</li> + * <li><b><code>-f</code> or <code>--try-fix</code>:</b> + * Try fixing the most common ADQL query issues before attempting to + * parse the query.</li> + * </ul> + * + * <h3>Return</h3> + * + * <p> + * By default, nothing if the query is correct. Otherwise a message + * explaining why the query is not correct is displayed. + * </p> + * + * <p> + * With the <code>-s</code> option, the SQL translation of the given ADQL query will be + * returned. + * </p> + * + * <p> + * With the <code>-a</code> option, the ADQL query is returned as it has been + * understood. + * </p> + * + * <h3>Exit status</h3> + * + * <ul> + * <li><b><code>0</code>:</b> + * OK!</li> + * <li><b><code>1</code>:</b> + * Parameter error (missing or incorrect parameter)</li> + * <li><b><code>2</code>:</b> + * File error (incorrect file/url, reading error, ...)</li> + * <li><b><code>3</code>:</b> + * Parsing error (syntactic or semantic error)</li> + * <li><b><code>4</code>:</b> + * Translation error (a problem has occurred during the translation of + * the given ADQL query in SQL).</li> + * </ul> + * + * @param args Program parameters. + * + * @throws Exception If any unexpected error occurs. + */ + public static final void main(String[] args) throws Exception { + final String USAGE = "Usage:\n adqlParser.jar [--version=...] [-h] [-d] [-v] [-e] [-a|-s] [-f] [<FILE>|<URL>]\n\nNOTE: If no file or URL is given, the ADQL query is expected in the standard\n input. This query must end with a ';' or <Ctrl+D>!\n\nParameters:\n --version=... : Set the version of the ADQL grammar to follow.\n It must be one among: " + getSupportedVersionsAsString() + "\n -h or --help : Display this help.\n -v or --verbose : Print the main steps of the parsing\n -d or --debug : Print stack traces when a grave error occurs\n -e or --explain : Explain the ADQL parsing (or Expand the parsing tree)\n -a or --adql : Display the understood ADQL query\n -s or --sql : Ask the SQL translation of the given ADQL query\n (SQL compatible with PostgreSQL)\n -f or --try-fix : Try fixing the most common ADQL query issues before\n attempting to parse the query.\n\nReturn:\n By default: nothing if the query is correct. Otherwise a message explaining\n why the query is not correct is displayed.\n With the -s option, the SQL translation of the given ADQL query will be\n returned.\n With the -a option, the ADQL query is returned as it has been understood.\n\nExit status:\n 0 OK !\n 1 Parameter error (missing or incorrect parameter)\n 2 File error (incorrect file/url, reading error, ...)\n 3 Parsing error (syntactic or semantic error)\n 4 Translation error (a problem has occurred during the translation of the\n given ADQL query in SQL)."; + final String NEED_HELP_MSG = "Try -h or --help to get more help about the usage of this program."; + final String urlRegex = "^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"; + + ADQLParser parser; + + short mode = -1; + String file = null; + ADQLVersion version = DEFAULT_VERSION; + boolean verbose = false, debug = false, explain = false, tryFix = false; + + // Parameters reading: + for(int i = 0; i < args.length; i++) { + if (args[i].startsWith("--version=")) { + String[] parts = args[i].split("="); + if (parts.length <= 1) { + System.err.println("((!)) Missing ADQL version! It must be one among: " + getSupportedVersionsAsString() + ". ((!))\n" + NEED_HELP_MSG); + System.exit(1); + } + version = ADQLVersion.parse(parts[1]); + if (version == null) { + System.err.println("((!)) Incorrect ADQL version: \"" + args[i].split("=")[1] + "\"! It must be one among: " + getSupportedVersionsAsString() + ". ((!))\n" + NEED_HELP_MSG); + System.exit(1); + } + } else if (args[i].equalsIgnoreCase("-d") || args[i].equalsIgnoreCase("--debug")) + debug = true; + else if (args[i].equalsIgnoreCase("-v") || args[i].equalsIgnoreCase("--verbose")) + verbose = true; + else if (args[i].equalsIgnoreCase("-e") || args[i].equalsIgnoreCase("--explain")) + explain = true; + else if (args[i].equalsIgnoreCase("-a") || args[i].equalsIgnoreCase("--adql")) { + if (mode != -1) { + System.err.println("((!)) Too much parameter: you must choose between -s, -c, -a or nothing ((!))\n" + NEED_HELP_MSG); + System.exit(1); + } else + mode = 1; + } else if (args[i].equalsIgnoreCase("-s") || args[i].equalsIgnoreCase("--sql")) { + if (mode != -1) { + System.err.println("((!)) Too much parameter: you must choose between -s, -c, -a or nothing ((!))\n" + NEED_HELP_MSG); + System.exit(1); + } else + mode = 2; + } else if (args[i].equalsIgnoreCase("-f") || args[i].equalsIgnoreCase("--try-fix")) + tryFix = true; + else if (args[i].equalsIgnoreCase("-h") || args[i].equalsIgnoreCase("--help")) { + System.out.println(USAGE); + System.exit(0); + } else if (args[i].startsWith("-")) { + System.err.println("((!)) Unknown parameter: \"" + args[i] + "\" ((!))\u005cn" + NEED_HELP_MSG); + System.exit(1); + } else + file = args[i].trim(); + } + + try { + + // Get the parser for the specified ADQL version: + parser = new ADQLParser(version); + + // Try fixing the query, if asked: + InputStream in = null; + if (tryFix) { + if (verbose) + System.out.println("((i)) Trying to automatically fix the query..."); + + try { + // get the input stream... + if (file == null || file.length() == 0) + in = System.in; + else if (file.matches(urlRegex)) + in = (new java.net.URL(file)).openStream(); + else + in = new java.io.FileInputStream(file); + + // ...and try fixing the query: + String query = parser.tryQuickFix(in); + + if (verbose) + System.out.println("((i)) SUGGESTED QUERY:\n" + query); + + // Initialize the parser with this fixed query: + in = new java.io.ByteArrayInputStream(query.getBytes()); + } catch(ParseException pe) { + System.out.println("((!)) Quick fix failure! Cause: " + pe.getMessage() + "."); + if (debug) + pe.printStackTrace(); + else + System.out.println(" (run again with -d for more details)"); + } finally { + // close the stream (if opened): + if (in != null) + in.close(); + in = null; + } + } + + // If no tryQuickFix (or if failed), take the query as provided: + if (in == null) { + // Initialise the parser with the specified input: + if (file == null || file.length() == 0) + in = System.in; + else if (file.matches(urlRegex)) + in = (new java.net.URL(file)).openStream(); + else + in = new java.io.FileInputStream(file); + } + + // Enable/Disable the debugging in function of the parameters: + parser.setDebug(explain); + + // Query parsing: + try { + if (verbose) + System.out.print("((i)) Parsing ADQL query..."); + ADQLQuery q = parser.parseQuery(in); + if (verbose) + System.out.println("((i)) CORRECT ADQL QUERY ((i))"); + if (mode == 2) { + PostgreSQLTranslator translator = new PostgreSQLTranslator(); + if (verbose) + System.out.print("((i)) Translating in SQL..."); + String sql = translator.translate(q); + if (verbose) + System.out.println("ok"); + System.out.println(sql); + } else if (mode == 1) { + System.out.println(q.toADQL()); + } + } catch(UnresolvedIdentifiersException uie) { + System.err.println("((X)) " + uie.getNbErrors() + " unresolved identifiers:"); + for(ParseException pe : uie) + System.err.println("\t - at " + pe.getPosition() + ": " + uie.getMessage()); + if (debug) + uie.printStackTrace(System.err); + System.exit(3); + } catch(ParseException pe) { + System.err.println("((X)) Syntax error: " + pe.getMessage() + " ((X))"); + if (debug) + pe.printStackTrace(System.err); + System.exit(3); + } catch(TranslationException te) { + if (verbose) + System.out.println("error"); + System.err.println("((X)) Translation error: " + te.getMessage() + " ((X))"); + if (debug) + te.printStackTrace(System.err); + System.exit(4); + } + + } catch(IOException ioe) { + System.err.println("\n((X)) Error while reading the file \"" + file + "\": " + ioe.getMessage() + " ((X))"); + if (debug) + ioe.printStackTrace(System.err); + System.exit(2); + } - public Token[] tokenize(final String expr) throws ParseException; + } } diff --git a/src/adql/parser/ADQLParser200.java b/src/adql/parser/ADQLParser200.java deleted file mode 100644 index c3f7eca3c63d9af88b8a67910fa38a7542d24778..0000000000000000000000000000000000000000 --- a/src/adql/parser/ADQLParser200.java +++ /dev/null @@ -1,6669 +0,0 @@ -/* ADQLParser200.java */ -/* Generated By:JavaCC: Do not edit this line. ADQLParser200.java */ -package adql.parser; - -import java.util.ArrayList; - -/* - * This file is part of ADQLLibrary. - * - * ADQLLibrary is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * ADQLLibrary is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2019 - UDS/Centre de Données astronomiques de Strasbourg (CDS) - */ - -import java.util.Stack; -import java.util.Vector; - -import adql.db.exception.UnresolvedIdentifiersException; -import adql.db.exception.UnsupportedFeatureException; -import adql.parser.ADQLParserFactory.ADQLVersion; -import adql.parser.ADQLQueryFactory.JoinType; -import adql.parser.IdentifierItems.IdentifierItem; -import adql.parser.feature.FeatureSet; -import adql.parser.feature.LanguageFeature; -import adql.query.ADQLObject; -import adql.query.ADQLOrder; -import adql.query.ADQLQuery; -import adql.query.ClauseADQL; -import adql.query.ClauseConstraints; -import adql.query.ClauseSelect; -import adql.query.SelectAllColumns; -import adql.query.SelectItem; -import adql.query.TextPosition; -import adql.query.constraint.ADQLConstraint; -import adql.query.constraint.Between; -import adql.query.constraint.Comparison; -import adql.query.constraint.ComparisonOperator; -import adql.query.constraint.ConstraintsGroup; -import adql.query.constraint.Exists; -import adql.query.constraint.In; -import adql.query.constraint.IsNull; -import adql.query.constraint.NotConstraint; -import adql.query.from.ADQLJoin; -import adql.query.from.FromContent; -import adql.query.operand.ADQLColumn; -import adql.query.operand.ADQLOperand; -import adql.query.operand.Concatenation; -import adql.query.operand.NegativeOperand; -import adql.query.operand.NumericConstant; -import adql.query.operand.Operation; -import adql.query.operand.OperationType; -import adql.query.operand.StringConstant; -import adql.query.operand.WrappedOperand; -import adql.query.operand.function.ADQLFunction; -import adql.query.operand.function.MathFunction; -import adql.query.operand.function.MathFunctionType; -import adql.query.operand.function.SQLFunction; -import adql.query.operand.function.SQLFunctionType; -import adql.query.operand.function.UserDefinedFunction; -import adql.query.operand.function.geometry.GeometryFunction; -import adql.query.operand.function.geometry.GeometryFunction.GeometryValue; -import adql.query.operand.function.geometry.PointFunction; -import adql.search.SearchOptionalFeaturesHandler; - -/** -* Parses an ADQL-2.0 query thanks to the {@link ADQLParser200#Query() Query()} function. -* -* <p> -* This parser is able, thanks to a {@link QueryChecker} object, to check each -* {@link 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 {@link QueryChecker}. Thus -* you must extend {@link QueryChecker} to check semantically all generated -* ADQLQuery objects. -* </p> -* -* <p> -* To create an object representation of the given ADQL query, this parser uses -* a {@link 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 {@link ADQLQueryFactory} -* (ie. createContains(...)). -* </p> -* -* <p>Here are the key functions to use:</p> -* <ul> -* <li>{@link #parseQuery(java.lang.String)} (or any of its alternatives) -* to parse an input ADQL query String and get its corresponding ADQL tree -* </li> -* <li>{@link #tryQuickFix(java.lang.String)} to try fixing the most common -* issues with ADQL queries (e.g. Unicode confusable characters, -* unescaped ADQL identifiers, SQL reserved keywords, ...)</li> -* </ul> -* -* <p><b><u>WARNING:</u> -* To modify this class it's strongly encouraged to modify the .jj file in the -* section between <i>PARSER_BEGIN</i> and <i>PARSER_END</i> and to re-compile -* it with JavaCC. -* </b></p> -* -* @see QueryChecker -* @see ADQLQueryFactory -* -* @author Grégory Mantelet (CDS) -* @version 2.0 (07/2019) -* @since 2.0 -*/ -public class ADQLParser200 implements ADQLParser, ADQLParser200Constants { - - /** Tools to build the object representation of the ADQL query. */ - private ADQLQueryFactory queryFactory = new ADQLQueryFactory(); - - /** Default set of supported language features. - * <p><i><b>Note:</b> - * By default, all optional features are supported. - * </i></p> */ - private FeatureSet supportedFeatures = new FeatureSet(false, true); - - /** The stack of queries (because there may be some sub-queries). */ - private Stack<ADQLQuery> stackQuery = new Stack<ADQLQuery>(); - - /** The object representation of the ADQL query to parse. - * (ONLY USED DURING THE PARSING, else it is always <i>null</i>). */ - private ADQLQuery query = null; - - /** Checks each {@link ADQLQuery} (sub-query or not) just after their - * generation. */ - private QueryChecker queryChecker = null; - - /** The first token of a table/column name. This token is extracted by - * {@link #Identifier()}. */ - private Token currentIdentifierToken = null; - - /** - * Builds an ADQL parser without a query to parse. - */ - public ADQLParser200() { - this(new java.io.ByteArrayInputStream("".getBytes())); - supportedFeatures.supportAll(LanguageFeature.TYPE_ADQL_GEO); - setDebug(false); - } - - /** - * Builds an ADQL parser without a query to parse but with a - * {@link QueryChecker} and a {@link ADQLQueryFactory}. - * - * @param checker The object to use to check each {@link ADQLQuery}. - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser200(QueryChecker checker, ADQLQueryFactory factory) { - this(); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds an ADQL parser without a query to parse but with a - * {@link QueryChecker}. - * - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser200(QueryChecker checker) { - this(checker, null); - } - - /** - * Builds an ADQL parser without a query to parse but with a - * {@link ADQLQueryFactory}. - * - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser200(ADQLQueryFactory factory) { - this((QueryChecker)null, factory); - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param checker The object to use to check each {@link ADQLQuery}. - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser200(java.io.InputStream stream, QueryChecker checker, ADQLQueryFactory factory) { - this(stream); - - supportedFeatures.supportAll(LanguageFeature.TYPE_ADQL_GEO); - - setDebug(false); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser200(java.io.InputStream stream, QueryChecker checker) { - this(stream, checker, null); - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser200(java.io.InputStream stream, ADQLQueryFactory factory) { - this(stream, (QueryChecker)null, factory); - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param encoding The supplied encoding. - * @param checker The object to use to check each {@link ADQLQuery}. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser200(java.io.InputStream stream, String encoding, QueryChecker checker, ADQLQueryFactory factory) { - this(stream, encoding); - - supportedFeatures.supportAll(LanguageFeature.TYPE_ADQL_GEO); - - setDebug(false); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param encoding The supplied encoding. - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser200(java.io.InputStream stream, String encoding, QueryChecker checker) { - this(stream, encoding, checker, null); - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param encoding The supplied encoding. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser200(java.io.InputStream stream, String encoding, ADQLQueryFactory factory) { - this(stream, encoding, null, factory); - } - - /** - * Builds a parser with a reader containing the query to parse. - * - * @param reader The reader in which the ADQL query to parse is given. - * @param checker The object to use to check each {@link ADQLQuery}. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser200(java.io.Reader reader, QueryChecker checker, ADQLQueryFactory factory) { - this(reader); - - supportedFeatures.supportAll(LanguageFeature.TYPE_ADQL_GEO); - - setDebug(false); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds a parser with a reader containing the query to parse. - * - * @param reader The reader in which the ADQL query to parse is given. - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser200(java.io.Reader reader, QueryChecker checker) { - this(reader, checker, null); - } - - /** - * Builds a parser with a reader containing the query to parse. - * - * @param reader The reader in which the ADQL query to parse is given. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser200(java.io.Reader reader, ADQLQueryFactory factory) { - this(reader, null, factory); - } - - /** - * Builds a parser with another token manager. - * - * @param tm The manager which associates a token to a numeric code. - * @param checker The object to use to check each {@link ADQLQuery }. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser200(ADQLParser200TokenManager tm, QueryChecker checker, ADQLQueryFactory factory) { - this(tm); - - supportedFeatures.supportAll(LanguageFeature.TYPE_ADQL_GEO); - - setDebug(false); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds a parser with another token manager. - * - * @param tm The manager which associates a token to a numeric code. - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser200(ADQLParser200TokenManager tm, QueryChecker checker) { - this(tm, checker, null); - } - - /** - * Builds a parser with another token manager. - * - * @param tm The manager which associates a token to a numeric code. - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser200(ADQLParser200TokenManager tm, ADQLQueryFactory factory) { - this(tm, null, factory); - } - - /* ADDITIONAL GETTERS & SETTERS */ - - @Override - public final ADQLVersion getADQLVersion() { - return ADQLVersion.V2_0; - } - - @Override - public final void setDebug(boolean debug) { - if (debug) - enable_tracing(); - else - disable_tracing(); - } - - @Override - public final QueryChecker getQueryChecker() { - return queryChecker; - } - - @Override - public final void setQueryChecker(QueryChecker checker) { - queryChecker = checker; - } - - @Override - public final ADQLQueryFactory getQueryFactory() { - return queryFactory; - } - - @Override - public final void setQueryFactory(ADQLQueryFactory factory) { - queryFactory = (factory != null) ? factory : (new ADQLQueryFactory()); - } - - @Override - public final FeatureSet getSupportedFeatures() { - return supportedFeatures; - } - - @Override - public void setSupportedFeatures(final FeatureSet features) { - if (features != null) - supportedFeatures = features; - } - - /* EXCEPTION HELPER FUNCTION */ - - private final ParseException generateParseException(Exception ex) { - if (!(ex instanceof ParseException)) { - ParseException pex = new ParseException("[" + ex.getClass().getName() + "] " + ex.getMessage()); - pex.setStackTrace(ex.getStackTrace()); - return pex; - } else - return (ParseException)ex; - } - - /* QUERY PARSING FUNCTIONS */ - - /** - * Tell whether the given string is a valid ADQL regular identifier. - * - * <p> - * According to the ADQL-2.0's BNF, a regular identifier (i.e. not delimited - * ; not between double quotes) must be a letter followed by a letter, digit - * or underscore. So, the following regular expression: - * </p> - * <pre>[a-zA-Z]+[a-zA-Z0-9_]*</pre> - * - * <p>This is what this function tests on the given string.</p> - * - * @param idCandidate The string to test. - * - * @return <code>true</code> if the given string is a valid regular - * identifier, - * <code>false</code> otherwise. - * - * @see #testRegularIdentifier(adql.parser.Token) - * - * @since 1.5 - */ - @Override - public final boolean isRegularIdentifier(final String idCandidate) { - return idCandidate.matches("[a-zA-Z]+[a-zA-Z0-9_]*"); - } - - /** - * Test the given token as an ADQL's regular identifier. - * - * <p> - * This function uses {@link #isRegularIdentifier(java.lang.String)} to - * test the given token's image. If the test fails, a - * {@link adql.parser.ParseException} is thrown. - * </p> - * - * @param token The token to test. - * - * @throws ParseException If the given token is not a valid ADQL regular - * identifier. - * - * @see #isRegularIdentifier(java.lang.String) - * - * @since 1.5 - */ - @Override - public final void testRegularIdentifier(final Token token) throws ParseException { - if (!isRegularIdentifier(token.image)) - throw new ParseException("Invalid ADQL regular identifier: \u005c"" + token.image + "\u005c"! If it aims to be a column/table name/alias, you should write it between double quotes.", new TextPosition(token)); - } - - /** - * Parses the query given at the creation of this parser or in the - * <i>ReInit</i> functions. - * - * @return The object representation of the given ADQL query. - * - * @throws ParseException If there is at least one syntactic error. - * - * @see ADQLParser200#Query() - */ - @Override - public final ADQLQuery parseQuery() throws ParseException { - stackQuery.clear(); - query = null; - try { - return Query(); - } catch(TokenMgrError tme) { - throw new ParseException(tme); - } - } - - /** - * Parses the query given in parameter. - * - * @param q The ADQL query to parse. - * - * @return The object representation of the given ADQL query. - * - * @throws ParseException If there is at least one syntactic error. - * - * @see ADQLParser200#ReInit(java.io.InputStream) - * @see ADQLParser200#setDebug(boolean) - * @see ADQLParser200#Query() - */ - @Override - public final ADQLQuery parseQuery(String q) throws ParseException { - stackQuery.clear(); - query = null; - ReInit(new java.io.ByteArrayInputStream(q.getBytes())); - try { - return Query(); - } catch(TokenMgrError tme) { - throw new ParseException(tme); - } - } - - /** - * Parses the query contained in the stream given in parameter. - * - * @param stream The stream which contains the ADQL query to parse. - * - * @return The object representation of the given ADQL query. - * - * @throws ParseException If there is at least one syntactic error. - * - * @see ADQLParser200#ReInit(java.io.InputStream) - * @see ADQLParser200#setDebug(boolean) - * @see ADQLParser200#Query() - */ - @Override - public final ADQLQuery parseQuery(java.io.InputStream stream) throws ParseException { - stackQuery.clear(); - query = null; - ReInit(stream); - try { - return Query(); - } catch(TokenMgrError tme) { - throw new ParseException(tme); - } - } - - @Override - public final ClauseSelect parseSelect(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_0); - - // Parse the string as a SELECT clause: - Select(); - - // Return what's just got parsed: - return query.getSelect(); - - } catch(TokenMgrError tme) { - throw new ParseException(tme); - } catch(Exception ex) { - throw generateParseException(ex); - } - } - - @Override - public final FromContent parseFrom(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_0); - - // Parse the string as a FROM clause: - From(); - - // Return what's just got parsed: - return query.getFrom(); - - } catch(TokenMgrError tme) { - throw new ParseException(tme); - } catch(Exception ex) { - throw generateParseException(ex); - } - } - - @Override - public final ClauseConstraints parseWhere(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_0); - - // Parse the string as a WHERE clause: - Where(); - - // Return what's just got parsed: - return query.getWhere(); - - } catch(TokenMgrError tme) { - throw new ParseException(tme); - } catch(Exception ex) { - throw generateParseException(ex); - } - } - - @Override - public final ClauseADQL<ADQLOrder> parseOrderBy(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_0); - - // Parse the string as a ORDER BY clause: - OrderBy(); - - // Return what's just got parsed: - return query.getOrderBy(); - - } catch(TokenMgrError tme) { - throw new ParseException(tme); - } catch(Exception ex) { - throw generateParseException(ex); - } - } - - @Override - public final ClauseADQL<ADQLColumn> parseGroupBy(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_0); - - // Parse the string as a GROUP BY clause: - GroupBy(); - - // Return what's just got parsed: - return query.getGroupBy(); - - } catch(TokenMgrError tme) { - throw new ParseException(tme); - } catch(Exception ex) { - throw generateParseException(ex); - } - } - - /* TOKENIZATION FUNCTION */ - - @Override - public Token[] tokenize(final String expr) throws ParseException { - ADQLParser200TokenManager parser = new ADQLParser200TokenManager(new SimpleCharStream(new java.io.ByteArrayInputStream(expr.getBytes()))); - try { - ArrayList<Token> tokens = new ArrayList<Token>(); - Token token; - while(!isEnd((token = parser.getNextToken()))) { - tokens.add(token); - } - return tokens.toArray(new Token[tokens.size()]); - } catch(TokenMgrError err) { - // wrap such errors and propagate them: - throw new ParseException(err); - } - } - - /* CORRECTION SUGGESTION */ - - /** - * Try fixing tokens/terms of the input ADQL query. - * - * <p> - * <b>This function does not try to fix syntactical or semantical errors.</b> - * It just try to fix the most common issues in ADQL queries, such as: - * </p> - * <ul> - * <li>some Unicode characters confusable with ASCII characters (like a - * space, a dash, ...) ; this function replace them by their ASCII - * alternative,</li> - * <li>any of the following are double quoted: - * <ul> - * <li>non regular ADQL identifiers - * (e.g. <code>_RAJ2000</code>),</li> - * <li>ADQL function names used as identifiers - * (e.g. <code>distance</code>)</li> - * <li>and SQL reserved keywords - * (e.g. <code>public</code>).</li> - * </ul> - * </li> - * </ul> - * - * <p><i><b>Note 1:</b> - * The given stream is NOT closed by this function even if the EOF is - * reached. It is the responsibility of the caller to close it. - * </i></p> - * - * <p><i><b>Note 2:</b> - * This function does not use any instance variable of this parser - * (especially the InputStream or Reader provided at initialisation or - * ReInit). - * </i></p> - * - * @param input Stream containing the input ADQL query to fix. - * - * @return The suggested correction of the input ADQL query. - * - * @throws java.io.IOException If there is any error while reading from the - * given input stream. - * @throws ParseException If any unrecognised character is encountered, - * or if anything else prevented the tokenization - * of some characters/words/terms. - * - * @see #tryQuickFix(java.lang.String) - * - * @since 1.5 - */ - @Override - public final String tryQuickFix(final java.io.InputStream input) throws java.io.IOException, ParseException { - // Fetch everything into a single string: - StringBuffer buf = new StringBuffer(); - byte[] cBuf = new byte[1024]; - int nbChar; - while((nbChar = input.read(cBuf)) > -1) { - buf.append(new String(cBuf, 0, nbChar)); - } - - // Convert the buffer into a String and now try to fix it: - return tryQuickFix(buf.toString()); - } - - /** - * Try fixing tokens/terms of the given ADQL query. - * - * <p> - * <b>This function does not try to fix syntactical or semantical errors.</b> - * It just try to fix the most common issues in ADQL queries, such as: - * </p> - * <ul> - * <li>some Unicode characters confusable with ASCII characters (like a - * space, a dash, ...) ; this function replace them by their ASCII - * alternative,</li> - * <li>any of the following are double quoted: - * <ul> - * <li>non regular ADQL identifiers - * (e.g. <code>_RAJ2000</code>),</li> - * <li>ADQL function names used as identifiers - * (e.g. <code>distance</code>)</li> - * <li>and SQL reserved keywords - * (e.g. <code>public</code>).</li> - * </ul> - * </li> - * </ul> - * - * <p><i><b>Note:</b> - * This function does not use any instance variable of this parser - * (especially the InputStream or Reader provided at initialisation or - * ReInit). - * </i></p> - * - * @param adqlQuery The input ADQL query to fix. - * - * @return The suggested correction of the given ADQL query. - * - * @throws ParseException If any unrecognised character is encountered, - * or if anything else prevented the tokenization - * of some characters/words/terms. - * - * @since 1.5 - */ - @Override - public String tryQuickFix(String adqlQuery) throws ParseException { - StringBuffer suggestedQuery = new StringBuffer(); - - // 1. Replace all Unicode confusable characters: - adqlQuery = replaceUnicodeConfusables(adqlQuery); - - /* 1.bis. Normalise new lines and tabulations - * (to simplify the column counting): */ - adqlQuery = adqlQuery.replaceAll("(\u005cr\u005cn|\u005cr|\u005cn)", System.getProperty("line.separator")).replaceAll("\u005ct", " "); - - // 2. Analyse the query token by token: - ADQLParser200TokenManager parser = new ADQLParser200TokenManager(new SimpleCharStream(new java.io.ByteArrayInputStream(adqlQuery.getBytes()))); - - final String[] lines = adqlQuery.split(System.getProperty("line.separator")); - - try { - String suggestedToken; - int lastLine = 1, lastCol = 1; - - Token token = null, nextToken = parser.getNextToken(); - // for all tokens until the EOF or EOQ: - do { - // get the next token: - token = nextToken; - nextToken = (isEnd(token) ? null : parser.getNextToken()); - - // 3. Double quote any suspect token: - if (mustEscape(token, nextToken)) { - suggestedToken = "\u005c"" + token.image + "\u005c""; - } else - suggestedToken = token.image; - - /* 4. Append all space characters (and comments) before the - * token: */ - /* same line, just get the space characters between the last - * token and the one to append: */ - if (lastLine == token.beginLine) { - if (token.kind == ADQLParser200Constants.EOF) - suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1)); - else - suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1, token.beginColumn - (isEnd(token) ? 0 : 1))); - lastCol = token.endColumn + 1; - } - // not the same line... - else { - /* append all remaining space characters until the position - * of the token to append: */ - do { - suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1)).append('\u005cn'); - lastLine++; - lastCol = 1; - } while(lastLine < token.beginLine); - /* if there are still space characters before the token, - * append them as well: */ - if (lastCol < token.beginColumn) - suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1, token.beginColumn - 1)); - // finally, set the correct column position: - lastCol = token.endColumn + 1; - } - - // 5. Append the suggested token: - suggestedQuery.append(suggestedToken); - - } while(!isEnd(token)); - - } catch(TokenMgrError err) { - // wrap such errors and propagate them: - throw new ParseException(err); - } - - return suggestedQuery.toString(); - } - - /** - * All of the most common Unicode confusable characters and their - * ASCII/UTF-8 alternative. - * - * <p> - * Keys of this map represent the ASCII character while the values are the - * regular expression for all possible Unicode alternatives. - * </p> - * - * <p><i><b>Note:</b> - * All of them have been listed using - * <a href="https://unicode.org/cldr/utility/confusables.jsp">Unicode Utilities: Confusables</a>. - * </i></p> - * - * @since 1.5 - */ - protected final static java.util.Map<String, String> REGEX_UNICODE_CONFUSABLES = new java.util.HashMap<String, String>(10); - /** Regular expression matching all Unicode alternatives for <code>-</code>. - * @since 1.5 */ - protected final static String REGEX_DASH = "[-\u02d7\u06d4\u2010\u2011\u2012\u2013\u2043\u2212\u2796\u2cba\ufe58\u2014\u2015\u207b\u208b\u0096\u058a\ufe63\uff0d]"; - /** Regular expression matching all Unicode alternatives for <code>_</code>. - * @since 1.5 */ - protected final static String REGEX_UNDERSCORE = "[_\u07fa\ufe4d\ufe4e\ufe4f]"; - /** Regular expression matching all Unicode alternatives for <code>'</code>. - * @since 1.5 */ - protected final static String REGEX_QUOTE = "['`\u00b4\u02b9\u02bb\u02bc\u02bd\u02be\u02c8\u02ca\u02cb\u02f4\u0374\u0384\u055a\u055d\u05d9\u05f3\u07f4\u07f5\u144a\u16cc\u1fbd\u1fbf\u1fef\u1ffd\u1ffe\u2018\u2019\u201b\u2032\u2035\ua78c\uff07\uff40]"; - /** Regular expression matching all Unicode alternatives for <code>"</code>. - * @since 1.5 */ - protected final static String REGEX_DOUBLE_QUOTE = "[\u02ba\u02dd\u02ee\u02f6\u05f2\u05f4\u1cd3\u201c\u201d\u201f\u2033\u2036\u3003\uff02]"; - /** Regular expression matching all Unicode alternatives for <code>.</code>. - * @since 1.5 */ - protected final static String REGEX_STOP = "[.\u0660\u06f0\u0701\u0702\u2024\ua4f8\ua60e]"; - /** Regular expression matching all Unicode alternatives for <code>+</code>. - * @since 1.5 */ - protected final static String REGEX_PLUS = "[+\u16ed\u2795]"; - /** Regular expression matching all Unicode alternatives for <code> </code>. - * @since 1.5 */ - protected final static String REGEX_SPACE = "[ \u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f]"; - /** Regular expression matching all Unicode alternatives for <code><</code>. - * @since 1.5 */ - protected final static String REGEX_LESS_THAN = "[<\u02c2\u1438\u16b2\u2039\u276e]"; - /** Regular expression matching all Unicode alternatives for <code>></code>. - * @since 1.5 */ - protected final static String REGEX_GREATER_THAN = "[>\u02c3\u1433\u203a\u276f]"; - /** Regular expression matching all Unicode alternatives for <code>=</code>. - * @since 1.5 */ - protected final static String REGEX_EQUAL = "[=\u1400\u2e40\u30a0\ua4ff]"; - static { - REGEX_UNICODE_CONFUSABLES.put("-", REGEX_DASH); - REGEX_UNICODE_CONFUSABLES.put("_", REGEX_UNDERSCORE); - REGEX_UNICODE_CONFUSABLES.put("'", REGEX_QUOTE); - REGEX_UNICODE_CONFUSABLES.put("\u005c"", REGEX_DOUBLE_QUOTE); - REGEX_UNICODE_CONFUSABLES.put(".", REGEX_STOP); - REGEX_UNICODE_CONFUSABLES.put("+", REGEX_PLUS); - REGEX_UNICODE_CONFUSABLES.put(" ", REGEX_SPACE); - REGEX_UNICODE_CONFUSABLES.put("<", REGEX_LESS_THAN); - REGEX_UNICODE_CONFUSABLES.put(">", REGEX_GREATER_THAN); - REGEX_UNICODE_CONFUSABLES.put("=", REGEX_EQUAL); - } - - /** - * Replace all Unicode characters that can be confused with other ASCI/UTF-8 - * characters (e.g. different spaces, dashes, ...) in their ASCII version. - * - * @param adqlQuery The ADQL query string in which Unicode confusable - * characters must be replaced. - * - * @return The same query without the most common Unicode confusable - * characters. - * - * @since 1.5 - */ - protected String replaceUnicodeConfusables(final String adqlQuery) { - String newAdqlQuery = adqlQuery; - for(java.util.Map.Entry<String, String> confusable : REGEX_UNICODE_CONFUSABLES.entrySet()) - newAdqlQuery = newAdqlQuery.replaceAll(confusable.getValue(), confusable.getKey()); - return newAdqlQuery; - } - - /** - * Tell whether the given token represents the end of an ADQL query. - * - * @param token Token to analyze. - * - * @return <code>true</code> if the given token represents a query end, - * <code>false</code> otherwise. - * - * @since 1.5 - */ - protected boolean isEnd(final Token token) { - return token.kind == ADQLParser200Constants.EOF || token.kind == ADQLParser200Constants.EOQ; - } - - /** - * Tell whether the given token must be double quoted. - * - * <p> - * This function considers all the following as terms to double quote: - * </p> - * <ul> - * <li>SQL reserved keywords</li>, - * <li>unrecognised regular identifiers (e.g. neither a delimited nor a - * valid ADQL regular identifier)</li> - * <li>and ADQL function name without a parameters list.</li> - * </ul> - * - * @param token The token to analyze. - * @param nextToken The following token. (useful to detect the start of a - * function's parameters list) - * - * @return <code>true</code> if the given token must be double quoted, - * <code>false</code> to keep it as provided. - * - * @since 1.5 - */ - protected boolean mustEscape(final Token token, final Token nextToken) { - switch(token.kind) { - case ADQLParser200Constants.SQL_RESERVED_WORD: - return true; - case ADQLParser200Constants.REGULAR_IDENTIFIER_CANDIDATE: - return !isRegularIdentifier(token.image); - default: - return token.isFunctionName && (nextToken == null || nextToken.kind != ADQLParser200Constants.LEFT_PAR); - } - } - - /* ########## */ - /* # SYNTAX # */ - /* ########## */ - - /* ******************* */ - /* GENERAL ADQL SYNTAX */ - /* ******************* */ - /** - * Parses the ADQL query given at the parser creation or in the {@link ADQLParser200#ReInit(java.io.InputStream)} - * or in the <i>parseQuery</i> functions. - * - * @return The object representation of the query. - * @throws ParseException If the query syntax is incorrect. - */ - final public ADQLQuery Query() throws ParseException { - trace_call("Query"); - try { - ADQLQuery q = null; - q = QueryExpression(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case 0: { - jj_consume_token(0); - break; - } - case EOQ: { - jj_consume_token(EOQ); - break; - } - default: - jj_la1[0] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - /* check the optional features before any other check: - * (note: this check is very close to grammar check...hence its higher - * priority) */ - UnresolvedIdentifiersException exUnsupportedFeatures = new UnresolvedIdentifiersException("unsupported expression"); - SearchOptionalFeaturesHandler sFeaturesHandler = new SearchOptionalFeaturesHandler(true, false); - sFeaturesHandler.search(q); - for(ADQLObject obj : sFeaturesHandler) { - if (!supportedFeatures.isSupporting(obj.getFeatureDescription())) - exUnsupportedFeatures.addException(new UnsupportedFeatureException(obj)); - } - if (exUnsupportedFeatures.getNbErrors() > 0) { - if (true) - throw exUnsupportedFeatures; - } - - // check the query: - if (queryChecker != null) - queryChecker.check(q); - - { - if ("" != null) - return q; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("Query"); - } - } - - final public ADQLQuery QueryExpression() throws ParseException { - trace_call("QueryExpression"); - try { - TextPosition endPos = null; - try { - // create the query: - query = queryFactory.createQuery(ADQLVersion.V2_0); - stackQuery.push(query); - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - Select(); - From(); - endPos = query.getFrom().getPosition(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case WHERE: { - Where(); - endPos = query.getWhere().getPosition(); - break; - } - default: - jj_la1[1] = jj_gen; - ; - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case GROUP: { - GroupBy(); - endPos = query.getGroupBy().getPosition(); - break; - } - default: - jj_la1[2] = jj_gen; - ; - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case HAVING: { - Having(); - endPos = query.getHaving().getPosition(); - break; - } - default: - jj_la1[3] = jj_gen; - ; - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ORDER: { - OrderBy(); - endPos = query.getOrderBy().getPosition(); - break; - } - default: - jj_la1[4] = jj_gen; - ; - } - // set the position of the query: - query.setPosition(new TextPosition(query.getSelect().getPosition(), endPos)); - - // get the previous query (!= null if the current query is a sub-query): - ADQLQuery previousQuery = stackQuery.pop(); - if (stackQuery.isEmpty()) - query = null; - else - query = stackQuery.peek(); - - { - if ("" != null) - return previousQuery; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("QueryExpression"); - } - } - - final public ADQLQuery SubQueryExpression() throws ParseException { - trace_call("SubQueryExpression"); - try { - ADQLQuery q = null; - Token start, end; - start = jj_consume_token(LEFT_PAR); - q = QueryExpression(); - end = jj_consume_token(RIGHT_PAR); - q.setPosition(new TextPosition(start, end)); - { - if ("" != null) - return q; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("SubQueryExpression"); - } - } - - final public void Select() throws ParseException { - trace_call("Select"); - try { - ClauseSelect select = query.getSelect(); - SelectItem item = null; - Token start, t = null; - start = jj_consume_token(SELECT); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case QUANTIFIER: { - t = jj_consume_token(QUANTIFIER); - select.setDistinctColumns(t.image.equalsIgnoreCase("DISTINCT")); - break; - } - default: - jj_la1[5] = jj_gen; - ; - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case TOP: { - jj_consume_token(TOP); - t = jj_consume_token(UNSIGNED_INTEGER); - try { - select.setLimit(Integer.parseInt(t.image)); - } catch(NumberFormatException nfe) { - { - if (true) - throw new ParseException("[l." + t.beginLine + ";c." + t.beginColumn + "] The TOP limit (\u005c"" + t.image + "\u005c") isn't a regular unsigned integer !"); - } - } - break; - } - default: - jj_la1[6] = jj_gen; - ; - } - item = SelectItem(); - select.add(item); - label_1: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[7] = jj_gen; - break label_1; - } - jj_consume_token(COMMA); - item = SelectItem(); - select.add(item); - } - TextPosition lastItemPos = query.getSelect().get(query.getSelect().size() - 1).getPosition(); - select.setPosition(new TextPosition(start.beginLine, start.beginColumn, lastItemPos.endLine, lastItemPos.endColumn)); - } finally { - trace_return("Select"); - } - } - - final public SelectItem SelectItem() throws ParseException { - trace_call("SelectItem"); - try { - IdentifierItems identifiers = new IdentifierItems(true); - IdentifierItem id = null, label = null; - ADQLOperand op = null; - SelectItem item; - Token starToken; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASTERISK: { - starToken = jj_consume_token(ASTERISK); - item = new SelectAllColumns(query); - item.setPosition(new TextPosition(starToken)); - { - if ("" != null) - return item; - } - break; - } - default: - jj_la1[12] = jj_gen; - if (jj_2_1(7)) { - id = Identifier(); - jj_consume_token(DOT); - identifiers.append(id); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - id = Identifier(); - jj_consume_token(DOT); - identifiers.append(id); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - id = Identifier(); - jj_consume_token(DOT); - identifiers.append(id); - break; - } - default: - jj_la1[8] = jj_gen; - ; - } - break; - } - default: - jj_la1[9] = jj_gen; - ; - } - starToken = jj_consume_token(ASTERISK); - try { - item = new SelectAllColumns(queryFactory.createTable(identifiers, null)); - TextPosition firstPos = identifiers.get(0).position; - item.setPosition(new TextPosition(firstPos.beginLine, firstPos.beginColumn, starToken.endLine, (starToken.endColumn < 0) ? -1 : (starToken.endColumn + 1))); - { - if ("" != null) - return item; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: - case PLUS: - case MINUS: - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: - case BOX: - case CENTROID: - case CIRCLE: - case POINT: - case POLYGON: - case REGION: - case CONTAINS: - case INTERSECTS: - case AREA: - case COORD1: - case COORD2: - case COORDSYS: - case DISTANCE: - case ABS: - case CEILING: - case DEGREES: - case EXP: - case FLOOR: - case LOG: - case LOG10: - case MOD: - case PI: - case POWER: - case RADIANS: - case RAND: - case ROUND: - case SQRT: - case TRUNCATE: - case ACOS: - case ASIN: - case ATAN: - case ATAN2: - case COS: - case COT: - case SIN: - case TAN: - case STRING_LITERAL: - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - op = ValueExpression(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AS: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AS: { - jj_consume_token(AS); - break; - } - default: - jj_la1[10] = jj_gen; - ; - } - label = Identifier(); - break; - } - default: - jj_la1[11] = jj_gen; - ; - } - break; - } - default: - jj_la1[13] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - try { - item = queryFactory.createSelectItem(op, (label == null) ? null : label.identifier); - if (label != null) { - item.setCaseSensitive(label.caseSensitivity); - item.setPosition(new TextPosition(op.getPosition(), label.position)); - } else - item.setPosition(new TextPosition(op.getPosition())); - { - if ("" != null) - return item; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("SelectItem"); - } - } - - final public void From() throws ParseException { - trace_call("From"); - try { - FromContent content = null, content2 = null; - try { - jj_consume_token(FROM); - content = TableRef(); - label_2: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[14] = jj_gen; - break label_2; - } - jj_consume_token(COMMA); - content2 = TableRef(); - TextPosition startPos = content.getPosition(), endPos = content2.getPosition(); - content = queryFactory.createJoin(JoinType.CROSS, content, content2); - content.setPosition(new TextPosition(startPos, endPos)); - } - query.setFrom(content); - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - } finally { - trace_return("From"); - } - } - - final public void Where() throws ParseException { - trace_call("Where"); - try { - ClauseConstraints where = query.getWhere(); - ADQLConstraint condition; - Token start; - start = jj_consume_token(WHERE); - ConditionsList(where); - TextPosition endPosition = where.getPosition(); - where.setPosition(new TextPosition(start.beginLine, start.beginColumn, endPosition.endLine, endPosition.endColumn)); - } finally { - trace_return("Where"); - } - } - - final public void GroupBy() throws ParseException { - trace_call("GroupBy"); - try { - ClauseADQL<ADQLColumn> groupBy = query.getGroupBy(); - ADQLColumn colRef = null; - Token start; - start = jj_consume_token(GROUP); - jj_consume_token(BY); - colRef = Column(); - groupBy.add(colRef); - label_3: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[15] = jj_gen; - break label_3; - } - jj_consume_token(COMMA); - colRef = Column(); - groupBy.add(colRef); - } - groupBy.setPosition(new TextPosition(start.beginLine, start.beginColumn, colRef.getPosition().endLine, colRef.getPosition().endColumn)); - } finally { - trace_return("GroupBy"); - } - } - - final public void Having() throws ParseException { - trace_call("Having"); - try { - ClauseConstraints having = query.getHaving(); - Token start; - start = jj_consume_token(HAVING); - ConditionsList(having); - TextPosition endPosition = having.getPosition(); - having.setPosition(new TextPosition(start.beginLine, start.beginColumn, endPosition.endLine, endPosition.endColumn)); - } finally { - trace_return("Having"); - } - } - - final public void OrderBy() throws ParseException { - trace_call("OrderBy"); - try { - ClauseADQL<ADQLOrder> orderBy = query.getOrderBy(); - ADQLOrder order = null; - Token start; - start = jj_consume_token(ORDER); - jj_consume_token(BY); - order = OrderItem(); - orderBy.add(order); - label_4: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[16] = jj_gen; - break label_4; - } - jj_consume_token(COMMA); - order = OrderItem(); - orderBy.add(order); - } - orderBy.setPosition(new TextPosition(start, token)); - } finally { - trace_return("OrderBy"); - } - } - - /* *************************** */ - /* COLUMN AND TABLE REFERENCES */ - /* *************************** */ - final public IdentifierItem Identifier() throws ParseException { - trace_call("Identifier"); - try { - Token t; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case REGULAR_IDENTIFIER_CANDIDATE: { - t = jj_consume_token(REGULAR_IDENTIFIER_CANDIDATE); - testRegularIdentifier(t); - { - if ("" != null) - return new IdentifierItem(t, false); - } - break; - } - case DELIMITED_IDENTIFIER: { - t = jj_consume_token(DELIMITED_IDENTIFIER); - { - if ("" != null) - return new IdentifierItem(t, true); - } - break; - } - default: - jj_la1[17] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("Identifier"); - } - } - - /** - * Extracts the name of a table with its possible catalog and schema prefixes. - * - * @return A {@link IdentifierItems} which contains at most three items: catalogName, schemaName and tableName. - */ - final public IdentifierItems TableName() throws ParseException { - trace_call("TableName"); - try { - IdentifierItems identifiers = new IdentifierItems(true); - IdentifierItem id = null; - id = Identifier(); - identifiers.append(id); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DOT: { - jj_consume_token(DOT); - id = Identifier(); - identifiers.append(id); - break; - } - default: - jj_la1[18] = jj_gen; - ; - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DOT: { - jj_consume_token(DOT); - id = Identifier(); - identifiers.append(id); - break; - } - default: - jj_la1[19] = jj_gen; - ; - } - { - if ("" != null) - return identifiers; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("TableName"); - } - } - - /** - * Extracts the name of a column with its possible catalog, schema and table prefixes. - * - * @return A {@link IdentifierItems} which contains at most four items: catalogName, schemaName, tableName and columnName. - */ - final public IdentifierItems ColumnName() throws ParseException { - trace_call("ColumnName"); - try { - IdentifierItem id; - IdentifierItems table = null, identifiers = new IdentifierItems(false); - id = Identifier(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DOT: { - jj_consume_token(DOT); - table = TableName(); - break; - } - default: - jj_la1[20] = jj_gen; - ; - } - identifiers.append(id); - if (table != null) { - for(int i = 0; i < table.size(); i++) - identifiers.append(table.get(i)); - } - { - if ("" != null) - return identifiers; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("ColumnName"); - } - } - - final public ADQLColumn Column() throws ParseException { - trace_call("Column"); - try { - IdentifierItems identifiers; - identifiers = ColumnName(); - try { - { - if ("" != null) - return queryFactory.createColumn(identifiers); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("Column"); - } - } - - final public ADQLOrder OrderItem() throws ParseException { - trace_call("OrderItem"); - try { - IdentifierItem identifier = null; - Token ind = null, desc = null; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - identifier = Identifier(); - break; - } - case UNSIGNED_INTEGER: { - ind = jj_consume_token(UNSIGNED_INTEGER); - break; - } - default: - jj_la1[21] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASC: - case DESC: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASC: { - jj_consume_token(ASC); - break; - } - case DESC: { - desc = jj_consume_token(DESC); - break; - } - default: - jj_la1[22] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[23] = jj_gen; - ; - } - try { - ADQLOrder order = null; - if (identifier != null) { - order = queryFactory.createOrder(identifier, desc != null); - order.setPosition(identifier.position); - } else { - order = queryFactory.createOrder(Integer.parseInt(ind.image), desc != null); - order.setPosition(new TextPosition(ind)); - } - { - if ("" != null) - return order; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("OrderItem"); - } - } - - final public FromContent SimpleTableRef() throws ParseException { - trace_call("SimpleTableRef"); - try { - IdentifierItem alias = null; - IdentifierItems identifiers = null; - ADQLQuery subQuery = null; - FromContent content = null; - Token start, end; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - identifiers = TableName(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AS: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AS: { - jj_consume_token(AS); - break; - } - default: - jj_la1[24] = jj_gen; - ; - } - alias = Identifier(); - break; - } - default: - jj_la1[25] = jj_gen; - ; - } - content = queryFactory.createTable(identifiers, alias); - if (alias == null) - content.setPosition(new TextPosition(identifiers.get(0).position, identifiers.get(identifiers.size() - 1).position)); - else - content.setPosition(new TextPosition(identifiers.get(0).position, alias.position)); - { - if ("" != null) - return content; - } - break; - } - default: - jj_la1[27] = jj_gen; - if (jj_2_2(2)) { - subQuery = SubQueryExpression(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AS: { - jj_consume_token(AS); - break; - } - default: - jj_la1[26] = jj_gen; - ; - } - alias = Identifier(); - content = queryFactory.createTable(subQuery, alias); - if (alias == null) - content.setPosition(new TextPosition(subQuery.getPosition())); - else - content.setPosition(new TextPosition(subQuery.getPosition(), alias.position)); - { - if ("" != null) - return content; - } - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: { - start = jj_consume_token(LEFT_PAR); - content = JoinedTable(); - end = jj_consume_token(RIGHT_PAR); - content.setPosition(new TextPosition(start, end)); - { - if ("" != null) - return content; - } - break; - } - default: - jj_la1[28] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("SimpleTableRef"); - } - } - - final public FromContent TableRef() throws ParseException { - trace_call("TableRef"); - try { - FromContent content; - content = SimpleTableRef(); - label_5: while(true) { - if (jj_2_3(2)) { - ; - } else { - break label_5; - } - content = JoinSpecification(content); - } - { - if ("" != null) - return content; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("TableRef"); - } - } - - final public FromContent JoinedTable() throws ParseException { - trace_call("JoinedTable"); - try { - FromContent content; - content = SimpleTableRef(); - label_6: while(true) { - content = JoinSpecification(content); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NATURAL: - case INNER: - case RIGHT: - case LEFT: - case FULL: - case JOIN: { - ; - break; - } - default: - jj_la1[29] = jj_gen; - break label_6; - } - } - { - if ("" != null) - return content; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("JoinedTable"); - } - } - - final public ADQLJoin JoinSpecification(FromContent leftTable) throws ParseException { - trace_call("JoinSpecification"); - try { - boolean natural = false; - JoinType type = JoinType.INNER; - ClauseConstraints condition = new ClauseConstraints("ON"); - ArrayList<ADQLColumn> lstColumns = new ArrayList<ADQLColumn>(); - IdentifierItem id; - FromContent rightTable; - ADQLJoin join; - Token lastPar; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NATURAL: { - jj_consume_token(NATURAL); - natural = true; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case INNER: - case RIGHT: - case LEFT: - case FULL: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case INNER: { - jj_consume_token(INNER); - break; - } - case RIGHT: - case LEFT: - case FULL: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT: { - jj_consume_token(LEFT); - type = JoinType.OUTER_LEFT; - break; - } - case RIGHT: { - jj_consume_token(RIGHT); - type = JoinType.OUTER_RIGHT; - break; - } - case FULL: { - jj_consume_token(FULL); - type = JoinType.OUTER_FULL; - break; - } - default: - jj_la1[30] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case OUTER: { - jj_consume_token(OUTER); - break; - } - default: - jj_la1[31] = jj_gen; - ; - } - break; - } - default: - jj_la1[32] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[33] = jj_gen; - ; - } - jj_consume_token(JOIN); - rightTable = SimpleTableRef(); - join = queryFactory.createJoin(type, leftTable, rightTable); - join.setPosition(new TextPosition(leftTable.getPosition(), rightTable.getPosition())); - { - if ("" != null) - return join; - } - break; - } - case INNER: - case RIGHT: - case LEFT: - case FULL: - case JOIN: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case INNER: - case RIGHT: - case LEFT: - case FULL: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case INNER: { - jj_consume_token(INNER); - break; - } - case RIGHT: - case LEFT: - case FULL: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT: { - jj_consume_token(LEFT); - type = JoinType.OUTER_LEFT; - break; - } - case RIGHT: { - jj_consume_token(RIGHT); - type = JoinType.OUTER_RIGHT; - break; - } - case FULL: { - jj_consume_token(FULL); - type = JoinType.OUTER_FULL; - break; - } - default: - jj_la1[34] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case OUTER: { - jj_consume_token(OUTER); - break; - } - default: - jj_la1[35] = jj_gen; - ; - } - break; - } - default: - jj_la1[36] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[37] = jj_gen; - ; - } - jj_consume_token(JOIN); - rightTable = SimpleTableRef(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ON: { - jj_consume_token(ON); - ConditionsList(condition); - join = queryFactory.createJoin(type, leftTable, rightTable, condition); - join.setPosition(new TextPosition(leftTable.getPosition(), condition.getPosition())); - { - if ("" != null) - return join; - } - break; - } - case USING: { - jj_consume_token(USING); - jj_consume_token(LEFT_PAR); - id = Identifier(); - lstColumns.add(queryFactory.createColumn(id)); - label_7: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[38] = jj_gen; - break label_7; - } - jj_consume_token(COMMA); - id = Identifier(); - lstColumns.add(queryFactory.createColumn(id)); - } - lastPar = jj_consume_token(RIGHT_PAR); - join = queryFactory.createJoin(type, leftTable, rightTable, lstColumns); - join.setPosition(new TextPosition(leftTable.getPosition().beginLine, leftTable.getPosition().beginColumn, lastPar.endLine, (lastPar.endColumn < 0) ? -1 : (lastPar.endColumn + 1))); - { - if ("" != null) - return join; - } - break; - } - default: - jj_la1[39] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[40] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("JoinSpecification"); - } - } - - /* ****** */ - /* STRING */ - /* ****** */ - final public StringConstant String() throws ParseException { - trace_call("String"); - try { - Token t, start = null; - String str = ""; - StringConstant cst; - label_8: while(true) { - t = jj_consume_token(STRING_LITERAL); - str += t.image.substring(1, t.image.length() - 1).replaceAll("''", "'"); - if (start == null) - start = t; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case STRING_LITERAL: { - ; - break; - } - default: - jj_la1[41] = jj_gen; - break label_8; - } - } - try { - cst = queryFactory.createStringConstant(str); - cst.setPosition(new TextPosition(start, t)); - { - if ("" != null) - return cst; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("String"); - } - } - - /* ************* */ - /* NUMERIC TYPES */ - /* ************* */ - final public NumericConstant UnsignedNumeric() throws ParseException { - trace_call("UnsignedNumeric"); - try { - Token t; - NumericConstant cst; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case SCIENTIFIC_NUMBER: { - t = jj_consume_token(SCIENTIFIC_NUMBER); - break; - } - case UNSIGNED_FLOAT: { - t = jj_consume_token(UNSIGNED_FLOAT); - break; - } - case UNSIGNED_INTEGER: { - t = jj_consume_token(UNSIGNED_INTEGER); - break; - } - default: - jj_la1[42] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - try { - cst = queryFactory.createNumericConstant(t.image); - cst.setPosition(new TextPosition(t)); - { - if ("" != null) - return cst; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("UnsignedNumeric"); - } - } - - final public NumericConstant UnsignedFloat() throws ParseException { - trace_call("UnsignedFloat"); - try { - Token t; - NumericConstant cst; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case UNSIGNED_INTEGER: { - t = jj_consume_token(UNSIGNED_INTEGER); - break; - } - case UNSIGNED_FLOAT: { - t = jj_consume_token(UNSIGNED_FLOAT); - break; - } - default: - jj_la1[43] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - try { - cst = queryFactory.createNumericConstant(t.image); - cst.setPosition(new TextPosition(t)); - { - if ("" != null) - return cst; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("UnsignedFloat"); - } - } - - final public NumericConstant SignedInteger() throws ParseException { - trace_call("SignedInteger"); - try { - Token sign = null, number; - NumericConstant cst; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case PLUS: - case MINUS: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case PLUS: { - sign = jj_consume_token(PLUS); - break; - } - case MINUS: { - sign = jj_consume_token(MINUS); - break; - } - default: - jj_la1[44] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[45] = jj_gen; - ; - } - number = jj_consume_token(UNSIGNED_INTEGER); - try { - if (sign == null) { - cst = queryFactory.createNumericConstant(number.image); - cst.setPosition(new TextPosition(number)); - } else { - cst = queryFactory.createNumericConstant(sign.image + number.image); - cst.setPosition(new TextPosition(sign, number)); - } - { - if ("" != null) - return cst; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("SignedInteger"); - } - } - - /* *********** */ - /* EXPRESSIONS */ - /* *********** */ - final public ADQLOperand NumericValueExpressionPrimary() throws ParseException { - trace_call("NumericValueExpressionPrimary"); - try { - ADQLColumn column; - ADQLOperand op; - Token left, right; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: { - // unsigned_value_specification - op = UnsignedNumeric(); - { - if ("" != null) - return op; - } - break; - } - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - column = Column(); - column.setExpectedType('N'); - { - if ("" != null) - return column; - } - break; - } - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: { - op = SqlFunction(); - { - if ("" != null) - return op; - } - break; - } - case LEFT_PAR: { - left = jj_consume_token(LEFT_PAR); - op = NumericExpression(); - right = jj_consume_token(RIGHT_PAR); - WrappedOperand wop = queryFactory.createWrappedOperand(op); - wop.setPosition(new TextPosition(left, right)); - { - if ("" != null) - return wop; - } - break; - } - default: - jj_la1[46] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("NumericValueExpressionPrimary"); - } - } - - final public ADQLOperand StringValueExpressionPrimary() throws ParseException { - trace_call("StringValueExpressionPrimary"); - try { - StringConstant expr; - ADQLColumn column; - ADQLOperand op; - Token left, right; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case STRING_LITERAL: { - // string - expr = String(); - { - if ("" != null) - return expr; - } - break; - } - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: { - op = UnsignedNumeric(); - { - if ("" != null) - return op; - } - break; - } - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: { - op = SqlFunction(); - { - if ("" != null) - return op; - } - break; - } - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - column = Column(); - column.setExpectedType('*'); - { - if ("" != null) - return column; - } - break; - } - case LEFT_PAR: { - left = jj_consume_token(LEFT_PAR); - op = ValueExpression(); - right = jj_consume_token(RIGHT_PAR); - WrappedOperand wop = queryFactory.createWrappedOperand(op); - wop.setPosition(new TextPosition(left, right)); - { - if ("" != null) - return wop; - } - break; - } - default: - jj_la1[47] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("StringValueExpressionPrimary"); - } - } - - final public ADQLOperand ValueExpression() throws ParseException { - trace_call("ValueExpression"); - try { - ADQLOperand valueExpr = null; - Token left, right; - try { - if (jj_2_4(2147483647)) { - valueExpr = NumericExpression(); - } else if (jj_2_5(2147483647)) { - valueExpr = StringExpression(); - } else if (jj_2_6(2147483647)) { - left = jj_consume_token(LEFT_PAR); - valueExpr = ValueExpression(); - right = jj_consume_token(RIGHT_PAR); - valueExpr = queryFactory.createWrappedOperand(valueExpr); - ((WrappedOperand)valueExpr).setPosition(new TextPosition(left, right)); - } else if (jj_2_7(2147483647)) { - valueExpr = UserDefinedFunction(); - } else if (jj_2_8(2)) { - valueExpr = GeometryValueFunction(); - } else if (jj_2_9(2147483647)) { - valueExpr = Column(); - } else if (jj_2_10(2147483647)) { - valueExpr = StringFactor(); - } else if (jj_2_11(3)) { - valueExpr = Factor(); - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - valueExpr = Column(); - break; - } - default: - jj_la1[48] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if ("" != null) - return valueExpr; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("ValueExpression"); - } - } - - final public ADQLOperand NumericExpression() throws ParseException { - trace_call("NumericExpression"); - try { - Token sign = null; - ADQLOperand leftOp, rightOp = null; - leftOp = NumericTerm(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case PLUS: - case MINUS: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case PLUS: { - sign = jj_consume_token(PLUS); - break; - } - case MINUS: { - sign = jj_consume_token(MINUS); - break; - } - default: - jj_la1[49] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - rightOp = NumericExpression(); - break; - } - default: - jj_la1[50] = jj_gen; - ; - } - if (sign == null) { - if ("" != null) - return leftOp; - } else { - try { - Operation operation = queryFactory.createOperation(leftOp, OperationType.getOperator(sign.image), rightOp); - operation.setPosition(new TextPosition(leftOp.getPosition(), rightOp.getPosition())); - { - if ("" != null) - return operation; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("NumericExpression"); - } - } - - final public ADQLOperand NumericTerm() throws ParseException { - trace_call("NumericTerm"); - try { - Token sign = null; - ADQLOperand leftOp, rightOp = null; - leftOp = Factor(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASTERISK: - case DIVIDE: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASTERISK: { - sign = jj_consume_token(ASTERISK); - break; - } - case DIVIDE: { - sign = jj_consume_token(DIVIDE); - break; - } - default: - jj_la1[51] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - rightOp = NumericTerm(); - break; - } - default: - jj_la1[52] = jj_gen; - ; - } - if (sign == null) { - if ("" != null) - return leftOp; - } else { - try { - Operation operation = queryFactory.createOperation(leftOp, OperationType.getOperator(sign.image), rightOp); - operation.setPosition(new TextPosition(leftOp.getPosition(), rightOp.getPosition())); - { - if ("" != null) - return operation; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("NumericTerm"); - } - } - - final public ADQLOperand Factor() throws ParseException { - trace_call("Factor"); - try { - boolean negative = false; - Token minusSign = null; - ADQLOperand op; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case PLUS: - case MINUS: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case PLUS: { - jj_consume_token(PLUS); - break; - } - case MINUS: { - minusSign = jj_consume_token(MINUS); - negative = true; - break; - } - default: - jj_la1[53] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[54] = jj_gen; - ; - } - if (jj_2_12(2)) { - op = NumericFunction(); - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - op = NumericValueExpressionPrimary(); - break; - } - default: - jj_la1[55] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - if (negative) { - try { - TextPosition position = op.getPosition(); - op = queryFactory.createNegativeOperand(op); - NegativeOperand negativeOp = (NegativeOperand)op; - if (minusSign != null) - negativeOp.setPosition(new TextPosition(minusSign.beginLine, minusSign.beginColumn, position.endLine, position.endColumn)); - else - negativeOp.setPosition(position); - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - } - - { - if ("" != null) - return op; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("Factor"); - } - } - - @Override - final public ADQLOperand StringExpression() throws ParseException { - trace_call("StringExpression"); - try { - ADQLOperand leftOp; - ADQLOperand rightOp = null; - leftOp = StringFactor(); - label_9: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case CONCAT: { - ; - break; - } - default: - jj_la1[56] = jj_gen; - break label_9; - } - jj_consume_token(CONCAT); - rightOp = StringFactor(); - if (!(leftOp instanceof Concatenation)) { - try { - ADQLOperand temp = leftOp; - leftOp = queryFactory.createConcatenation(); - ((Concatenation)leftOp).add(temp); - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - } - ((Concatenation)leftOp).add(rightOp); - } - if (leftOp instanceof Concatenation) { - Concatenation concat = (Concatenation)leftOp; - concat.setPosition(new TextPosition(concat.get(0).getPosition(), concat.get(concat.size() - 1).getPosition())); - } - { - if ("" != null) - return leftOp; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("StringExpression"); - } - } - - final public ADQLOperand StringFactor() throws ParseException { - trace_call("StringFactor"); - try { - ADQLOperand op; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COORDSYS: { - op = ExtractCoordSys(); - break; - } - default: - jj_la1[57] = jj_gen; - if (jj_2_13(2)) { - op = UserDefinedFunction(); - ((UserDefinedFunction)op).setExpectedType('S'); - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: - case STRING_LITERAL: - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - op = StringValueExpressionPrimary(); - break; - } - default: - jj_la1[58] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - { - if ("" != null) - return op; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("StringFactor"); - } - } - - final public GeometryValue<GeometryFunction> GeometryExpression() throws ParseException { - trace_call("GeometryExpression"); - try { - ADQLColumn col = null; - GeometryFunction gf = null; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - col = Column(); - break; - } - case BOX: - case CENTROID: - case CIRCLE: - case POINT: - case POLYGON: - case REGION: { - gf = GeometryValueFunction(); - break; - } - default: - jj_la1[59] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - if (col != null) { - col.setExpectedType('G'); - { - if ("" != null) - return new GeometryValue<GeometryFunction>(col); - } - } else { - if ("" != null) - return new GeometryValue<GeometryFunction>(gf); - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("GeometryExpression"); - } - } - - /* ********************************** */ - /* BOOLEAN EXPRESSIONS (WHERE clause) */ - /* ********************************** */ - final public ClauseConstraints ConditionsList(ClauseConstraints clause) throws ParseException { - trace_call("ConditionsList"); - try { - ADQLConstraint constraint = null; - Token op = null; - boolean notOp = false; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NOT: { - op = jj_consume_token(NOT); - notOp = true; - break; - } - default: - jj_la1[60] = jj_gen; - ; - } - constraint = Constraint(); - if (notOp) { - TextPosition oldPos = constraint.getPosition(); - constraint = queryFactory.createNot(constraint); - ((NotConstraint)constraint).setPosition(new TextPosition(op.beginLine, op.beginColumn, oldPos.endLine, oldPos.endColumn)); - } - notOp = false; - - if (clause instanceof ADQLConstraint) - clause.add(constraint); - else - clause.add(constraint); - label_10: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AND: - case OR: { - ; - break; - } - default: - jj_la1[61] = jj_gen; - break label_10; - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AND: { - op = jj_consume_token(AND); - break; - } - case OR: { - op = jj_consume_token(OR); - break; - } - default: - jj_la1[62] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NOT: { - jj_consume_token(NOT); - notOp = true; - break; - } - default: - jj_la1[63] = jj_gen; - ; - } - constraint = Constraint(); - if (notOp) { - TextPosition oldPos = constraint.getPosition(); - constraint = queryFactory.createNot(constraint); - ((NotConstraint)constraint).setPosition(new TextPosition(op.beginLine, op.beginColumn, oldPos.endLine, oldPos.endColumn)); - } - notOp = false; - - if (clause instanceof ADQLConstraint) - clause.add(op.image, constraint); - else - clause.add(op.image, constraint); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - if (!clause.isEmpty()) { - TextPosition start = clause.get(0).getPosition(); - TextPosition end = clause.get(clause.size() - 1).getPosition(); - clause.setPosition(new TextPosition(start, end)); - } - { - if ("" != null) - return clause; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("ConditionsList"); - } - } - - final public ADQLConstraint Constraint() throws ParseException { - trace_call("Constraint"); - try { - ADQLConstraint constraint = null; - Token start, end; - if (jj_2_14(2147483647)) { - constraint = Predicate(); - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: { - start = jj_consume_token(LEFT_PAR); - try { - constraint = queryFactory.createGroupOfConstraints(); - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - ConditionsList((ConstraintsGroup)constraint); - end = jj_consume_token(RIGHT_PAR); - ((ConstraintsGroup)constraint).setPosition(new TextPosition(start, end)); - break; - } - default: - jj_la1[64] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if ("" != null) - return constraint; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("Constraint"); - } - } - - final public ADQLConstraint Predicate() throws ParseException { - trace_call("Predicate"); - try { - ADQLQuery q = null; - ADQLColumn column = null; - ADQLOperand strExpr1 = null, strExpr2 = null; - ADQLOperand op; - Token start, notToken = null, end; - ADQLConstraint constraint = null; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case EXISTS: { - start = jj_consume_token(EXISTS); - q = SubQueryExpression(); - Exists e = queryFactory.createExists(q); - e.setPosition(new TextPosition(start.beginLine, start.beginColumn, q.getPosition().endLine, q.getPosition().endColumn)); - { - if ("" != null) - return e; - } - break; - } - default: - jj_la1[69] = jj_gen; - if (jj_2_16(2147483647)) { - column = Column(); - jj_consume_token(IS); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NOT: { - notToken = jj_consume_token(NOT); - break; - } - default: - jj_la1[65] = jj_gen; - ; - } - end = jj_consume_token(NULL); - IsNull in = queryFactory.createIsNull((notToken != null), column); - in.setPosition(new TextPosition(column.getPosition().beginLine, column.getPosition().beginColumn, end.endLine, (end.endColumn < 0) ? -1 : (end.endColumn + 1))); - { - if ("" != null) - return in; - } - } else if (jj_2_17(2147483647)) { - strExpr1 = StringExpression(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NOT: { - notToken = jj_consume_token(NOT); - break; - } - default: - jj_la1[66] = jj_gen; - ; - } - jj_consume_token(LIKE); - strExpr2 = StringExpression(); - Comparison comp = queryFactory.createComparison(strExpr1, (notToken == null) ? ComparisonOperator.LIKE : ComparisonOperator.NOTLIKE, strExpr2); - comp.setPosition(new TextPosition(strExpr1.getPosition(), strExpr2.getPosition())); - { - if ("" != null) - return comp; - } - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: - case PLUS: - case MINUS: - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: - case BOX: - case CENTROID: - case CIRCLE: - case POINT: - case POLYGON: - case REGION: - case CONTAINS: - case INTERSECTS: - case AREA: - case COORD1: - case COORD2: - case COORDSYS: - case DISTANCE: - case ABS: - case CEILING: - case DEGREES: - case EXP: - case FLOOR: - case LOG: - case LOG10: - case MOD: - case PI: - case POWER: - case RADIANS: - case RAND: - case ROUND: - case SQRT: - case TRUNCATE: - case ACOS: - case ASIN: - case ATAN: - case ATAN2: - case COS: - case COT: - case SIN: - case TAN: - case STRING_LITERAL: - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - op = ValueExpression(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case EQUAL: - case NOT_EQUAL: - case LESS_THAN: - case LESS_EQUAL_THAN: - case GREATER_THAN: - case GREATER_EQUAL_THAN: { - constraint = ComparisonEnd(op); - break; - } - default: - jj_la1[67] = jj_gen; - if (jj_2_15(2)) { - constraint = BetweenEnd(op); - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NOT: - case IN: { - constraint = InEnd(op); - break; - } - default: - jj_la1[68] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - break; - } - default: - jj_la1[70] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - { - if ("" != null) - return constraint; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("Predicate"); - } - } - - final public Comparison ComparisonEnd(ADQLOperand leftOp) throws ParseException { - trace_call("ComparisonEnd"); - try { - Token comp; - ADQLOperand rightOp; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case EQUAL: { - comp = jj_consume_token(EQUAL); - break; - } - case NOT_EQUAL: { - comp = jj_consume_token(NOT_EQUAL); - break; - } - case LESS_THAN: { - comp = jj_consume_token(LESS_THAN); - break; - } - case LESS_EQUAL_THAN: { - comp = jj_consume_token(LESS_EQUAL_THAN); - break; - } - case GREATER_THAN: { - comp = jj_consume_token(GREATER_THAN); - break; - } - case GREATER_EQUAL_THAN: { - comp = jj_consume_token(GREATER_EQUAL_THAN); - break; - } - default: - jj_la1[71] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - rightOp = ValueExpression(); - try { - Comparison comparison = queryFactory.createComparison(leftOp, ComparisonOperator.getOperator(comp.image), rightOp); - comparison.setPosition(new TextPosition(leftOp.getPosition(), rightOp.getPosition())); - { - if ("" != null) - return comparison; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("ComparisonEnd"); - } - } - - final public Between BetweenEnd(ADQLOperand leftOp) throws ParseException { - trace_call("BetweenEnd"); - try { - Token start, notToken = null; - ADQLOperand min, max; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NOT: { - notToken = jj_consume_token(NOT); - break; - } - default: - jj_la1[72] = jj_gen; - ; - } - start = jj_consume_token(BETWEEN); - min = ValueExpression(); - jj_consume_token(AND); - max = ValueExpression(); - try { - Between bet = queryFactory.createBetween((notToken != null), leftOp, min, max); - if (notToken != null) - start = notToken; - bet.setPosition(new TextPosition(start.beginLine, start.beginColumn, max.getPosition().endLine, max.getPosition().endColumn)); - { - if ("" != null) - return bet; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("BetweenEnd"); - } - } - - final public In InEnd(ADQLOperand leftOp) throws ParseException { - trace_call("InEnd"); - try { - Token not = null, start; - ADQLQuery q = null; - ADQLOperand item; - Vector<ADQLOperand> items = new Vector<ADQLOperand>(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NOT: { - not = jj_consume_token(NOT); - break; - } - default: - jj_la1[73] = jj_gen; - ; - } - start = jj_consume_token(IN); - if (jj_2_18(2)) { - q = SubQueryExpression(); - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: { - jj_consume_token(LEFT_PAR); - item = ValueExpression(); - items.add(item); - label_11: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[74] = jj_gen; - break label_11; - } - jj_consume_token(COMMA); - item = ValueExpression(); - items.add(item); - } - jj_consume_token(RIGHT_PAR); - break; - } - default: - jj_la1[75] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - try { - In in; - start = (not != null) ? not : start; - if (q != null) { - in = queryFactory.createIn(leftOp, q, not != null); - in.setPosition(new TextPosition(start.beginLine, start.beginColumn, q.getPosition().endLine, q.getPosition().endColumn)); - } else { - ADQLOperand[] list = new ADQLOperand[items.size()]; - int i = 0; - for(ADQLOperand op : items) - list[i++] = op; - in = queryFactory.createIn(leftOp, list, not != null); - in.setPosition(new TextPosition(start.beginLine, start.beginColumn, list[list.length - 1].getPosition().endLine, list[list.length - 1].getPosition().endColumn)); - } - { - if ("" != null) - return in; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("InEnd"); - } - } - - /* ************* */ - /* SQL FUNCTIONS */ - /* ************* */ - final public SQLFunction SqlFunction() throws ParseException { - trace_call("SqlFunction"); - try { - Token fct, all = null, distinct = null, end; - ADQLOperand op = null; - SQLFunction funct = null; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COUNT: { - fct = jj_consume_token(COUNT); - jj_consume_token(LEFT_PAR); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case QUANTIFIER: { - distinct = jj_consume_token(QUANTIFIER); - break; - } - default: - jj_la1[76] = jj_gen; - ; - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASTERISK: { - all = jj_consume_token(ASTERISK); - break; - } - case LEFT_PAR: - case PLUS: - case MINUS: - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: - case BOX: - case CENTROID: - case CIRCLE: - case POINT: - case POLYGON: - case REGION: - case CONTAINS: - case INTERSECTS: - case AREA: - case COORD1: - case COORD2: - case COORDSYS: - case DISTANCE: - case ABS: - case CEILING: - case DEGREES: - case EXP: - case FLOOR: - case LOG: - case LOG10: - case MOD: - case PI: - case POWER: - case RADIANS: - case RAND: - case ROUND: - case SQRT: - case TRUNCATE: - case ACOS: - case ASIN: - case ATAN: - case ATAN2: - case COS: - case COT: - case SIN: - case TAN: - case STRING_LITERAL: - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - op = ValueExpression(); - break; - } - default: - jj_la1[77] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - end = jj_consume_token(RIGHT_PAR); - funct = queryFactory.createSQLFunction((all != null) ? SQLFunctionType.COUNT_ALL : SQLFunctionType.COUNT, op, distinct != null && distinct.image.equalsIgnoreCase("distinct")); - funct.setPosition(new TextPosition(fct, end)); - break; - } - case AVG: - case MAX: - case MIN: - case SUM: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AVG: { - fct = jj_consume_token(AVG); - break; - } - case MAX: { - fct = jj_consume_token(MAX); - break; - } - case MIN: { - fct = jj_consume_token(MIN); - break; - } - case SUM: { - fct = jj_consume_token(SUM); - break; - } - default: - jj_la1[78] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(LEFT_PAR); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case QUANTIFIER: { - distinct = jj_consume_token(QUANTIFIER); - break; - } - default: - jj_la1[79] = jj_gen; - ; - } - op = ValueExpression(); - end = jj_consume_token(RIGHT_PAR); - funct = queryFactory.createSQLFunction(SQLFunctionType.valueOf(fct.image.toUpperCase()), op, distinct != null && distinct.image.equalsIgnoreCase("distinct")); - funct.setPosition(new TextPosition(fct, end)); - break; - } - default: - jj_la1[80] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - { - if ("" != null) - return funct; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("SqlFunction"); - } - } - - /* ************** */ - /* ADQL FUNCTIONS */ - /* ************** */ - final public ADQLOperand[] Coordinates() throws ParseException { - trace_call("Coordinates"); - try { - ADQLOperand[] ops = new ADQLOperand[2]; - ops[0] = NumericExpression(); - jj_consume_token(COMMA); - ops[1] = NumericExpression(); - { - if ("" != null) - return ops; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("Coordinates"); - } - } - - final public GeometryFunction GeometryFunction() throws ParseException { - trace_call("GeometryFunction"); - try { - Token fct = null, end; - GeometryValue<GeometryFunction> gvf1, gvf2; - GeometryValue<PointFunction> gvp1, gvp2; - GeometryFunction gf = null; - PointFunction p1 = null, p2 = null; - ADQLColumn col1 = null, col2 = null; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case CONTAINS: - case INTERSECTS: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case CONTAINS: { - fct = jj_consume_token(CONTAINS); - break; - } - case INTERSECTS: { - fct = jj_consume_token(INTERSECTS); - break; - } - default: - jj_la1[81] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(LEFT_PAR); - gvf1 = GeometryExpression(); - jj_consume_token(COMMA); - gvf2 = GeometryExpression(); - end = jj_consume_token(RIGHT_PAR); - if (fct.image.equalsIgnoreCase("contains")) - gf = queryFactory.createContains(gvf1, gvf2); - else - gf = queryFactory.createIntersects(gvf1, gvf2); - break; - } - case AREA: { - fct = jj_consume_token(AREA); - jj_consume_token(LEFT_PAR); - gvf1 = GeometryExpression(); - end = jj_consume_token(RIGHT_PAR); - gf = queryFactory.createArea(gvf1); - break; - } - case COORD1: { - fct = jj_consume_token(COORD1); - jj_consume_token(LEFT_PAR); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case POINT: { - p1 = Point(); - gf = queryFactory.createCoord1(p1); - break; - } - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - col1 = Column(); - col1.setExpectedType('G'); - gf = queryFactory.createCoord1(col1); - break; - } - default: - jj_la1[82] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - end = jj_consume_token(RIGHT_PAR); - break; - } - case COORD2: { - fct = jj_consume_token(COORD2); - jj_consume_token(LEFT_PAR); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case POINT: { - p1 = Point(); - gf = queryFactory.createCoord2(p1); - break; - } - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - col1 = Column(); - col1.setExpectedType('G'); - gf = queryFactory.createCoord2(col1); - break; - } - default: - jj_la1[83] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - end = jj_consume_token(RIGHT_PAR); - break; - } - case DISTANCE: { - fct = jj_consume_token(DISTANCE); - jj_consume_token(LEFT_PAR); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case POINT: { - p1 = Point(); - break; - } - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - col1 = Column(); - break; - } - default: - jj_la1[84] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - if (p1 != null) - gvp1 = new GeometryValue<PointFunction>(p1); - else { - col1.setExpectedType('G'); - gvp1 = new GeometryValue<PointFunction>(col1); - } - jj_consume_token(COMMA); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case POINT: { - p2 = Point(); - break; - } - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - col2 = Column(); - break; - } - default: - jj_la1[85] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - if (p2 != null) - gvp2 = new GeometryValue<PointFunction>(p2); - else { - col2.setExpectedType('G'); - gvp2 = new GeometryValue<PointFunction>(col2); - } - end = jj_consume_token(RIGHT_PAR); - gf = queryFactory.createDistance(gvp1, gvp2); - break; - } - default: - jj_la1[86] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - gf.setPosition(new TextPosition(fct, end)); - { - if ("" != null) - return gf; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("GeometryFunction"); - } - } - - final public ADQLOperand CoordinateSystem() throws ParseException { - trace_call("CoordinateSystem"); - try { - ADQLOperand coordSys = null; - coordSys = StringExpression(); - { - if ("" != null) - return coordSys; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("CoordinateSystem"); - } - } - - final public GeometryFunction GeometryValueFunction() throws ParseException { - trace_call("GeometryValueFunction"); - try { - Token fct = null, end = null; - ADQLOperand coordSys; - ADQLOperand width, height; - ADQLOperand[] coords, tmp; - Vector<ADQLOperand> vCoords; - ADQLOperand op = null; - GeometryValue<GeometryFunction> gvf = null; - GeometryFunction gf = null; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOX: { - fct = jj_consume_token(BOX); - jj_consume_token(LEFT_PAR); - coordSys = CoordinateSystem(); - jj_consume_token(COMMA); - coords = Coordinates(); - jj_consume_token(COMMA); - width = NumericExpression(); - jj_consume_token(COMMA); - height = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - gf = queryFactory.createBox(coordSys, coords[0], coords[1], width, height); - break; - } - case CENTROID: { - fct = jj_consume_token(CENTROID); - jj_consume_token(LEFT_PAR); - gvf = GeometryExpression(); - end = jj_consume_token(RIGHT_PAR); - gf = queryFactory.createCentroid(gvf); - break; - } - case CIRCLE: { - fct = jj_consume_token(CIRCLE); - jj_consume_token(LEFT_PAR); - coordSys = CoordinateSystem(); - jj_consume_token(COMMA); - coords = Coordinates(); - jj_consume_token(COMMA); - width = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - gf = queryFactory.createCircle(coordSys, coords[0], coords[1], width); - break; - } - case POINT: { - gf = Point(); - break; - } - case POLYGON: { - fct = jj_consume_token(POLYGON); - jj_consume_token(LEFT_PAR); - coordSys = CoordinateSystem(); - vCoords = new Vector<ADQLOperand>(); - jj_consume_token(COMMA); - tmp = Coordinates(); - vCoords.add(tmp[0]); - vCoords.add(tmp[1]); - jj_consume_token(COMMA); - tmp = Coordinates(); - vCoords.add(tmp[0]); - vCoords.add(tmp[1]); - jj_consume_token(COMMA); - tmp = Coordinates(); - vCoords.add(tmp[0]); - vCoords.add(tmp[1]); - label_12: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[87] = jj_gen; - break label_12; - } - jj_consume_token(COMMA); - tmp = Coordinates(); - vCoords.add(tmp[0]); - vCoords.add(tmp[1]); - } - end = jj_consume_token(RIGHT_PAR); - gf = queryFactory.createPolygon(coordSys, vCoords); - break; - } - case REGION: { - fct = jj_consume_token(REGION); - jj_consume_token(LEFT_PAR); - op = StringExpression(); - end = jj_consume_token(RIGHT_PAR); - gf = queryFactory.createRegion(op); - break; - } - default: - jj_la1[88] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - if (fct != null && end != null) // = !(gf instanceof Point) - gf.setPosition(new TextPosition(fct, end)); - { - if ("" != null) - return gf; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("GeometryValueFunction"); - } - } - - final public PointFunction Point() throws ParseException { - trace_call("Point"); - try { - Token start, end; - ADQLOperand coordSys; - ADQLOperand[] coords; - start = jj_consume_token(POINT); - jj_consume_token(LEFT_PAR); - coordSys = CoordinateSystem(); - jj_consume_token(COMMA); - coords = Coordinates(); - end = jj_consume_token(RIGHT_PAR); - try { - PointFunction pf = queryFactory.createPoint(coordSys, coords[0], coords[1]); - pf.setPosition(new TextPosition(start, end)); - { - if ("" != null) - return pf; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("Point"); - } - } - - final public GeometryFunction ExtractCoordSys() throws ParseException { - trace_call("ExtractCoordSys"); - try { - Token start, end; - GeometryValue<GeometryFunction> gvf; - start = jj_consume_token(COORDSYS); - jj_consume_token(LEFT_PAR); - gvf = GeometryExpression(); - end = jj_consume_token(RIGHT_PAR); - try { - GeometryFunction gf = queryFactory.createExtractCoordSys(gvf); - gf.setPosition(new TextPosition(start, end)); - { - if ("" != null) - return gf; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("ExtractCoordSys"); - } - } - - /* ***************** */ - /* NUMERIC FUNCTIONS */ - /* ***************** */ - final public ADQLFunction NumericFunction() throws ParseException { - trace_call("NumericFunction"); - try { - ADQLFunction fct; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ABS: - case CEILING: - case DEGREES: - case EXP: - case FLOOR: - case LOG: - case LOG10: - case MOD: - case PI: - case POWER: - case RADIANS: - case RAND: - case ROUND: - case SQRT: - case TRUNCATE: { - fct = MathFunction(); - break; - } - case ACOS: - case ASIN: - case ATAN: - case ATAN2: - case COS: - case COT: - case SIN: - case TAN: { - fct = TrigFunction(); - break; - } - case CONTAINS: - case INTERSECTS: - case AREA: - case COORD1: - case COORD2: - case DISTANCE: { - fct = GeometryFunction(); - break; - } - case REGULAR_IDENTIFIER_CANDIDATE: { - fct = UserDefinedFunction(); - ((UserDefinedFunction)fct).setExpectedType('N'); - break; - } - default: - jj_la1[89] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if ("" != null) - return fct; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("NumericFunction"); - } - } - - final public MathFunction MathFunction() throws ParseException { - trace_call("MathFunction"); - try { - Token fct = null, end; - ADQLOperand param1 = null, param2 = null; - NumericConstant integerValue = null; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ABS: { - fct = jj_consume_token(ABS); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case CEILING: { - fct = jj_consume_token(CEILING); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case DEGREES: { - fct = jj_consume_token(DEGREES); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case EXP: { - fct = jj_consume_token(EXP); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case FLOOR: { - fct = jj_consume_token(FLOOR); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case LOG: { - fct = jj_consume_token(LOG); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case LOG10: { - fct = jj_consume_token(LOG10); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case MOD: { - fct = jj_consume_token(MOD); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - jj_consume_token(COMMA); - param2 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case PI: { - fct = jj_consume_token(PI); - jj_consume_token(LEFT_PAR); - end = jj_consume_token(RIGHT_PAR); - break; - } - case POWER: { - fct = jj_consume_token(POWER); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - jj_consume_token(COMMA); - param2 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case RADIANS: { - fct = jj_consume_token(RADIANS); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case RAND: { - fct = jj_consume_token(RAND); - jj_consume_token(LEFT_PAR); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: - case PLUS: - case MINUS: - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: - case CONTAINS: - case INTERSECTS: - case AREA: - case COORD1: - case COORD2: - case DISTANCE: - case ABS: - case CEILING: - case DEGREES: - case EXP: - case FLOOR: - case LOG: - case LOG10: - case MOD: - case PI: - case POWER: - case RADIANS: - case RAND: - case ROUND: - case SQRT: - case TRUNCATE: - case ACOS: - case ASIN: - case ATAN: - case ATAN2: - case COS: - case COT: - case SIN: - case TAN: - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - param1 = NumericExpression(); - break; - } - default: - jj_la1[90] = jj_gen; - ; - } - end = jj_consume_token(RIGHT_PAR); - break; - } - case ROUND: { - fct = jj_consume_token(ROUND); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - jj_consume_token(COMMA); - param2 = SignedInteger(); - break; - } - default: - jj_la1[91] = jj_gen; - ; - } - end = jj_consume_token(RIGHT_PAR); - break; - } - case SQRT: { - fct = jj_consume_token(SQRT); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case TRUNCATE: { - fct = jj_consume_token(TRUNCATE); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - jj_consume_token(COMMA); - param2 = SignedInteger(); - break; - } - default: - jj_la1[92] = jj_gen; - ; - } - end = jj_consume_token(RIGHT_PAR); - break; - } - default: - jj_la1[93] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - MathFunction mf = queryFactory.createMathFunction(MathFunctionType.valueOf(fct.image.toUpperCase()), param1, param2); - mf.setPosition(new TextPosition(fct, end)); - { - if ("" != null) - return mf; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("MathFunction"); - } - } - - final public MathFunction TrigFunction() throws ParseException { - trace_call("TrigFunction"); - try { - Token fct = null, end; - ADQLOperand param1 = null, param2 = null; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ACOS: { - fct = jj_consume_token(ACOS); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case ASIN: { - fct = jj_consume_token(ASIN); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case ATAN: { - fct = jj_consume_token(ATAN); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case ATAN2: { - fct = jj_consume_token(ATAN2); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - jj_consume_token(COMMA); - param2 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case COS: { - fct = jj_consume_token(COS); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case COT: { - fct = jj_consume_token(COT); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case SIN: { - fct = jj_consume_token(SIN); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case TAN: { - fct = jj_consume_token(TAN); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - default: - jj_la1[94] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - try { - MathFunction mf = queryFactory.createMathFunction(MathFunctionType.valueOf(fct.image.toUpperCase()), param1, param2); - mf.setPosition(new TextPosition(fct, end)); - { - if ("" != null) - return mf; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("TrigFunction"); - } - } - - final public UserDefinedFunction UserDefinedFunction() throws ParseException { - trace_call("UserDefinedFunction"); - try { - Token fct, end; - Vector<ADQLOperand> params = new Vector<ADQLOperand>(); - ADQLOperand op; - fct = jj_consume_token(REGULAR_IDENTIFIER_CANDIDATE); - jj_consume_token(LEFT_PAR); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: - case PLUS: - case MINUS: - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: - case BOX: - case CENTROID: - case CIRCLE: - case POINT: - case POLYGON: - case REGION: - case CONTAINS: - case INTERSECTS: - case AREA: - case COORD1: - case COORD2: - case COORDSYS: - case DISTANCE: - case ABS: - case CEILING: - case DEGREES: - case EXP: - case FLOOR: - case LOG: - case LOG10: - case MOD: - case PI: - case POWER: - case RADIANS: - case RAND: - case ROUND: - case SQRT: - case TRUNCATE: - case ACOS: - case ASIN: - case ATAN: - case ATAN2: - case COS: - case COT: - case SIN: - case TAN: - case STRING_LITERAL: - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - op = ValueExpression(); - params.add(op); - label_13: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[95] = jj_gen; - break label_13; - } - jj_consume_token(COMMA); - op = ValueExpression(); - params.add(op); - } - break; - } - default: - jj_la1[96] = jj_gen; - ; - } - end = jj_consume_token(RIGHT_PAR); - // Ensure the given function name is valid: - if (!isRegularIdentifier(fct.image)) { - if (true) - throw new ParseException("Invalid (User Defined) Function name: \u005c"" + fct.image + "\u005c"!", new TextPosition(fct)); - } - - //System.out.println("INFO [ADQLParser200]: \""+fct.image+"\" (from line "+fct.beginLine+" and column "+fct.beginColumn+" to line "+token.endLine+" and column "+(token.endColumn+1)+") is considered as an user defined function !"); - - try { - // Build the parameters list: - ADQLOperand[] parameters = new ADQLOperand[params.size()]; - for(int i = 0; i < params.size(); i++) - parameters[i] = params.get(i); - - // Create the UDF function: - UserDefinedFunction udf = queryFactory.createUserDefinedFunction(fct.image, parameters); - udf.setPosition(new TextPosition(fct, end)); - { - if ("" != null) - return udf; - } - - } catch(UnsupportedOperationException uoe) { - /* This catch clause is just for backward compatibility: - * if the createUserDefinedFunction(...) is overridden and - * the function can not be identified a such exception may be thrown). */ - { - if (true) - throw new ParseException(uoe.getMessage(), new TextPosition(fct, token)); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("UserDefinedFunction"); - } - } - - private boolean jj_2_1(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_1(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(0, xla); - } - } - - private boolean jj_2_2(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_2(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(1, xla); - } - } - - private boolean jj_2_3(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_3(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(2, xla); - } - } - - private boolean jj_2_4(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_4(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(3, xla); - } - } - - private boolean jj_2_5(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_5(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(4, xla); - } - } - - private boolean jj_2_6(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_6(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(5, xla); - } - } - - private boolean jj_2_7(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_7(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(6, xla); - } - } - - private boolean jj_2_8(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_8(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(7, xla); - } - } - - private boolean jj_2_9(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_9(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(8, xla); - } - } - - private boolean jj_2_10(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_10(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(9, xla); - } - } - - private boolean jj_2_11(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_11(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(10, xla); - } - } - - private boolean jj_2_12(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_12(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(11, xla); - } - } - - private boolean jj_2_13(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_13(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(12, xla); - } - } - - private boolean jj_2_14(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_14(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(13, xla); - } - } - - private boolean jj_2_15(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_15(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(14, xla); - } - } - - private boolean jj_2_16(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_16(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(15, xla); - } - } - - private boolean jj_2_17(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_17(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(16, xla); - } - } - - private boolean jj_2_18(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_18(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(17, xla); - } - } - - private boolean jj_3R_134() { - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_51()) - return true; - return false; - } - - private boolean jj_3_2() { - if (jj_3R_16()) - return true; - return false; - } - - private boolean jj_3R_75() { - if (jj_3R_79()) - return true; - return false; - } - - private boolean jj_3R_27() { - if (jj_3R_51()) - return true; - return false; - } - - private boolean jj_3R_56() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_75()) { - jj_scanpos = xsp; - if (jj_3_2()) { - jj_scanpos = xsp; - if (jj_3R_76()) - return true; - } - } - return false; - } - - private boolean jj_3_14() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(42)) { - jj_scanpos = xsp; - if (jj_3R_27()) - return true; - } - return false; - } - - private boolean jj_3R_120() { - if (jj_3R_51()) - return true; - Token xsp; - while(true) { - xsp = jj_scanpos; - if (jj_3R_134()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_60() { - if (jj_scan_token(DOT)) - return true; - if (jj_3R_79()) - return true; - return false; - } - - private boolean jj_3R_22() { - if (jj_3R_43()) - return true; - return false; - } - - private boolean jj_3R_150() { - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_153()) - return true; - return false; - } - - private boolean jj_3R_149() { - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_153()) - return true; - return false; - } - - private boolean jj_3R_43() { - if (jj_3R_14()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_60()) - jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_127() { - if (jj_scan_token(DOT)) - return true; - if (jj_3R_14()) - return true; - return false; - } - - private boolean jj_3R_126() { - if (jj_scan_token(DOT)) - return true; - if (jj_3R_14()) - return true; - return false; - } - - private boolean jj_3R_79() { - if (jj_3R_14()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_126()) - jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_127()) - jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_31() { - if (jj_scan_token(DELIMITED_IDENTIFIER)) - return true; - return false; - } - - private boolean jj_3R_133() { - if (jj_3R_21()) - return true; - return false; - } - - private boolean jj_3R_30() { - if (jj_scan_token(REGULAR_IDENTIFIER_CANDIDATE)) - return true; - return false; - } - - private boolean jj_3R_26() { - if (jj_scan_token(REGULAR_IDENTIFIER_CANDIDATE)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_120()) - jj_scanpos = xsp; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_141() { - if (jj_3R_112()) - return true; - return false; - } - - private boolean jj_3R_14() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_30()) { - jj_scanpos = xsp; - if (jj_3R_31()) - return true; - } - return false; - } - - private boolean jj_3R_132() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3R_119() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_132()) { - jj_scanpos = xsp; - if (jj_3R_133()) - return true; - } - return false; - } - - private boolean jj_3R_106() { - if (jj_scan_token(TAN)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_105() { - if (jj_scan_token(SIN)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_58() { - if (jj_3R_78()) - return true; - return false; - } - - private boolean jj_3R_104() { - if (jj_scan_token(COT)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3_13() { - if (jj_3R_26()) - return true; - return false; - } - - private boolean jj_3R_103() { - if (jj_scan_token(COS)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_102() { - if (jj_scan_token(ATAN2)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_57() { - if (jj_3R_77()) - return true; - return false; - } - - private boolean jj_3R_101() { - if (jj_scan_token(ATAN)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_36() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_57()) { - jj_scanpos = xsp; - if (jj_3_13()) { - jj_scanpos = xsp; - if (jj_3R_58()) - return true; - } - } - return false; - } - - private boolean jj_3R_100() { - if (jj_scan_token(ASIN)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_99() { - if (jj_scan_token(ACOS)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_64() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_99()) { - jj_scanpos = xsp; - if (jj_3R_100()) { - jj_scanpos = xsp; - if (jj_3R_101()) { - jj_scanpos = xsp; - if (jj_3R_102()) { - jj_scanpos = xsp; - if (jj_3R_103()) { - jj_scanpos = xsp; - if (jj_3R_104()) { - jj_scanpos = xsp; - if (jj_3R_105()) { - jj_scanpos = xsp; - if (jj_3R_106()) - return true; - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_46() { - if (jj_3R_62()) - return true; - return false; - } - - private boolean jj_3R_98() { - if (jj_scan_token(TRUNCATE)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_150()) - jj_scanpos = xsp; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_97() { - if (jj_scan_token(SQRT)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_96() { - if (jj_scan_token(ROUND)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_149()) - jj_scanpos = xsp; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_95() { - if (jj_scan_token(RAND)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_141()) - jj_scanpos = xsp; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_94() { - if (jj_scan_token(RADIANS)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_93() { - if (jj_scan_token(POWER)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_92() { - if (jj_scan_token(PI)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_91() { - if (jj_scan_token(MOD)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_90() { - if (jj_scan_token(LOG10)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_89() { - if (jj_scan_token(LOG)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_88() { - if (jj_scan_token(FLOOR)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_87() { - if (jj_scan_token(EXP)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_52() { - if (jj_scan_token(CONCAT)) - return true; - if (jj_3R_36()) - return true; - return false; - } - - private boolean jj_3R_86() { - if (jj_scan_token(DEGREES)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_85() { - if (jj_scan_token(CEILING)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_84() { - if (jj_scan_token(ABS)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_29() { - if (jj_3R_36()) - return true; - Token xsp; - while(true) { - xsp = jj_scanpos; - if (jj_3R_52()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_63() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_84()) { - jj_scanpos = xsp; - if (jj_3R_85()) { - jj_scanpos = xsp; - if (jj_3R_86()) { - jj_scanpos = xsp; - if (jj_3R_87()) { - jj_scanpos = xsp; - if (jj_3R_88()) { - jj_scanpos = xsp; - if (jj_3R_89()) { - jj_scanpos = xsp; - if (jj_3R_90()) { - jj_scanpos = xsp; - if (jj_3R_91()) { - jj_scanpos = xsp; - if (jj_3R_92()) { - jj_scanpos = xsp; - if (jj_3R_93()) { - jj_scanpos = xsp; - if (jj_3R_94()) { - jj_scanpos = xsp; - if (jj_3R_95()) { - jj_scanpos = xsp; - if (jj_3R_96()) { - jj_scanpos = xsp; - if (jj_3R_97()) { - jj_scanpos = xsp; - if (jj_3R_98()) - return true; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_61() { - if (jj_scan_token(MINUS)) - return true; - return false; - } - - private boolean jj_3R_50() { - if (jj_3R_26()) - return true; - return false; - } - - private boolean jj_3R_49() { - if (jj_3R_65()) - return true; - return false; - } - - private boolean jj_3R_48() { - if (jj_3R_64()) - return true; - return false; - } - - private boolean jj_3R_47() { - if (jj_3R_63()) - return true; - return false; - } - - private boolean jj_3R_25() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_47()) { - jj_scanpos = xsp; - if (jj_3R_48()) { - jj_scanpos = xsp; - if (jj_3R_49()) { - jj_scanpos = xsp; - if (jj_3R_50()) - return true; - } - } - } - return false; - } - - private boolean jj_3_12() { - if (jj_3R_25()) - return true; - return false; - } - - private boolean jj_3R_45() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(9)) { - jj_scanpos = xsp; - if (jj_3R_61()) - return true; - } - return false; - } - - private boolean jj_3R_32() { - if (jj_3R_14()) - return true; - if (jj_scan_token(DOT)) - return true; - return false; - } - - private boolean jj_3R_137() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(11)) { - jj_scanpos = xsp; - if (jj_scan_token(12)) - return true; - } - if (jj_3R_130()) - return true; - return false; - } - - private boolean jj_3R_24() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_45()) - jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3_12()) { - jj_scanpos = xsp; - if (jj_3R_46()) - return true; - } - return false; - } - - private boolean jj_3R_15() { - if (jj_3R_14()) - return true; - if (jj_scan_token(DOT)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_32()) - jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_77() { - if (jj_scan_token(COORDSYS)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_119()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_145() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3R_143() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3R_140() { - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_139()) - return true; - return false; - } - - private boolean jj_3R_131() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(9)) { - jj_scanpos = xsp; - if (jj_scan_token(10)) - return true; - } - if (jj_3R_112()) - return true; - return false; - } - - private boolean jj_3R_59() { - if (jj_scan_token(POINT)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_138()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_139()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_130() { - if (jj_3R_24()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_137()) - jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_42() { - if (jj_scan_token(REGION)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_29()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_19() { - if (jj_3R_24()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(9)) { - jj_scanpos = xsp; - if (jj_scan_token(10)) { - jj_scanpos = xsp; - if (jj_scan_token(11)) { - jj_scanpos = xsp; - if (jj_scan_token(12)) - return true; - } - } - } - return false; - } - - private boolean jj_3R_20() { - if (jj_3R_36()) - return true; - if (jj_scan_token(CONCAT)) - return true; - return false; - } - - private boolean jj_3_1() { - if (jj_3R_14()) - return true; - if (jj_scan_token(DOT)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_15()) - jj_scanpos = xsp; - if (jj_scan_token(ASTERISK)) - return true; - return false; - } - - private boolean jj_3R_41() { - if (jj_scan_token(POLYGON)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_138()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_139()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_139()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_139()) - return true; - Token xsp; - while(true) { - xsp = jj_scanpos; - if (jj_3R_140()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_72() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3R_40() { - if (jj_3R_59()) - return true; - return false; - } - - private boolean jj_3_10() { - if (jj_3R_23()) - return true; - return false; - } - - private boolean jj_3R_112() { - if (jj_3R_130()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_131()) - jj_scanpos = xsp; - return false; - } - - private boolean jj_3_9() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3_7() { - if (jj_scan_token(REGULAR_IDENTIFIER_CANDIDATE)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - return false; - } - - private boolean jj_3_6() { - if (jj_scan_token(LEFT_PAR)) - return true; - return false; - } - - private boolean jj_3R_39() { - if (jj_scan_token(CIRCLE)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_138()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_139()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3_5() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(65)) { - jj_scanpos = xsp; - if (jj_3R_20()) - return true; - } - return false; - } - - private boolean jj_3_4() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_18()) { - jj_scanpos = xsp; - if (jj_3R_19()) - return true; - } - return false; - } - - private boolean jj_3R_18() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(9)) { - jj_scanpos = xsp; - if (jj_scan_token(10)) - return true; - } - return false; - } - - private boolean jj_3R_38() { - if (jj_scan_token(CENTROID)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_119()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3_11() { - if (jj_3R_24()) - return true; - return false; - } - - private boolean jj_3R_71() { - if (jj_3R_36()) - return true; - return false; - } - - private boolean jj_3R_70() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3_8() { - if (jj_3R_21()) - return true; - return false; - } - - private boolean jj_3R_69() { - if (jj_3R_26()) - return true; - return false; - } - - private boolean jj_3R_68() { - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_51()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_37() { - if (jj_scan_token(BOX)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_138()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_139()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_67() { - if (jj_3R_29()) - return true; - return false; - } - - private boolean jj_3R_66() { - if (jj_3R_112()) - return true; - return false; - } - - private boolean jj_3R_152() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3R_53() { - if (jj_scan_token(SELECT)) - return true; - return false; - } - - private boolean jj_3R_125() { - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_51()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_144() { - if (jj_3R_59()) - return true; - return false; - } - - private boolean jj_3R_21() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_37()) { - jj_scanpos = xsp; - if (jj_3R_38()) { - jj_scanpos = xsp; - if (jj_3R_39()) { - jj_scanpos = xsp; - if (jj_3R_40()) { - jj_scanpos = xsp; - if (jj_3R_41()) { - jj_scanpos = xsp; - if (jj_3R_42()) - return true; - } - } - } - } - } - return false; - } - - private boolean jj_3R_148() { - if (jj_3R_51()) - return true; - return false; - } - - private boolean jj_3R_142() { - if (jj_3R_59()) - return true; - return false; - } - - private boolean jj_3R_124() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3R_51() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_66()) { - jj_scanpos = xsp; - if (jj_3R_67()) { - jj_scanpos = xsp; - if (jj_3R_68()) { - jj_scanpos = xsp; - if (jj_3R_69()) { - jj_scanpos = xsp; - if (jj_3_8()) { - jj_scanpos = xsp; - if (jj_3R_70()) { - jj_scanpos = xsp; - if (jj_3R_71()) { - jj_scanpos = xsp; - if (jj_3_11()) { - jj_scanpos = xsp; - if (jj_3R_72()) - return true; - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_147() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3R_123() { - if (jj_3R_129()) - return true; - return false; - } - - private boolean jj_3R_151() { - if (jj_3R_59()) - return true; - return false; - } - - private boolean jj_3R_138() { - if (jj_3R_29()) - return true; - return false; - } - - private boolean jj_3R_122() { - if (jj_3R_128()) - return true; - return false; - } - - private boolean jj_3R_16() { - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_33()) - return true; - return false; - } - - private boolean jj_3R_121() { - if (jj_3R_23()) - return true; - return false; - } - - private boolean jj_3R_115() { - if (jj_scan_token(FULL)) - return true; - return false; - } - - private boolean jj_3R_146() { - if (jj_3R_59()) - return true; - return false; - } - - private boolean jj_3R_83() { - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_112()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_82() { - if (jj_3R_129()) - return true; - return false; - } - - private boolean jj_3R_78() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_121()) { - jj_scanpos = xsp; - if (jj_3R_122()) { - jj_scanpos = xsp; - if (jj_3R_123()) { - jj_scanpos = xsp; - if (jj_3R_124()) { - jj_scanpos = xsp; - if (jj_3R_125()) - return true; - } - } - } - } - return false; - } - - private boolean jj_3R_81() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3R_80() { - if (jj_3R_128()) - return true; - return false; - } - - private boolean jj_3R_111() { - if (jj_scan_token(DISTANCE)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_146()) { - jj_scanpos = xsp; - if (jj_3R_147()) - return true; - } - if (jj_scan_token(COMMA)) - return true; - xsp = jj_scanpos; - if (jj_3R_151()) { - jj_scanpos = xsp; - if (jj_3R_152()) - return true; - } - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_110() { - if (jj_scan_token(COORD2)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_144()) { - jj_scanpos = xsp; - if (jj_3R_145()) - return true; - } - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_109() { - if (jj_scan_token(COORD1)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_142()) { - jj_scanpos = xsp; - if (jj_3R_143()) - return true; - } - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_108() { - if (jj_scan_token(AREA)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_119()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_118() { - if (jj_scan_token(FULL)) - return true; - return false; - } - - private boolean jj_3R_62() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_80()) { - jj_scanpos = xsp; - if (jj_3R_81()) { - jj_scanpos = xsp; - if (jj_3R_82()) { - jj_scanpos = xsp; - if (jj_3R_83()) - return true; - } - } - } - return false; - } - - private boolean jj_3R_107() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(60)) { - jj_scanpos = xsp; - if (jj_scan_token(61)) - return true; - } - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_119()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_119()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_33() { - if (jj_3R_53()) - return true; - return false; - } - - private boolean jj_3R_114() { - if (jj_scan_token(RIGHT)) - return true; - return false; - } - - private boolean jj_3R_154() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(9)) { - jj_scanpos = xsp; - if (jj_scan_token(10)) - return true; - } - return false; - } - - private boolean jj_3R_153() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_154()) - jj_scanpos = xsp; - if (jj_scan_token(UNSIGNED_INTEGER)) - return true; - return false; - } - - private boolean jj_3R_65() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_107()) { - jj_scanpos = xsp; - if (jj_3R_108()) { - jj_scanpos = xsp; - if (jj_3R_109()) { - jj_scanpos = xsp; - if (jj_3R_110()) { - jj_scanpos = xsp; - if (jj_3R_111()) - return true; - } - } - } - } - return false; - } - - private boolean jj_3R_139() { - if (jj_3R_112()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_112()) - return true; - return false; - } - - private boolean jj_3R_136() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(49)) { - jj_scanpos = xsp; - if (jj_scan_token(50)) { - jj_scanpos = xsp; - if (jj_scan_token(51)) { - jj_scanpos = xsp; - if (jj_scan_token(52)) - return true; - } - } - } - if (jj_scan_token(LEFT_PAR)) - return true; - xsp = jj_scanpos; - if (jj_scan_token(20)) - jj_scanpos = xsp; - if (jj_3R_51()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_135() { - if (jj_scan_token(COUNT)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(20)) - jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(11)) { - jj_scanpos = xsp; - if (jj_3R_148()) - return true; - } - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_117() { - if (jj_scan_token(RIGHT)) - return true; - return false; - } - - private boolean jj_3R_128() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(94)) { - jj_scanpos = xsp; - if (jj_scan_token(95)) { - jj_scanpos = xsp; - if (jj_scan_token(96)) - return true; - } - } - return false; - } - - private boolean jj_3R_129() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_135()) { - jj_scanpos = xsp; - if (jj_3R_136()) - return true; - } - return false; - } - - private boolean jj_3R_113() { - if (jj_scan_token(LEFT)) - return true; - return false; - } - - private boolean jj_3R_73() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_113()) { - jj_scanpos = xsp; - if (jj_3R_114()) { - jj_scanpos = xsp; - if (jj_3R_115()) - return true; - } - } - return false; - } - - private boolean jj_3R_54() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(25)) { - jj_scanpos = xsp; - if (jj_3R_73()) - return true; - } - return false; - } - - private boolean jj_3R_44() { - if (jj_scan_token(STRING_LITERAL)) - return true; - return false; - } - - private boolean jj_3R_23() { - Token xsp; - if (jj_3R_44()) - return true; - while(true) { - xsp = jj_scanpos; - if (jj_3R_44()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_116() { - if (jj_scan_token(LEFT)) - return true; - return false; - } - - private boolean jj_3R_74() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_116()) { - jj_scanpos = xsp; - if (jj_3R_117()) { - jj_scanpos = xsp; - if (jj_3R_118()) - return true; - } - } - xsp = jj_scanpos; - if (jj_scan_token(26)) - jj_scanpos = xsp; - return false; - } - - private boolean jj_3_18() { - if (jj_3R_16()) - return true; - return false; - } - - private boolean jj_3R_55() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(25)) { - jj_scanpos = xsp; - if (jj_3R_74()) - return true; - } - return false; - } - - private boolean jj_3R_35() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_55()) - jj_scanpos = xsp; - if (jj_scan_token(JOIN)) - return true; - if (jj_3R_56()) - return true; - return false; - } - - private boolean jj_3R_34() { - if (jj_scan_token(NATURAL)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_54()) - jj_scanpos = xsp; - if (jj_scan_token(JOIN)) - return true; - return false; - } - - private boolean jj_3R_28() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(36)) - jj_scanpos = xsp; - if (jj_scan_token(BETWEEN)) - return true; - if (jj_3R_51()) - return true; - return false; - } - - private boolean jj_3_15() { - if (jj_3R_28()) - return true; - return false; - } - - private boolean jj_3R_17() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_34()) { - jj_scanpos = xsp; - if (jj_3R_35()) - return true; - } - return false; - } - - private boolean jj_3_17() { - if (jj_3R_29()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(36)) - jj_scanpos = xsp; - if (jj_scan_token(LIKE)) - return true; - return false; - } - - private boolean jj_3R_76() { - if (jj_scan_token(LEFT_PAR)) - return true; - return false; - } - - private boolean jj_3_3() { - if (jj_3R_17()) - return true; - return false; - } - - private boolean jj_3_16() { - if (jj_3R_22()) - return true; - if (jj_scan_token(IS)) - return true; - return false; - } - - /** Generated Token Manager. */ - public ADQLParser200TokenManager token_source; - SimpleCharStream jj_input_stream; - /** Current token. */ - public Token token; - /** Next token. */ - public Token jj_nt; - private int jj_ntk; - private Token jj_scanpos, jj_lastpos; - private int jj_la; - private int jj_gen; - final private int[] jj_la1 = new int[97]; - static private int[] jj_la1_0; - static private int[] jj_la1_1; - static private int[] jj_la1_2; - static private int[] jj_la1_3; - static { - jj_la1_init_0(); - jj_la1_init_1(); - jj_la1_init_2(); - jj_la1_init_3(); - } - - private static void jj_la1_init_0() { - jj_la1_0 = new int[]{ 0x81, 0x0, 0x0, 0x0, 0x0, 0x100000, 0x200000, 0x40, 0x0, 0x0, 0x800000, 0x800000, 0x800, 0x608, 0x40, 0x40, 0x40, 0x0, 0x20, 0x20, 0x20, 0x0, 0x0, 0x0, 0x800000, 0x800000, 0x800000, 0x0, 0x8, 0x7b000000, 0x38000000, 0x4000000, 0x3a000000, 0x3a000000, 0x38000000, 0x4000000, 0x3a000000, 0x3a000000, 0x40, 0x80000000, 0x7b000000, 0x0, 0x0, 0x0, 0x600, 0x600, 0x8, 0x8, 0x0, 0x600, 0x600, 0x1800, 0x1800, 0x600, 0x600, 0x8, 0x100, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x7e000, 0x0, 0x0, 0x608, 0x7e000, 0x0, 0x0, 0x40, 0x8, 0x100000, 0xe08, 0x0, 0x100000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x608, 0x40, 0x40, 0x0, 0x0, 0x40, 0x608, }; - } - - private static void jj_la1_init_1() { - jj_la1_1 = new int[]{ 0x0, 0x2, 0x1000, 0x2000, 0x4000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xfffe0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18000, 0x18000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3e0000, 0x3e0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3e0000, 0x0, 0x0, 0x3e0000, 0xfc00000, 0x10, 0xc, 0xc, 0x10, 0x0, 0x10, 0x10, 0x0, 0x210, 0x400, 0xfffe0000, 0x0, 0x10, 0x10, 0x0, 0x0, 0x0, 0xfffe0000, 0x1e0000, 0x0, 0x3e0000, 0x30000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0xf0000000, 0x0, 0xfc00000, 0xf0000000, 0xf03e0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0xfffe0000, }; - } - - private static void jj_la1_init_2() { - jj_la1_2 = new int[]{ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe3ffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20000000, 0xc0000000, 0x80000000, 0x0, 0x0, 0xc0000000, 0xe0000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0000000, 0x0, 0x2, 0xe0000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe3ffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe3ffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0x0, 0x0, 0x3fffffd, 0xc3fffffd, 0x0, 0x0, 0x3fff8, 0x3fc0000, 0x0, 0xe3ffffff, }; - } - - private static void jj_la1_init_3() { - jj_la1_3 = new int[]{ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x30, 0x30, 0x0, 0x30, 0x0, 0x31, 0x0, 0x0, 0x0, 0x30, 0x0, 0x0, 0x0, 0x31, 0x0, 0x0, 0x0, 0x30, 0x0, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1, 0x0, 0x0, 0x31, 0x31, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x31, 0x0, 0x0, 0x31, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x31, 0x0, 0x0, 0x0, 0x0, 0x30, 0x30, 0x30, 0x30, 0x0, 0x0, 0x0, 0x20, 0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x31, }; - } - - final private JJCalls[] jj_2_rtns = new JJCalls[18]; - private boolean jj_rescan = false; - private int jj_gc = 0; - - /** Constructor with InputStream. */ - public ADQLParser200(java.io.InputStream stream) { - this(stream, (String)null); - } - - /** Constructor with InputStream and supplied encoding */ - public ADQLParser200(java.io.InputStream stream, String encoding) { - try { - jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); - } catch(java.io.UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - token_source = new ADQLParser200TokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for(int i = 0; i < 97; i++) - jj_la1[i] = -1; - for(int i = 0; i < jj_2_rtns.length; i++) - jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - @Override - public void ReInit(java.io.InputStream stream) { - ReInit(stream, null); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream stream, String encoding) { - try { - jj_input_stream.ReInit(stream, encoding, 1, 1); - } catch(java.io.UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for(int i = 0; i < 97; i++) - jj_la1[i] = -1; - for(int i = 0; i < jj_2_rtns.length; i++) - jj_2_rtns[i] = new JJCalls(); - } - - /** Constructor. */ - public ADQLParser200(java.io.Reader stream) { - jj_input_stream = new SimpleCharStream(stream, 1, 1); - token_source = new ADQLParser200TokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for(int i = 0; i < 97; i++) - jj_la1[i] = -1; - for(int i = 0; i < jj_2_rtns.length; i++) - jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - @Override - public void ReInit(java.io.Reader stream) { - jj_input_stream.ReInit(stream, 1, 1); - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for(int i = 0; i < 97; i++) - jj_la1[i] = -1; - for(int i = 0; i < jj_2_rtns.length; i++) - jj_2_rtns[i] = new JJCalls(); - } - - /** Constructor with generated Token Manager. */ - public ADQLParser200(ADQLParser200TokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for(int i = 0; i < 97; i++) - jj_la1[i] = -1; - for(int i = 0; i < jj_2_rtns.length; i++) - jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - public void ReInit(ADQLParser200TokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for(int i = 0; i < 97; i++) - jj_la1[i] = -1; - for(int i = 0; i < jj_2_rtns.length; i++) - jj_2_rtns[i] = new JJCalls(); - } - - private Token jj_consume_token(int kind) throws ParseException { - Token oldToken; - if ((oldToken = token).next != null) - token = token.next; - else - token = token.next = token_source.getNextToken(); - jj_ntk = -1; - if (token.kind == kind) { - jj_gen++; - if (++jj_gc > 100) { - jj_gc = 0; - for(int i = 0; i < jj_2_rtns.length; i++) { - JJCalls c = jj_2_rtns[i]; - while(c != null) { - if (c.gen < jj_gen) - c.first = null; - c = c.next; - } - } - } - trace_token(token, ""); - return token; - } - token = oldToken; - jj_kind = kind; - throw generateParseException(); - } - - @SuppressWarnings("serial") - static private final class LookaheadSuccess extends java.lang.Error { - } - - final private LookaheadSuccess jj_ls = new LookaheadSuccess(); - - private boolean jj_scan_token(int kind) { - if (jj_scanpos == jj_lastpos) { - jj_la--; - if (jj_scanpos.next == null) { - jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); - } else { - jj_lastpos = jj_scanpos = jj_scanpos.next; - } - } else { - jj_scanpos = jj_scanpos.next; - } - if (jj_rescan) { - int i = 0; - Token tok = token; - while(tok != null && tok != jj_scanpos) { - i++; - tok = tok.next; - } - if (tok != null) - jj_add_error_token(kind, i); - } - if (jj_scanpos.kind != kind) - return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) - throw jj_ls; - return false; - } - - /** Get the next Token. */ - final public Token getNextToken() { - if (token.next != null) - token = token.next; - else - token = token.next = token_source.getNextToken(); - jj_ntk = -1; - jj_gen++; - trace_token(token, " (in getNextToken)"); - return token; - } - - /** Get the specific Token. */ - final public Token getToken(int index) { - Token t = token; - for(int i = 0; i < index; i++) { - if (t.next != null) - t = t.next; - else - t = t.next = token_source.getNextToken(); - } - return t; - } - - private int jj_ntk_f() { - if ((jj_nt = token.next) == null) - return (jj_ntk = (token.next = token_source.getNextToken()).kind); - else - return (jj_ntk = jj_nt.kind); - } - - private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>(); - private int[] jj_expentry; - private int jj_kind = -1; - private int[] jj_lasttokens = new int[100]; - private int jj_endpos; - - private void jj_add_error_token(int kind, int pos) { - if (pos >= 100) - return; - if (pos == jj_endpos + 1) { - jj_lasttokens[jj_endpos++] = kind; - } else if (jj_endpos != 0) { - jj_expentry = new int[jj_endpos]; - for(int i = 0; i < jj_endpos; i++) { - jj_expentry[i] = jj_lasttokens[i]; - } - jj_entries_loop: for(java.util.Iterator<?> it = jj_expentries.iterator(); it.hasNext();) { - int[] oldentry = (int[])(it.next()); - if (oldentry.length == jj_expentry.length) { - for(int i = 0; i < jj_expentry.length; i++) { - if (oldentry[i] != jj_expentry[i]) { - continue jj_entries_loop; - } - } - jj_expentries.add(jj_expentry); - break jj_entries_loop; - } - } - if (pos != 0) - jj_lasttokens[(jj_endpos = pos) - 1] = kind; - } - } - - /** Generate ParseException. */ - public ParseException generateParseException() { - jj_expentries.clear(); - boolean[] la1tokens = new boolean[103]; - if (jj_kind >= 0) { - la1tokens[jj_kind] = true; - jj_kind = -1; - } - for(int i = 0; i < 97; i++) { - if (jj_la1[i] == jj_gen) { - for(int j = 0; j < 32; j++) { - if ((jj_la1_0[i] & (1 << j)) != 0) { - la1tokens[j] = true; - } - if ((jj_la1_1[i] & (1 << j)) != 0) { - la1tokens[32 + j] = true; - } - if ((jj_la1_2[i] & (1 << j)) != 0) { - la1tokens[64 + j] = true; - } - if ((jj_la1_3[i] & (1 << j)) != 0) { - la1tokens[96 + j] = true; - } - } - } - } - for(int i = 0; i < 103; i++) { - if (la1tokens[i]) { - jj_expentry = new int[1]; - jj_expentry[0] = i; - jj_expentries.add(jj_expentry); - } - } - jj_endpos = 0; - jj_rescan_token(); - jj_add_error_token(0, 0); - int[][] exptokseq = new int[jj_expentries.size()][]; - for(int i = 0; i < jj_expentries.size(); i++) { - exptokseq[i] = jj_expentries.get(i); - } - return new ParseException(token, exptokseq, tokenImage); - } - - private int trace_indent = 0; - private boolean trace_enabled = true; - - /** Enable tracing. */ - final public void enable_tracing() { - trace_enabled = true; - } - - /** Disable tracing. */ - final public void disable_tracing() { - trace_enabled = false; - } - - private void trace_call(String s) { - if (trace_enabled) { - for(int i = 0; i < trace_indent; i++) { - System.out.print(" "); - } - System.out.println("Call: " + s); - } - trace_indent = trace_indent + 2; - } - - private void trace_return(String s) { - trace_indent = trace_indent - 2; - if (trace_enabled) { - for(int i = 0; i < trace_indent; i++) { - System.out.print(" "); - } - System.out.println("Return: " + s); - } - } - - private void trace_token(Token t, String where) { - if (trace_enabled) { - for(int i = 0; i < trace_indent; i++) { - System.out.print(" "); - } - System.out.print("Consumed token: <" + tokenImage[t.kind]); - if (t.kind != 0 && !tokenImage[t.kind].equals("\"" + t.image + "\"")) { - System.out.print(": \"" + t.image + "\""); - } - System.out.println(" at line " + t.beginLine + " column " + t.beginColumn + ">" + where); - } - } - - private void trace_scan(Token t1, int t2) { - if (trace_enabled) { - for(int i = 0; i < trace_indent; i++) { - System.out.print(" "); - } - System.out.print("Visited token: <" + tokenImage[t1.kind]); - if (t1.kind != 0 && !tokenImage[t1.kind].equals("\"" + t1.image + "\"")) { - System.out.print(": \"" + t1.image + "\""); - } - System.out.println(" at line " + t1.beginLine + " column " + t1.beginColumn + ">; Expected token: <" + tokenImage[t2] + ">"); - } - } - - private void jj_rescan_token() { - jj_rescan = true; - for(int i = 0; i < 18; i++) { - try { - JJCalls p = jj_2_rtns[i]; - do { - if (p.gen > jj_gen) { - jj_la = p.arg; - jj_lastpos = jj_scanpos = p.first; - switch(i) { - case 0: - jj_3_1(); - break; - case 1: - jj_3_2(); - break; - case 2: - jj_3_3(); - break; - case 3: - jj_3_4(); - break; - case 4: - jj_3_5(); - break; - case 5: - jj_3_6(); - break; - case 6: - jj_3_7(); - break; - case 7: - jj_3_8(); - break; - case 8: - jj_3_9(); - break; - case 9: - jj_3_10(); - break; - case 10: - jj_3_11(); - break; - case 11: - jj_3_12(); - break; - case 12: - jj_3_13(); - break; - case 13: - jj_3_14(); - break; - case 14: - jj_3_15(); - break; - case 15: - jj_3_16(); - break; - case 16: - jj_3_17(); - break; - case 17: - jj_3_18(); - break; - } - } - p = p.next; - } while(p != null); - } catch(LookaheadSuccess ls) { - } - } - jj_rescan = false; - } - - private void jj_save(int index, int xla) { - JJCalls p = jj_2_rtns[index]; - while(p.gen > jj_gen) { - if (p.next == null) { - p = p.next = new JJCalls(); - break; - } - p = p.next; - } - p.gen = jj_gen + xla - jj_la; - p.first = token; - p.arg = xla; - } - - static final class JJCalls { - int gen; - Token first; - int arg; - JJCalls next; - } - -} diff --git a/src/adql/parser/ADQLParser200Constants.java b/src/adql/parser/ADQLParser200Constants.java deleted file mode 100644 index 4cd1d26f037f8a29a159dc1e5d6ce02c82214e57..0000000000000000000000000000000000000000 --- a/src/adql/parser/ADQLParser200Constants.java +++ /dev/null @@ -1,320 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. ADQLParser200Constants.java */ -package adql.parser; - - -/** - * Token literal values and constants. - * Generated by org.javacc.parser.OtherFilesGen#start() - */ -public interface ADQLParser200Constants { - - /** End of File. */ - int EOF = 0; - /** RegularExpression Id. */ - int SQL_RESERVED_WORD = 2; - /** RegularExpression Id. */ - int LEFT_PAR = 3; - /** RegularExpression Id. */ - int RIGHT_PAR = 4; - /** RegularExpression Id. */ - int DOT = 5; - /** RegularExpression Id. */ - int COMMA = 6; - /** RegularExpression Id. */ - int EOQ = 7; - /** RegularExpression Id. */ - int CONCAT = 8; - /** RegularExpression Id. */ - int PLUS = 9; - /** RegularExpression Id. */ - int MINUS = 10; - /** RegularExpression Id. */ - int ASTERISK = 11; - /** RegularExpression Id. */ - int DIVIDE = 12; - /** RegularExpression Id. */ - int EQUAL = 13; - /** RegularExpression Id. */ - int NOT_EQUAL = 14; - /** RegularExpression Id. */ - int LESS_THAN = 15; - /** RegularExpression Id. */ - int LESS_EQUAL_THAN = 16; - /** RegularExpression Id. */ - int GREATER_THAN = 17; - /** RegularExpression Id. */ - int GREATER_EQUAL_THAN = 18; - /** RegularExpression Id. */ - int SELECT = 19; - /** RegularExpression Id. */ - int QUANTIFIER = 20; - /** RegularExpression Id. */ - int TOP = 21; - /** RegularExpression Id. */ - int FROM = 22; - /** RegularExpression Id. */ - int AS = 23; - /** RegularExpression Id. */ - int NATURAL = 24; - /** RegularExpression Id. */ - int INNER = 25; - /** RegularExpression Id. */ - int OUTER = 26; - /** RegularExpression Id. */ - int RIGHT = 27; - /** RegularExpression Id. */ - int LEFT = 28; - /** RegularExpression Id. */ - int FULL = 29; - /** RegularExpression Id. */ - int JOIN = 30; - /** RegularExpression Id. */ - int ON = 31; - /** RegularExpression Id. */ - int USING = 32; - /** RegularExpression Id. */ - int WHERE = 33; - /** RegularExpression Id. */ - int AND = 34; - /** RegularExpression Id. */ - int OR = 35; - /** RegularExpression Id. */ - int NOT = 36; - /** RegularExpression Id. */ - int IS = 37; - /** RegularExpression Id. */ - int NULL = 38; - /** RegularExpression Id. */ - int BETWEEN = 39; - /** RegularExpression Id. */ - int LIKE = 40; - /** RegularExpression Id. */ - int IN = 41; - /** RegularExpression Id. */ - int EXISTS = 42; - /** RegularExpression Id. */ - int BY = 43; - /** RegularExpression Id. */ - int GROUP = 44; - /** RegularExpression Id. */ - int HAVING = 45; - /** RegularExpression Id. */ - int ORDER = 46; - /** RegularExpression Id. */ - int ASC = 47; - /** RegularExpression Id. */ - int DESC = 48; - /** RegularExpression Id. */ - int AVG = 49; - /** RegularExpression Id. */ - int MAX = 50; - /** RegularExpression Id. */ - int MIN = 51; - /** RegularExpression Id. */ - int SUM = 52; - /** RegularExpression Id. */ - int COUNT = 53; - /** RegularExpression Id. */ - int BOX = 54; - /** RegularExpression Id. */ - int CENTROID = 55; - /** RegularExpression Id. */ - int CIRCLE = 56; - /** RegularExpression Id. */ - int POINT = 57; - /** RegularExpression Id. */ - int POLYGON = 58; - /** RegularExpression Id. */ - int REGION = 59; - /** RegularExpression Id. */ - int CONTAINS = 60; - /** RegularExpression Id. */ - int INTERSECTS = 61; - /** RegularExpression Id. */ - int AREA = 62; - /** RegularExpression Id. */ - int COORD1 = 63; - /** RegularExpression Id. */ - int COORD2 = 64; - /** RegularExpression Id. */ - int COORDSYS = 65; - /** RegularExpression Id. */ - int DISTANCE = 66; - /** RegularExpression Id. */ - int ABS = 67; - /** RegularExpression Id. */ - int CEILING = 68; - /** RegularExpression Id. */ - int DEGREES = 69; - /** RegularExpression Id. */ - int EXP = 70; - /** RegularExpression Id. */ - int FLOOR = 71; - /** RegularExpression Id. */ - int LOG = 72; - /** RegularExpression Id. */ - int LOG10 = 73; - /** RegularExpression Id. */ - int MOD = 74; - /** RegularExpression Id. */ - int PI = 75; - /** RegularExpression Id. */ - int POWER = 76; - /** RegularExpression Id. */ - int RADIANS = 77; - /** RegularExpression Id. */ - int RAND = 78; - /** RegularExpression Id. */ - int ROUND = 79; - /** RegularExpression Id. */ - int SQRT = 80; - /** RegularExpression Id. */ - int TRUNCATE = 81; - /** RegularExpression Id. */ - int ACOS = 82; - /** RegularExpression Id. */ - int ASIN = 83; - /** RegularExpression Id. */ - int ATAN = 84; - /** RegularExpression Id. */ - int ATAN2 = 85; - /** RegularExpression Id. */ - int COS = 86; - /** RegularExpression Id. */ - int COT = 87; - /** RegularExpression Id. */ - int SIN = 88; - /** RegularExpression Id. */ - int TAN = 89; - /** RegularExpression Id. */ - int STRING_LITERAL = 93; - /** RegularExpression Id. */ - int SCIENTIFIC_NUMBER = 94; - /** RegularExpression Id. */ - int UNSIGNED_FLOAT = 95; - /** RegularExpression Id. */ - int UNSIGNED_INTEGER = 96; - /** RegularExpression Id. */ - int DIGIT = 97; - /** RegularExpression Id. */ - int DELIMITED_IDENTIFIER = 100; - /** RegularExpression Id. */ - int REGULAR_IDENTIFIER_CANDIDATE = 101; - /** RegularExpression Id. */ - int Letter = 102; - - /** Lexical state. */ - int DEFAULT = 0; - /** Lexical state. */ - int WithinString = 1; - /** Lexical state. */ - int WithinDelimitedId = 2; - - /** Literal token values. */ - String[] tokenImage = { - "<EOF>", - "<token of kind 1>", - "<SQL_RESERVED_WORD>", - "\"(\"", - "\")\"", - "\".\"", - "\",\"", - "\";\"", - "\"||\"", - "\"+\"", - "\"-\"", - "\"*\"", - "\"/\"", - "\"=\"", - "<NOT_EQUAL>", - "\"<\"", - "\"<=\"", - "\">\"", - "\">=\"", - "\"SELECT\"", - "<QUANTIFIER>", - "\"TOP\"", - "\"FROM\"", - "\"AS\"", - "\"NATURAL\"", - "\"INNER\"", - "\"OUTER\"", - "\"RIGHT\"", - "\"LEFT\"", - "\"FULL\"", - "\"JOIN\"", - "\"ON\"", - "\"USING\"", - "\"WHERE\"", - "\"AND\"", - "\"OR\"", - "\"NOT\"", - "\"IS\"", - "\"NULL\"", - "\"BETWEEN\"", - "\"LIKE\"", - "\"IN\"", - "\"EXISTS\"", - "\"BY\"", - "\"GROUP\"", - "\"HAVING\"", - "\"ORDER\"", - "\"ASC\"", - "\"DESC\"", - "\"AVG\"", - "\"MAX\"", - "\"MIN\"", - "\"SUM\"", - "\"COUNT\"", - "\"BOX\"", - "\"CENTROID\"", - "\"CIRCLE\"", - "\"POINT\"", - "\"POLYGON\"", - "\"REGION\"", - "\"CONTAINS\"", - "\"INTERSECTS\"", - "\"AREA\"", - "\"COORD1\"", - "\"COORD2\"", - "\"COORDSYS\"", - "\"DISTANCE\"", - "\"ABS\"", - "\"CEILING\"", - "\"DEGREES\"", - "\"EXP\"", - "\"FLOOR\"", - "\"LOG\"", - "\"LOG10\"", - "\"MOD\"", - "\"PI\"", - "\"POWER\"", - "\"RADIANS\"", - "\"RAND\"", - "\"ROUND\"", - "\"SQRT\"", - "\"TRUNCATE\"", - "\"ACOS\"", - "\"ASIN\"", - "\"ATAN\"", - "\"ATAN2\"", - "\"COS\"", - "\"COT\"", - "\"SIN\"", - "\"TAN\"", - "<token of kind 90>", - "\"\\\'\"", - "<token of kind 92>", - "\"\\\'\"", - "<SCIENTIFIC_NUMBER>", - "<UNSIGNED_FLOAT>", - "<UNSIGNED_INTEGER>", - "<DIGIT>", - "\"\\\"\"", - "<token of kind 99>", - "\"\\\"\"", - "<REGULAR_IDENTIFIER_CANDIDATE>", - "<Letter>", - }; - -} diff --git a/src/adql/parser/ADQLParser200TokenManager.java b/src/adql/parser/ADQLParser200TokenManager.java deleted file mode 100644 index 3e87d17eb1df94451d18b4555352debede0f65b4..0000000000000000000000000000000000000000 --- a/src/adql/parser/ADQLParser200TokenManager.java +++ /dev/null @@ -1,8567 +0,0 @@ -/* ADQLParser200TokenManager.java */ -/* Generated By:JavaCC: Do not edit this line. ADQLParser200TokenManager.java */ -package adql.parser; -/* - * This file is part of ADQLLibrary. - * - * ADQLLibrary is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * ADQLLibrary is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2019 - UDS/Centre de Données astronomiques de Strasbourg (CDS) - */ - -import java.util.Stack; -import java.util.Vector; -import java.util.ArrayList; -import java.util.Collection; -import java.io.FileReader; -import java.io.IOException; -import adql.db.exception.UnresolvedIdentifiersException; -import adql.db.exception.UnsupportedFeatureException; -import adql.parser.ADQLParserFactory.ADQLVersion; -import adql.parser.IdentifierItems.IdentifierItem; -import adql.parser.ADQLQueryFactory.JoinType; -import adql.parser.feature.FeatureSet; -import adql.parser.feature.LanguageFeature; -import adql.query.*; -import adql.query.from.*; -import adql.query.constraint.*; -import adql.query.operand.*; -import adql.query.operand.function.*; -import adql.query.operand.function.geometry.*; -import adql.query.operand.function.geometry.GeometryFunction.GeometryValue; -import adql.search.SearchOptionalFeaturesHandler; -import adql.translator.PostgreSQLTranslator; -import adql.translator.TranslationException; - -/** Token Manager. */ -@SuppressWarnings("unused")public class ADQLParser200TokenManager implements ADQLParser200Constants { - protected void CommonTokenAction(final Token t) { - t.adqlVersion = ADQLParserFactory.ADQLVersion.V2_0; - } - - /** Debug output. */ - public java.io.PrintStream debugStream = System.out; - /** Set debug output. */ - public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } -private final int jjStopStringLiteralDfa_2(int pos, long active0, long active1) -{ - switch (pos) - { - default : - return -1; - } -} -private final int jjStartNfa_2(int pos, long active0, long active1) -{ - return jjMoveNfa_2(jjStopStringLiteralDfa_2(pos, active0, active1), pos + 1); -} -private int jjStopAtPos(int pos, int kind) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - return pos + 1; -} -private int jjMoveStringLiteralDfa0_2() -{ - switch(curChar) - { - case 34: - return jjStartNfaWithStates_2(0, 100, 1); - default : - return jjMoveNfa_2(0, 0); - } -} -private int jjStartNfaWithStates_2(int pos, int kind, int state) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return pos + 1; } - return jjMoveNfa_2(state, pos + 1); -} -static final long[] jjbitVec0 = { - 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL -}; -private int jjMoveNfa_2(int startState, int curPos) -{ - int startsAt = 0; - jjnewStateCnt = 3; - int i = 1; - jjstateSet[0] = startState; - int kind = 0x7fffffff; - for (;;) - { - if (++jjround == 0x7fffffff) - ReInitRounds(); - if (curChar < 64) - { - long l = 1L << curChar; - do - { - switch(jjstateSet[--i]) - { - case 0: - if ((0xfffffffbffffffffL & l) != 0L) - { - if (kind > 99) - kind = 99; - } - else if (curChar == 34) - jjstateSet[jjnewStateCnt++] = 1; - break; - case 1: - if (curChar == 34 && kind > 99) - kind = 99; - break; - case 2: - if (curChar == 34) - jjstateSet[jjnewStateCnt++] = 1; - break; - default : break; - } - } while(i != startsAt); - } - else if (curChar < 128) - { - long l = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 0: - kind = 99; - break; - default : break; - } - } while(i != startsAt); - } - else - { - int i2 = (curChar & 0xff) >> 6; - long l2 = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 0: - if ((jjbitVec0[i2] & l2) != 0L && kind > 99) - kind = 99; - break; - default : break; - } - } while(i != startsAt); - } - if (kind != 0x7fffffff) - { - jjmatchedKind = kind; - jjmatchedPos = curPos; - kind = 0x7fffffff; - } - ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt))) - return curPos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return curPos; } - } -} -private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) -{ - switch (pos) - { - case 0: - if ((active0 & 0x600000000000000L) != 0L || (active1 & 0x1800L) != 0L) - { - jjmatchedKind = 101; - return 491; - } - if ((active0 & 0x10010000000L) != 0L || (active1 & 0x300L) != 0L) - { - jjmatchedKind = 101; - return 404; - } - if ((active0 & 0x200000L) != 0L || (active1 & 0x2020000L) != 0L) - { - jjmatchedKind = 101; - return 670; - } - if ((active0 & 0x5001000000L) != 0L) - { - jjmatchedKind = 101; - return 439; - } - if ((active0 & 0x2000022002000000L) != 0L) - { - jjmatchedKind = 101; - return 332; - } - if ((active0 & 0x4002800400800000L) != 0L || (active1 & 0x3c0008L) != 0L) - { - jjmatchedKind = 101; - return 910; - } - if ((active0 & 0x40000000L) != 0L) - { - jjmatchedKind = 101; - return 965; - } - if ((active0 & 0x20L) != 0L) - return 966; - if ((active0 & 0x100000000L) != 0L) - { - jjmatchedKind = 101; - return 752; - } - if ((active0 & 0x1000000000000L) != 0L || (active1 & 0x24L) != 0L) - { - jjmatchedKind = 101; - return 813; - } - if ((active0 & 0x100000000000L) != 0L) - { - jjmatchedKind = 101; - return 315; - } - if ((active0 & 0x18000L) != 0L) - return 17; - if ((active0 & 0x400L) != 0L) - return 22; - if ((active0 & 0x40088000000000L) != 0L) - { - jjmatchedKind = 101; - return 33; - } - if ((active0 & 0x20400000L) != 0L || (active1 & 0x80L) != 0L) - { - jjmatchedKind = 101; - return 295; - } - if ((active0 & 0xc000000000000L) != 0L || (active1 & 0x400L) != 0L) - { - jjmatchedKind = 101; - return 424; - } - if ((active0 & 0x91a0000000000000L) != 0L || (active1 & 0xc00013L) != 0L) - { - jjmatchedKind = 101; - return 52; - } - if ((active0 & 0x800000008000000L) != 0L || (active1 & 0xe000L) != 0L) - { - jjmatchedKind = 101; - return 550; - } - if ((active0 & 0x10000000080000L) != 0L || (active1 & 0x1010000L) != 0L) - { - jjmatchedKind = 101; - return 590; - } - if ((active0 & 0x40000000000L) != 0L || (active1 & 0x40L) != 0L) - { - jjmatchedKind = 101; - return 249; - } - if ((active0 & 0x200000000L) != 0L) - { - jjmatchedKind = 101; - return 797; - } - if ((active0 & 0x400884000000L) != 0L) - { - jjmatchedKind = 101; - return 471; - } - if ((active0 & 0x200000000000L) != 0L) - { - jjmatchedKind = 101; - return 5; - } - return -1; - case 1: - if ((active0 & 0x2000020002000000L) != 0L) - return 345; - if ((active0 & 0x40000000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 45; - } - if ((active1 & 0x40000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 913; - } - if ((active1 & 0x2000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 669; - } - if ((active0 & 0x8000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 32; - } - if ((active0 & 0x1000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 438; - } - if ((active0 & 0x10000000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 656; - } - if ((active0 & 0x100000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 770; - } - if ((active0 & 0x800000000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 549; - } - if ((active0 & 0x2000000000L) != 0L) - return 396; - if ((active1 & 0x400L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 431; - } - if ((active1 & 0x10000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 637; - } - if ((active0 & 0x4000000000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 967; - } - if ((active0 & 0x4000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 482; - } - if ((active0 & 0x400000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 968; - } - if ((active1 & 0x300L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 416; - } - if ((active0 & 0x600000000000000L) != 0L || (active1 & 0x1000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 501; - } - if ((active1 & 0x8L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 909; - } - if ((active0 & 0x200000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 796; - } - if ((active0 & 0x8000000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 427; - } - if ((active0 & 0x182210068400000L) != 0L || (active1 & 0x6010L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 965; - } - if ((active0 & 0x10000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 410; - } - if ((active0 & 0x1000000000000L) != 0L || (active1 & 0x20L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 821; - } - if ((active1 & 0x4L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 877; - } - if ((active0 & 0x480800000000L) != 0L || (active1 & 0x800L) != 0L) - return 965; - if ((active1 & 0x20000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 717; - } - if ((active1 & 0x80L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 303; - } - if ((active0 & 0x40000000000L) != 0L || (active1 & 0x40L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 264; - } - if ((active1 & 0x8000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 581; - } - if ((active0 & 0x80000000L) != 0L) - return 472; - if ((active0 & 0x4000000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 423; - } - if ((active0 & 0x1000200000L) != 0L || (active1 & 0x300000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 2; - jjmatchedPos = 1; - } - return 965; - } - if ((active0 & 0x4000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 454; - } - if ((active0 & 0x100000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 324; - } - if ((active0 & 0x800000800000L) != 0L || (active1 & 0x80000L) != 0L) - return 932; - if ((active1 & 0x1000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 620; - } - if ((active0 & 0x80000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 597; - } - if ((active0 & 0x9020000000000000L) != 0L || (active1 & 0xc00003L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 101; - jjmatchedPos = 1; - } - return 113; - } - return -1; - case 2: - if ((active0 & 0x56801400200000L) != 0L || (active1 & 0x3c00340L) != 0L) - return 965; - if ((active0 & 0x8fa075817a480000L) != 0L || (active1 & 0x3df033L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 101; - jjmatchedPos = 2; - } - return 965; - } - if ((active0 & 0x1000000000000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 101; - jjmatchedPos = 2; - } - return 859; - } - if ((active0 & 0x8000000000000L) != 0L) - return 426; - if ((active0 & 0x2000000000000000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 2; - jjmatchedPos = 2; - } - return 373; - } - if ((active0 & 0x4000000000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 101; - jjmatchedPos = 2; - } - return 453; - } - if ((active1 & 0x4L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 101; - jjmatchedPos = 2; - } - return 884; - } - if ((active1 & 0x400L) != 0L) - return 430; - if ((active1 & 0x8L) != 0L) - return 908; - if ((active0 & 0x200000000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 101; - jjmatchedPos = 2; - } - return 801; - } - if ((active0 & 0x4000000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 101; - jjmatchedPos = 2; - } - return 481; - } - if ((active1 & 0x20000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 101; - jjmatchedPos = 2; - } - return 967; - } - if ((active0 & 0x4000000000000000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 2; - jjmatchedPos = 2; - } - return 965; - } - if ((active0 & 0x1000000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 101; - jjmatchedPos = 2; - } - return 443; - } - if ((active0 & 0x1000000000000000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 101; - jjmatchedPos = 2; - } - return 137; - } - if ((active1 & 0x80L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 101; - jjmatchedPos = 2; - } - return 302; - } - return -1; - case 3: - if ((active1 & 0x4L) != 0L) - { - if (jjmatchedPos != 3) - { - jjmatchedKind = 101; - jjmatchedPos = 3; - } - return 900; - } - if ((active0 & 0x8fa074830f080000L) != 0L || (active1 & 0x2b0b3L) != 0L) - { - if (jjmatchedPos != 3) - { - jjmatchedKind = 101; - jjmatchedPos = 3; - } - return 965; - } - if ((active0 & 0x1000000000000000L) != 0L) - { - if (jjmatchedPos != 3) - { - jjmatchedKind = 101; - jjmatchedPos = 3; - } - return 168; - } - if ((active0 & 0x4000000000L) != 0L) - return 452; - if ((active0 & 0x2000000000000000L) != 0L) - { - if (jjmatchedPos != 3) - { - jjmatchedKind = 101; - jjmatchedPos = 3; - } - return 372; - } - if ((active0 & 0x4000010070400000L) != 0L || (active1 & 0x3d4000L) != 0L) - return 965; - if ((active1 & 0x200L) != 0L) - { - if (jjmatchedPos != 3) - { - jjmatchedKind = 101; - jjmatchedPos = 3; - } - return 28; - } - if ((active0 & 0x1000000000000L) != 0L) - return 858; - return -1; - case 4: - if ((active0 & 0x9d80248001080000L) != 0L || (active1 & 0x22037L) != 0L) - { - jjmatchedKind = 101; - jjmatchedPos = 4; - return 965; - } - if ((active1 & 0x200200L) != 0L) - return 28; - if ((active0 & 0x2000000000000000L) != 0L) - { - jjmatchedKind = 101; - jjmatchedPos = 4; - return 378; - } - if ((active0 & 0x22050030e000000L) != 0L || (active1 & 0x9080L) != 0L) - return 965; - return -1; - case 5: - if ((active0 & 0x8000000000000000L) != 0L || (active1 & 0x1L) != 0L) - return 28; - if ((active0 & 0x2000000000000000L) != 0L) - { - jjmatchedKind = 101; - jjmatchedPos = 5; - return 377; - } - if ((active0 & 0x900240000080000L) != 0L) - return 965; - if ((active0 & 0x1480008001000000L) != 0L || (active1 & 0x22036L) != 0L) - { - jjmatchedKind = 101; - jjmatchedPos = 5; - return 965; - } - return -1; - case 6: - if ((active0 & 0x2000000000000000L) != 0L) - { - jjmatchedKind = 101; - jjmatchedPos = 6; - return 376; - } - if ((active0 & 0x1080000000000000L) != 0L || (active1 & 0x20006L) != 0L) - { - jjmatchedKind = 101; - jjmatchedPos = 6; - return 965; - } - if ((active0 & 0x400008001000000L) != 0L || (active1 & 0x2030L) != 0L) - return 965; - return -1; - case 7: - if ((active0 & 0x1080000000000000L) != 0L || (active1 & 0x20006L) != 0L) - return 965; - if ((active0 & 0x2000000000000000L) != 0L) - { - jjmatchedKind = 101; - jjmatchedPos = 7; - return 969; - } - return -1; - case 8: - if ((active0 & 0x2000000000000000L) != 0L) - { - jjmatchedKind = 2; - jjmatchedPos = 8; - return 965; - } - return -1; - default : - return -1; - } -} -private final int jjStartNfa_0(int pos, long active0, long active1) -{ - return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1); -} -private int jjMoveStringLiteralDfa0_0() -{ - switch(curChar) - { - case 34: - return jjStopAtPos(0, 98); - case 39: - return jjStopAtPos(0, 91); - case 40: - return jjStopAtPos(0, 3); - case 41: - return jjStopAtPos(0, 4); - case 42: - return jjStopAtPos(0, 11); - case 43: - return jjStopAtPos(0, 9); - case 44: - return jjStopAtPos(0, 6); - case 45: - return jjStartNfaWithStates_0(0, 10, 22); - case 46: - return jjStartNfaWithStates_0(0, 5, 966); - case 47: - return jjStopAtPos(0, 12); - case 59: - return jjStopAtPos(0, 7); - case 60: - jjmatchedKind = 15; - return jjMoveStringLiteralDfa1_0(0x10000L, 0x0L); - case 61: - return jjStopAtPos(0, 13); - case 62: - jjmatchedKind = 17; - return jjMoveStringLiteralDfa1_0(0x40000L, 0x0L); - case 65: - case 97: - return jjMoveStringLiteralDfa1_0(0x4002800400800000L, 0x3c0008L); - case 66: - case 98: - return jjMoveStringLiteralDfa1_0(0x40088000000000L, 0x0L); - case 67: - case 99: - return jjMoveStringLiteralDfa1_0(0x91a0000000000000L, 0xc00013L); - case 68: - case 100: - return jjMoveStringLiteralDfa1_0(0x1000000000000L, 0x24L); - case 69: - case 101: - return jjMoveStringLiteralDfa1_0(0x40000000000L, 0x40L); - case 70: - case 102: - return jjMoveStringLiteralDfa1_0(0x20400000L, 0x80L); - case 71: - case 103: - return jjMoveStringLiteralDfa1_0(0x100000000000L, 0x0L); - case 72: - case 104: - return jjMoveStringLiteralDfa1_0(0x200000000000L, 0x0L); - case 73: - case 105: - return jjMoveStringLiteralDfa1_0(0x2000022002000000L, 0x0L); - case 74: - case 106: - return jjMoveStringLiteralDfa1_0(0x40000000L, 0x0L); - case 76: - case 108: - return jjMoveStringLiteralDfa1_0(0x10010000000L, 0x300L); - case 77: - case 109: - return jjMoveStringLiteralDfa1_0(0xc000000000000L, 0x400L); - case 78: - case 110: - return jjMoveStringLiteralDfa1_0(0x5001000000L, 0x0L); - case 79: - case 111: - return jjMoveStringLiteralDfa1_0(0x400884000000L, 0x0L); - case 80: - case 112: - return jjMoveStringLiteralDfa1_0(0x600000000000000L, 0x1800L); - case 82: - case 114: - return jjMoveStringLiteralDfa1_0(0x800000008000000L, 0xe000L); - case 83: - case 115: - return jjMoveStringLiteralDfa1_0(0x10000000080000L, 0x1010000L); - case 84: - case 116: - return jjMoveStringLiteralDfa1_0(0x200000L, 0x2020000L); - case 85: - case 117: - return jjMoveStringLiteralDfa1_0(0x100000000L, 0x0L); - case 87: - case 119: - return jjMoveStringLiteralDfa1_0(0x200000000L, 0x0L); - case 124: - return jjMoveStringLiteralDfa1_0(0x100L, 0x0L); - default : - return jjMoveNfa_0(0, 0); - } -} -private int jjMoveStringLiteralDfa1_0(long active0, long active1) -{ - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(0, active0, active1); - return 1; - } - switch(curChar) - { - case 61: - if ((active0 & 0x10000L) != 0L) - return jjStopAtPos(1, 16); - else if ((active0 & 0x40000L) != 0L) - return jjStopAtPos(1, 18); - break; - case 65: - case 97: - return jjMoveStringLiteralDfa2_0(active0, 0x4200001000000L, active1, 0x2006000L); - case 66: - case 98: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x8L); - case 67: - case 99: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x40000L); - case 69: - case 101: - return jjMoveStringLiteralDfa2_0(active0, 0x881008010080000L, active1, 0x30L); - case 72: - case 104: - return jjMoveStringLiteralDfa2_0(active0, 0x200000000L, active1, 0L); - case 73: - case 105: - if ((active1 & 0x800L) != 0L) - return jjStartNfaWithStates_0(1, 75, 965); - return jjMoveStringLiteralDfa2_0(active0, 0x108010008000000L, active1, 0x1000004L); - case 76: - case 108: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x80L); - case 78: - case 110: - if ((active0 & 0x80000000L) != 0L) - return jjStartNfaWithStates_0(1, 31, 472); - else if ((active0 & 0x20000000000L) != 0L) - { - jjmatchedKind = 41; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0x2000000402000000L, active1, 0L); - case 79: - case 111: - return jjMoveStringLiteralDfa2_0(active0, 0x9660001040200000L, active1, 0xc09703L); - case 81: - case 113: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x10000L); - case 82: - case 114: - if ((active0 & 0x800000000L) != 0L) - { - jjmatchedKind = 35; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0x4000500000400000L, active1, 0x20000L); - case 83: - case 115: - if ((active0 & 0x800000L) != 0L) - { - jjmatchedKind = 23; - jjmatchedPos = 1; - } - else if ((active0 & 0x2000000000L) != 0L) - return jjStartNfaWithStates_0(1, 37, 396); - return jjMoveStringLiteralDfa2_0(active0, 0x800100000000L, active1, 0x80000L); - case 84: - case 116: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x300000L); - case 85: - case 117: - return jjMoveStringLiteralDfa2_0(active0, 0x10004024000000L, active1, 0L); - case 86: - case 118: - return jjMoveStringLiteralDfa2_0(active0, 0x2000000000000L, active1, 0L); - case 88: - case 120: - return jjMoveStringLiteralDfa2_0(active0, 0x40000000000L, active1, 0x40L); - case 89: - case 121: - if ((active0 & 0x80000000000L) != 0L) - return jjStartNfaWithStates_0(1, 43, 965); - break; - case 124: - if ((active0 & 0x100L) != 0L) - return jjStopAtPos(1, 8); - break; - default : - break; - } - return jjStartNfa_0(0, active0, active1); -} -private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1) -{ - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(0, old0, old1); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(1, active0, active1); - return 2; - } - switch(curChar) - { - case 65: - case 97: - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x300000L); - case 67: - case 99: - if ((active0 & 0x800000000000L) != 0L) - return jjStartNfaWithStates_0(2, 47, 965); - break; - case 68: - case 100: - if ((active0 & 0x400000000L) != 0L) - return jjStartNfaWithStates_0(2, 34, 965); - else if ((active1 & 0x400L) != 0L) - return jjStartNfaWithStates_0(2, 74, 430); - return jjMoveStringLiteralDfa3_0(active0, 0x400000000000L, active1, 0x2000L); - case 69: - case 101: - return jjMoveStringLiteralDfa3_0(active0, 0x4000000200000000L, active1, 0L); - case 70: - case 102: - return jjMoveStringLiteralDfa3_0(active0, 0x10000000L, active1, 0L); - case 71: - case 103: - if ((active0 & 0x2000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 49, 965); - else if ((active1 & 0x100L) != 0L) - { - jjmatchedKind = 72; - jjmatchedPos = 2; - } - return jjMoveStringLiteralDfa3_0(active0, 0x800000008000000L, active1, 0x220L); - case 73: - case 105: - return jjMoveStringLiteralDfa3_0(active0, 0x200040140000000L, active1, 0x80010L); - case 75: - case 107: - return jjMoveStringLiteralDfa3_0(active0, 0x10000000000L, active1, 0L); - case 76: - case 108: - return jjMoveStringLiteralDfa3_0(active0, 0x400004020080000L, active1, 0L); - case 77: - case 109: - if ((active0 & 0x10000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 52, 965); - break; - case 78: - case 110: - if ((active0 & 0x8000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 51, 426); - else if ((active1 & 0x1000000L) != 0L) - return jjStartNfaWithStates_0(2, 88, 965); - else if ((active1 & 0x2000000L) != 0L) - return jjStartNfaWithStates_0(2, 89, 965); - return jjMoveStringLiteralDfa3_0(active0, 0x1080000002000000L, active1, 0x4000L); - case 79: - case 111: - return jjMoveStringLiteralDfa3_0(active0, 0x8000100000400000L, active1, 0x40083L); - case 80: - case 112: - if ((active0 & 0x200000L) != 0L) - return jjStartNfaWithStates_0(2, 21, 965); - else if ((active1 & 0x40L) != 0L) - return jjStartNfaWithStates_0(2, 70, 965); - break; - case 82: - case 114: - return jjMoveStringLiteralDfa3_0(active0, 0x100000000000000L, active1, 0x10000L); - case 83: - case 115: - if ((active1 & 0x8L) != 0L) - return jjStartNfaWithStates_0(2, 67, 908); - else if ((active1 & 0x400000L) != 0L) - return jjStartNfaWithStates_0(2, 86, 965); - return jjMoveStringLiteralDfa3_0(active0, 0x1000000000000L, active1, 0x4L); - case 84: - case 116: - if ((active0 & 0x1000000000L) != 0L) - return jjStartNfaWithStates_0(2, 36, 965); - else if ((active1 & 0x800000L) != 0L) - return jjStartNfaWithStates_0(2, 87, 965); - return jjMoveStringLiteralDfa3_0(active0, 0x2000008005000000L, active1, 0L); - case 85: - case 117: - return jjMoveStringLiteralDfa3_0(active0, 0x20000000000000L, active1, 0x28000L); - case 86: - case 118: - return jjMoveStringLiteralDfa3_0(active0, 0x200000000000L, active1, 0L); - case 87: - case 119: - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x1000L); - case 88: - case 120: - if ((active0 & 0x4000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 50, 965); - else if ((active0 & 0x40000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 54, 965); - break; - default : - break; - } - return jjStartNfa_0(1, active0, active1); -} -private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1) -{ - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(1, old0, old1); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(2, active0, active1); - return 3; - } - switch(curChar) - { - case 49: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x200L); - case 65: - case 97: - if ((active0 & 0x4000000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 62, 965); - break; - case 67: - case 99: - if ((active0 & 0x1000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 48, 858); - return jjMoveStringLiteralDfa4_0(active0, 0x100000000000000L, active1, 0L); - case 68: - case 100: - if ((active1 & 0x4000L) != 0L) - return jjStartNfaWithStates_0(3, 78, 965); - break; - case 69: - case 101: - if ((active0 & 0x10000000000L) != 0L) - return jjStartNfaWithStates_0(3, 40, 965); - return jjMoveStringLiteralDfa4_0(active0, 0x2000400006080000L, active1, 0x1000L); - case 72: - case 104: - return jjMoveStringLiteralDfa4_0(active0, 0x8000000L, active1, 0L); - case 73: - case 105: - return jjMoveStringLiteralDfa4_0(active0, 0x800200000000000L, active1, 0x2000L); - case 76: - case 108: - if ((active0 & 0x20000000L) != 0L) - return jjStartNfaWithStates_0(3, 29, 965); - else if ((active0 & 0x4000000000L) != 0L) - return jjStartNfaWithStates_0(3, 38, 452); - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x10L); - case 77: - case 109: - if ((active0 & 0x400000L) != 0L) - return jjStartNfaWithStates_0(3, 22, 965); - break; - case 78: - case 110: - if ((active0 & 0x40000000L) != 0L) - return jjStartNfaWithStates_0(3, 30, 965); - else if ((active1 & 0x80000L) != 0L) - return jjStartNfaWithStates_0(3, 83, 965); - else if ((active1 & 0x100000L) != 0L) - { - jjmatchedKind = 84; - jjmatchedPos = 3; - } - return jjMoveStringLiteralDfa4_0(active0, 0x220000100000000L, active1, 0x228000L); - case 79: - case 111: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x80L); - case 82: - case 114: - return jjMoveStringLiteralDfa4_0(active0, 0x8000000200000000L, active1, 0x23L); - case 83: - case 115: - if ((active1 & 0x40000L) != 0L) - return jjStartNfaWithStates_0(3, 82, 965); - return jjMoveStringLiteralDfa4_0(active0, 0x40000000000L, active1, 0L); - case 84: - case 116: - if ((active0 & 0x10000000L) != 0L) - return jjStartNfaWithStates_0(3, 28, 965); - else if ((active1 & 0x10000L) != 0L) - return jjStartNfaWithStates_0(3, 80, 965); - return jjMoveStringLiteralDfa4_0(active0, 0x1080000000000000L, active1, 0x4L); - case 85: - case 117: - return jjMoveStringLiteralDfa4_0(active0, 0x100001000000L, active1, 0L); - case 87: - case 119: - return jjMoveStringLiteralDfa4_0(active0, 0x8000000000L, active1, 0L); - case 89: - case 121: - return jjMoveStringLiteralDfa4_0(active0, 0x400000000000000L, active1, 0L); - default : - break; - } - return jjStartNfa_0(2, active0, active1); -} -private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1) -{ - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(2, old0, old1); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(3, active0, active1); - return 4; - } - switch(curChar) - { - case 48: - if ((active1 & 0x200L) != 0L) - return jjStartNfaWithStates_0(4, 73, 28); - break; - case 50: - if ((active1 & 0x200000L) != 0L) - return jjStartNfaWithStates_0(4, 85, 28); - break; - case 65: - case 97: - return jjMoveStringLiteralDfa5_0(active0, 0x1000000000000000L, active1, 0x2004L); - case 67: - case 99: - return jjMoveStringLiteralDfa5_0(active0, 0x80000L, active1, 0x20000L); - case 68: - case 100: - if ((active1 & 0x8000L) != 0L) - return jjStartNfaWithStates_0(4, 79, 965); - return jjMoveStringLiteralDfa5_0(active0, 0x8000000000000000L, active1, 0x3L); - case 69: - case 101: - if ((active0 & 0x200000000L) != 0L) - return jjStartNfaWithStates_0(4, 33, 965); - return jjMoveStringLiteralDfa5_0(active0, 0x8000000000L, active1, 0x20L); - case 71: - case 103: - if ((active0 & 0x100000000L) != 0L) - return jjStartNfaWithStates_0(4, 32, 965); - return jjMoveStringLiteralDfa5_0(active0, 0x400000000000000L, active1, 0L); - case 73: - case 105: - return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x10L); - case 76: - case 108: - return jjMoveStringLiteralDfa5_0(active0, 0x100000000000000L, active1, 0L); - case 78: - case 110: - return jjMoveStringLiteralDfa5_0(active0, 0x200000000000L, active1, 0L); - case 79: - case 111: - return jjMoveStringLiteralDfa5_0(active0, 0x800000000000000L, active1, 0L); - case 80: - case 112: - if ((active0 & 0x100000000000L) != 0L) - return jjStartNfaWithStates_0(4, 44, 965); - break; - case 82: - case 114: - if ((active0 & 0x2000000L) != 0L) - return jjStartNfaWithStates_0(4, 25, 965); - else if ((active0 & 0x4000000L) != 0L) - return jjStartNfaWithStates_0(4, 26, 965); - else if ((active0 & 0x400000000000L) != 0L) - return jjStartNfaWithStates_0(4, 46, 965); - else if ((active1 & 0x80L) != 0L) - return jjStartNfaWithStates_0(4, 71, 965); - else if ((active1 & 0x1000L) != 0L) - return jjStartNfaWithStates_0(4, 76, 965); - return jjMoveStringLiteralDfa5_0(active0, 0x2080000001000000L, active1, 0L); - case 84: - case 116: - if ((active0 & 0x8000000L) != 0L) - return jjStartNfaWithStates_0(4, 27, 965); - else if ((active0 & 0x20000000000000L) != 0L) - return jjStartNfaWithStates_0(4, 53, 965); - else if ((active0 & 0x200000000000000L) != 0L) - return jjStartNfaWithStates_0(4, 57, 965); - return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L, active1, 0L); - default : - break; - } - return jjStartNfa_0(3, active0, active1); -} -private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1) -{ - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(3, old0, old1); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(4, active0, active1); - return 5; - } - switch(curChar) - { - case 49: - if ((active0 & 0x8000000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 63, 28); - break; - case 50: - if ((active1 & 0x1L) != 0L) - return jjStartNfaWithStates_0(5, 64, 28); - break; - case 65: - case 97: - return jjMoveStringLiteralDfa6_0(active0, 0x1000000L, active1, 0x20000L); - case 69: - case 101: - if ((active0 & 0x100000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 56, 965); - return jjMoveStringLiteralDfa6_0(active0, 0x8000000000L, active1, 0x20L); - case 71: - case 103: - if ((active0 & 0x200000000000L) != 0L) - return jjStartNfaWithStates_0(5, 45, 965); - break; - case 73: - case 105: - return jjMoveStringLiteralDfa6_0(active0, 0x1000000000000000L, active1, 0L); - case 78: - case 110: - if ((active0 & 0x800000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 59, 965); - return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x2014L); - case 79: - case 111: - return jjMoveStringLiteralDfa6_0(active0, 0x480000000000000L, active1, 0L); - case 83: - case 115: - if ((active0 & 0x40000000000L) != 0L) - return jjStartNfaWithStates_0(5, 42, 965); - return jjMoveStringLiteralDfa6_0(active0, 0x2000000000000000L, active1, 0x2L); - case 84: - case 116: - if ((active0 & 0x80000L) != 0L) - return jjStartNfaWithStates_0(5, 19, 965); - break; - default : - break; - } - return jjStartNfa_0(4, active0, active1); -} -private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long active1) -{ - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(4, old0, old1); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(5, active0, active1); - return 6; - } - switch(curChar) - { - case 67: - case 99: - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x4L); - case 69: - case 101: - return jjMoveStringLiteralDfa7_0(active0, 0x2000000000000000L, active1, 0L); - case 71: - case 103: - if ((active1 & 0x10L) != 0L) - return jjStartNfaWithStates_0(6, 68, 965); - break; - case 73: - case 105: - return jjMoveStringLiteralDfa7_0(active0, 0x80000000000000L, active1, 0L); - case 76: - case 108: - if ((active0 & 0x1000000L) != 0L) - return jjStartNfaWithStates_0(6, 24, 965); - break; - case 78: - case 110: - if ((active0 & 0x8000000000L) != 0L) - return jjStartNfaWithStates_0(6, 39, 965); - else if ((active0 & 0x400000000000000L) != 0L) - return jjStartNfaWithStates_0(6, 58, 965); - return jjMoveStringLiteralDfa7_0(active0, 0x1000000000000000L, active1, 0L); - case 83: - case 115: - if ((active1 & 0x20L) != 0L) - return jjStartNfaWithStates_0(6, 69, 965); - else if ((active1 & 0x2000L) != 0L) - return jjStartNfaWithStates_0(6, 77, 965); - break; - case 84: - case 116: - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x20000L); - case 89: - case 121: - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x2L); - default : - break; - } - return jjStartNfa_0(5, active0, active1); -} -private int jjMoveStringLiteralDfa7_0(long old0, long active0, long old1, long active1) -{ - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(5, old0, old1); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(6, active0, active1); - return 7; - } - switch(curChar) - { - case 67: - case 99: - return jjMoveStringLiteralDfa8_0(active0, 0x2000000000000000L, active1, 0L); - case 68: - case 100: - if ((active0 & 0x80000000000000L) != 0L) - return jjStartNfaWithStates_0(7, 55, 965); - break; - case 69: - case 101: - if ((active1 & 0x4L) != 0L) - return jjStartNfaWithStates_0(7, 66, 965); - else if ((active1 & 0x20000L) != 0L) - return jjStartNfaWithStates_0(7, 81, 965); - break; - case 83: - case 115: - if ((active0 & 0x1000000000000000L) != 0L) - return jjStartNfaWithStates_0(7, 60, 965); - else if ((active1 & 0x2L) != 0L) - return jjStartNfaWithStates_0(7, 65, 965); - break; - default : - break; - } - return jjStartNfa_0(6, active0, active1); -} -private int jjMoveStringLiteralDfa8_0(long old0, long active0, long old1, long active1) -{ - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(6, old0, old1); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(7, active0, 0L); - return 8; - } - switch(curChar) - { - case 84: - case 116: - return jjMoveStringLiteralDfa9_0(active0, 0x2000000000000000L); - default : - break; - } - return jjStartNfa_0(7, active0, 0L); -} -private int jjMoveStringLiteralDfa9_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(7, old0, 0L); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(8, active0, 0L); - return 9; - } - switch(curChar) - { - case 83: - case 115: - if ((active0 & 0x2000000000000000L) != 0L) - return jjStartNfaWithStates_0(9, 61, 965); - break; - default : - break; - } - return jjStartNfa_0(8, active0, 0L); -} -private int jjStartNfaWithStates_0(int pos, int kind, int state) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return pos + 1; } - return jjMoveNfa_0(state, pos + 1); -} -private int jjMoveNfa_0(int startState, int curPos) -{ - int startsAt = 0; - jjnewStateCnt = 965; - int i = 1; - jjstateSet[0] = startState; - int kind = 0x7fffffff; - for (;;) - { - if (++jjround == 0x7fffffff) - ReInitRounds(); - if (curChar < 64) - { - long l = 1L << curChar; - do - { - switch(jjstateSet[--i]) - { - case 590: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 620: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 656: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 373: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 376: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 966: - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 95) - kind = 95; - jjCheckNAdd(952); - } - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(948, 949); - break; - case 303: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 431: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 5: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 168: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 669: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 137: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 324: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 910: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 295: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 33: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 877: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 423: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 908: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 932: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 249: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 821: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 491: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 637: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 967: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 813: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 501: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 481: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 452: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 410: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 372: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 752: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 969: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 859: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 315: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 32: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 52: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 426: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 0: - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 96) - kind = 96; - jjCheckNAddStates(0, 8); - } - else if ((0x100002600L & l) != 0L) - { - if (kind > 1) - kind = 1; - } - else if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - else if (curChar == 46) - jjCheckNAddTwoStates(948, 952); - else if (curChar == 45) - jjstateSet[jjnewStateCnt++] = 22; - else if (curChar == 33) - jjstateSet[jjnewStateCnt++] = 19; - else if (curChar == 60) - jjstateSet[jjnewStateCnt++] = 17; - if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 1; - break; - case 332: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 377: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 404: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 45: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 717: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 345: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 909: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 378: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 302: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 454: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 416: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 670: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 797: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 482: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 453: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 439: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 396: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 550: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 597: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 471: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 770: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 549: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 430: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 965: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 438: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 801: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 581: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 858: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 472: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 913: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 796: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 427: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 443: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 424: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 900: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 264: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 968: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 113: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 884: - if ((0x83ff001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x8000001800000000L & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 1: - if (curChar == 10 && kind > 1) - kind = 1; - break; - case 2: - if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 1; - break; - case 17: - if (curChar == 62 && kind > 14) - kind = 14; - break; - case 18: - if (curChar == 60) - jjstateSet[jjnewStateCnt++] = 17; - break; - case 19: - if (curChar == 61 && kind > 14) - kind = 14; - break; - case 20: - if (curChar == 33) - jjstateSet[jjnewStateCnt++] = 19; - break; - case 21: - if (curChar == 45) - jjstateSet[jjnewStateCnt++] = 22; - break; - case 22: - if (curChar != 45) - break; - if (kind > 90) - kind = 90; - jjCheckNAddStates(9, 11); - break; - case 23: - if ((0xffffffffffffdbffL & l) == 0L) - break; - if (kind > 90) - kind = 90; - jjCheckNAddStates(9, 11); - break; - case 24: - if ((0x2400L & l) != 0L && kind > 90) - kind = 90; - break; - case 25: - if (curChar == 10 && kind > 90) - kind = 90; - break; - case 26: - if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 25; - break; - case 27: - if ((0x8000001800000000L & l) == 0L) - break; - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - break; - case 28: - if ((0x83ff001800000000L & l) == 0L) - break; - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - break; - case 255: - if (curChar == 45) - jjstateSet[jjnewStateCnt++] = 254; - break; - case 947: - if (curChar == 46) - jjCheckNAddTwoStates(948, 952); - break; - case 948: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(948, 949); - break; - case 950: - if ((0x280000000000L & l) != 0L) - jjCheckNAdd(951); - break; - case 951: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 94) - kind = 94; - jjCheckNAdd(951); - break; - case 952: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 95) - kind = 95; - jjCheckNAdd(952); - break; - case 953: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - jjCheckNAddStates(0, 8); - break; - case 954: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(954, 949); - break; - case 955: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(955, 956); - break; - case 956: - if (curChar == 46) - jjCheckNAddTwoStates(957, 949); - break; - case 957: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(957, 949); - break; - case 958: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(958, 959); - break; - case 959: - if (curChar != 46) - break; - if (kind > 95) - kind = 95; - jjCheckNAdd(960); - break; - case 960: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 95) - kind = 95; - jjCheckNAdd(960); - break; - case 961: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - jjCheckNAdd(961); - break; - case 962: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(962, 963); - break; - case 963: - if ((0x8000001800000000L & l) == 0L) - break; - if (kind > 101) - kind = 101; - jjCheckNAdd(964); - break; - case 964: - if ((0x83ff001800000000L & l) == 0L) - break; - if (kind > 101) - kind = 101; - jjCheckNAdd(964); - break; - default : break; - } - } while(i != startsAt); - } - else if (curChar < 128) - { - long l = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 590: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x200000002000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 665; - else if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 656; - else if ((0x2000000020000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 649; - else if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 631; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 628; - else if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 626; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 620; - else if ((0x2000000020L & l) != 0L) - jjCheckNAdd(34); - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 593; - if ((0x2000000020000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 643; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 617; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 589; - if ((0x2000000020000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 637; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 607; - if ((0x2000000020000L & l) != 0L) - jjCheckNAdd(280); - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 602; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 597; - break; - case 620: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x400000004000000L & l) != 0L) - jjCheckNAdd(13); - break; - case 656: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 655; - break; - case 373: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x800000008000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 385; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 379; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 372; - break; - case 376: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x800000008L & l) != 0L) - jjCheckNAdd(34); - break; - case 303: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 302; - break; - case 431: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 433; - else if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 430; - break; - case 5: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 4; - break; - case 168: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 167; - break; - case 669: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 668; - break; - case 137: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 173; - else if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 168; - else if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 162; - else if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 144; - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 152; - else if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 136; - break; - case 324: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 323; - break; - case 910: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 945; - else if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 943; - else if ((0x10000000100000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - else if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 932; - else if ((0x4000000040000L & l) != 0L) - jjCheckNAdd(13); - else if ((0x400000004000L & l) != 0L) - jjCheckNAdd(7); - else if ((0x1000000010L & l) != 0L) - jjCheckNAdd(53); - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 913; - else if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 909; - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 923; - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 920; - break; - case 295: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 312; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 303; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 300; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 297; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 294; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 309; - if ((0x800000008000L & l) != 0L) - jjCheckNAdd(3); - break; - case 33: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 45; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 43; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 32; - if ((0x20000000200L & l) != 0L) - jjCheckNAdd(34); - break; - case 877: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 901; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 876; - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 884; - break; - case 423: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 422; - break; - case 908: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 907; - break; - case 932: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 931; - break; - case 249: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 290; - else if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 260; - else if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 256; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 248; - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 285; - else if ((0x400000004000L & l) != 0L) - jjCheckNAdd(53); - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 278; - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 273; - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 271; - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 264; - break; - case 821: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 867; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 853; - else if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 849; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 830; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 820; - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 859; - else if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 843; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 825; - if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 835; - break; - case 491: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 546; - else if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 542; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 501; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 495; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 535; - else if ((0x200000002L & l) != 0L) - jjCheckNAdd(53); - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 527; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 524; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 519; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 513; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 508; - break; - case 637: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 648; - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 642; - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 636; - if ((0x100000001000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - break; - case 967: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x2000000020L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - break; - case 813: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 902; - else if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 895; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 893; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 868; - else if ((0x200000002L & l) != 0L) - jjCheckNAdd(7); - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 889; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 885; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 860; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 812; - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 877; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 854; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 850; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 844; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 836; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 831; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 826; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 821; - break; - case 501: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 500; - break; - case 481: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 480; - break; - case 452: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x20000000200L & l) != 0L) - jjCheckNAdd(451); - break; - case 410: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 412; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 409; - break; - case 372: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 384; - else if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 371; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 378; - break; - case 752: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 772; - else if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 767; - else if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 760; - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 770; - else if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 764; - else if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 755; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 751; - break; - case 969: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x10000000100000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - break; - case 859: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 866; - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 858; - break; - case 315: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 324; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 321; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 318; - else if ((0x2000000020L & l) != 0L) - jjCheckNAdd(34); - if ((0x800000008000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - break; - case 32: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 31; - break; - case 52: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 245; - else if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 190; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 186; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 107; - else if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 104; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 68; - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 241; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 175; - else if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 100; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 62; - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 231; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 170; - else if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 86; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 60; - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 215; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 164; - else if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 77; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 58; - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 205; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 154; - else if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 70; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 51; - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 195; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 146; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 138; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 133; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 129; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 125; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 118; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 113; - break; - case 426: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 425; - break; - case 0: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x200000002L & l) != 0L) - jjCheckNAddStates(12, 22); - else if ((0x1000000010L & l) != 0L) - jjAddStates(23, 39); - else if ((0x80000000800000L & l) != 0L) - jjAddStates(40, 44); - else if ((0x40000000400000L & l) != 0L) - jjAddStates(45, 49); - else if ((0x20000000200000L & l) != 0L) - jjAddStates(50, 56); - else if ((0x10000000100000L & l) != 0L) - jjCheckNAddStates(57, 70); - else if ((0x8000000080000L & l) != 0L) - jjAddStates(71, 87); - else if ((0x4000000040000L & l) != 0L) - jjAddStates(88, 95); - else if ((0x1000000010000L & l) != 0L) - jjAddStates(96, 106); - else if ((0x800000008000L & l) != 0L) - jjCheckNAddStates(107, 113); - else if ((0x400000004000L & l) != 0L) - jjCheckNAddStates(114, 120); - else if ((0x200000002000L & l) != 0L) - jjAddStates(121, 124); - else if ((0x100000001000L & l) != 0L) - jjAddStates(125, 130); - else if ((0x20000000200L & l) != 0L) - jjAddStates(131, 143); - else if ((0x8000000080L & l) != 0L) - jjCheckNAddStates(144, 148); - else if ((0x4000000040L & l) != 0L) - jjAddStates(149, 155); - else if ((0x2000000020L & l) != 0L) - jjAddStates(156, 165); - else if ((0x800000008L & l) != 0L) - jjAddStates(166, 195); - else if ((0x400000004L & l) != 0L) - jjAddStates(196, 199); - else if ((0x400000004000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 15; - else if ((0x200000002000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 11; - else if ((0x80000000800L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 8; - else if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 5; - break; - case 332: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 396; - else if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 389; - else if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 338; - else if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 331; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 387; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 381; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 374; - if ((0x400000004000L & l) != 0L) - jjCheckNAdd(34); - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 368; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 364; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 355; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 352; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 345; - break; - case 377: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 376; - break; - case 404: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 419; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 413; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 405; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 416; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 410; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 403; - break; - case 45: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x10000000100000L & l) != 0L) - jjCheckNAdd(36); - break; - case 717: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x20000000200000L & l) != 0L) - jjCheckNAdd(13); - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 744; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 741; - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 732; - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 725; - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 716; - break; - case 345: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x10000000100000L & l) != 0L) - jjCheckNAdd(320); - else if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 367; - else if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 354; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 351; - else if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 344; - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 386; - else if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 363; - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 380; - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 373; - if ((0x10000000100000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - break; - case 909: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 908; - break; - case 378: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 383; - else if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 377; - break; - case 302: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x200000002L & l) != 0L) - jjCheckNAdd(34); - break; - case 454: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 458; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 453; - break; - case 416: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x80000000800000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 418; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 415; - break; - case 670: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 747; - else if ((0x800000008000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 711; - else if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 678; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 676; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 669; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 745; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 698; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 742; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 687; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 733; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 680; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 726; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 717; - break; - case 797: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 809; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 806; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 804; - else if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 802; - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 796; - break; - case 482: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 481; - break; - case 453: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 452; - break; - case 439: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 459; - else if ((0x800000008000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 449; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 447; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 444; - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 454; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 438; - break; - case 396: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 395; - break; - case 550: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 583; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 575; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 581; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 571; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 565; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 559; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 551; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 549; - break; - case 597: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x10000000100000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - else if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 616; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 601; - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 606; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 596; - break; - case 471: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 488; - else if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 482; - else if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 478; - else if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 472; - else if ((0x4000000040L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 470; - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 474; - break; - case 770: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x2000000020L & l) != 0L) - jjCheckNAdd(3); - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 769; - break; - case 549: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 574; - else if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 570; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 564; - else if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 558; - else if ((0x200000002L & l) != 0L) - jjCheckNAdd(280); - if ((0x200000002L & l) != 0L) - jjCheckNAdd(53); - break; - case 430: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 429; - break; - case 965: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - break; - case 438: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 443; - else if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 437; - break; - case 801: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 800; - if ((0x400000004000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - break; - case 581: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x80000000800000L & l) != 0L) - jjCheckNAdd(156); - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 580; - break; - case 858: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 865; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 857; - break; - case 472: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x100000001000L & l) != 0L) - jjCheckNAdd(7); - break; - case 913: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 912; - break; - case 796: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 801; - if ((0x2000000020L & l) != 0L) - jjCheckNAdd(30); - break; - case 427: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 426; - break; - case 443: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 442; - break; - case 424: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 434; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 427; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 423; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 431; - break; - case 900: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 899; - break; - case 264: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 289; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 277; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 270; - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 284; - else if ((0x2000000020L & l) != 0L) - jjCheckNAdd(251); - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 263; - break; - case 968: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x200000002000000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - break; - case 113: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 185; - else if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 174; - else if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 132; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 128; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 112; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 169; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 124; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 163; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 117; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 153; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 145; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 137; - break; - case 884: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - } - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 900; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 883; - break; - case 3: - if ((0x4000000040000L & l) != 0L && kind > 2) - kind = 2; - break; - case 4: - case 689: - if ((0x20000000200000L & l) != 0L) - jjCheckNAdd(3); - break; - case 6: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 5; - break; - case 7: - if ((0x200000002000000L & l) != 0L && kind > 2) - kind = 2; - break; - case 8: - if ((0x2000000020L & l) != 0L) - jjCheckNAdd(7); - break; - case 9: - if ((0x80000000800L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 8; - break; - case 10: - case 70: - case 446: - case 782: - if ((0x200000002L & l) != 0L) - jjCheckNAdd(3); - break; - case 11: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 10; - break; - case 12: - if ((0x200000002000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 11; - break; - case 13: - if ((0x2000000020L & l) != 0L && kind > 2) - kind = 2; - break; - case 14: - if ((0x400000004000L & l) != 0L) - jjCheckNAdd(13); - break; - case 15: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 14; - break; - case 16: - if ((0x400000004000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 15; - break; - case 23: - if (kind > 90) - kind = 90; - jjAddStates(9, 11); - break; - case 27: - if ((0x6fffffffefffffffL & l) == 0L) - break; - if (kind > 101) - kind = 101; - jjCheckNAddTwoStates(27, 28); - break; - case 28: - if ((0x6fffffffefffffffL & l) == 0L) - break; - if (kind > 101) - kind = 101; - jjCheckNAdd(28); - break; - case 29: - if ((0x400000004L & l) != 0L) - jjAddStates(196, 199); - break; - case 30: - if ((0x400000004000L & l) != 0L && kind > 2) - kind = 2; - break; - case 31: - case 887: - if ((0x20000000200L & l) != 0L) - jjCheckNAdd(30); - break; - case 34: - if ((0x10000000100000L & l) != 0L && kind > 2) - kind = 2; - break; - case 35: - case 131: - if ((0x20000000200L & l) != 0L) - jjCheckNAdd(34); - break; - case 36: - if ((0x10000000100L & l) != 0L && kind > 2) - kind = 2; - break; - case 37: - case 79: - case 88: - case 433: - case 462: - case 804: - if ((0x10000000100000L & l) != 0L) - jjCheckNAdd(36); - break; - case 38: - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 37; - break; - case 39: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 38; - break; - case 40: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 39; - break; - case 41: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 40; - break; - case 42: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 41; - break; - case 43: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 42; - break; - case 44: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 43; - break; - case 46: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 45; - break; - case 47: - if ((0x800000008L & l) != 0L) - jjAddStates(166, 195); - break; - case 48: - case 634: - if ((0x1000000010L & l) != 0L) - jjCheckNAdd(13); - break; - case 49: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 48; - break; - case 50: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 49; - break; - case 51: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 50; - break; - case 53: - if ((0x1000000010L & l) != 0L && kind > 2) - kind = 2; - break; - case 54: - case 846: - if ((0x2000000020L & l) != 0L) - jjCheckNAdd(53); - break; - case 55: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 54; - break; - case 56: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 55; - break; - case 57: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 56; - break; - case 58: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 57; - break; - case 59: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 58; - break; - case 60: - case 106: - case 248: - case 293: - if ((0x8000000080000L & l) != 0L) - jjCheckNAdd(13); - break; - case 61: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 60; - break; - case 62: - case 299: - case 405: - if ((0x8000000080000L & l) != 0L) - jjCheckNAdd(34); - break; - case 63: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 62; - break; - case 64: - if ((0x8000000080L & l) != 0L && kind > 2) - kind = 2; - break; - case 65: - if ((0x800000008000L & l) != 0L) - jjCheckNAdd(64); - break; - case 66: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 65; - break; - case 67: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 66; - break; - case 68: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 67; - break; - case 69: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 68; - break; - case 71: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 70; - break; - case 72: - case 233: - case 371: - case 418: - case 609: - case 658: - case 766: - case 798: - case 922: - if ((0x2000000020L & l) != 0L) - jjCheckNAdd(3); - break; - case 73: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 72; - break; - case 74: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 73; - break; - case 75: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 74; - break; - case 76: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 75; - break; - case 77: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 76; - break; - case 78: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 77; - break; - case 80: - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 79; - break; - case 81: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 80; - break; - case 82: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 81; - break; - case 83: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 82; - break; - case 84: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 83; - break; - case 85: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 84; - break; - case 86: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 85; - break; - case 87: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 86; - break; - case 89: - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 88; - break; - case 90: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 89; - break; - case 91: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 90; - break; - case 92: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 91; - break; - case 93: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 92; - break; - case 94: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 93; - break; - case 95: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 94; - break; - case 96: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 95; - break; - case 97: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 96; - break; - case 98: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 97; - break; - case 99: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 98; - break; - case 100: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 99; - break; - case 101: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 100; - break; - case 102: - if ((0x80000000800L & l) != 0L && kind > 2) - kind = 2; - break; - case 103: - case 577: - if ((0x800000008L & l) != 0L) - jjCheckNAdd(102); - break; - case 104: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 103; - break; - case 105: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 104; - break; - case 107: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 106; - break; - case 108: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 107; - break; - case 109: - case 630: - if ((0x800000008L & l) != 0L) - jjCheckNAdd(13); - break; - case 110: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 109; - break; - case 111: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 110; - break; - case 112: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 111; - break; - case 114: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 113; - break; - case 115: - case 188: - case 197: - case 275: - case 333: - case 425: - case 645: - case 700: - case 728: - case 762: - case 808: - case 812: - case 815: - case 852: - case 905: - case 916: - if ((0x10000000100000L & l) != 0L) - jjCheckNAdd(13); - break; - case 116: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 115; - break; - case 117: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 116; - break; - case 118: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 117; - break; - case 119: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 118; - break; - case 120: - case 140: - case 266: - case 391: - case 476: - case 497: - case 503: - case 599: - case 604: - case 719: - case 735: - case 750: - case 911: - case 927: - case 934: - if ((0x800000008000L & l) != 0L) - jjCheckNAdd(30); - break; - case 121: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 120; - break; - case 122: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 121; - break; - case 123: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 122; - break; - case 124: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 123; - break; - case 125: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 124; - break; - case 126: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 125; - break; - case 127: - if ((0x200000002000L & l) != 0L) - jjCheckNAdd(30); - break; - case 128: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 127; - break; - case 129: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 128; - break; - case 130: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 129; - break; - case 132: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 131; - break; - case 133: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 132; - break; - case 134: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 133; - break; - case 135: - case 287: - case 567: - case 879: - if ((0x800000008L & l) != 0L) - jjCheckNAdd(34); - break; - case 136: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 135; - break; - case 138: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 137; - break; - case 139: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 138; - break; - case 141: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 140; - break; - case 142: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 141; - break; - case 143: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 142; - break; - case 144: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 143; - break; - case 145: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 144; - break; - case 146: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 145; - break; - case 147: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 146; - break; - case 148: - case 192: - case 323: - case 622: - if ((0x400000004000L & l) != 0L) - jjCheckNAdd(34); - break; - case 149: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 148; - break; - case 150: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 149; - break; - case 151: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 150; - break; - case 152: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 151; - break; - case 153: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 152; - break; - case 154: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 153; - break; - case 155: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 154; - break; - case 156: - if ((0x8000000080000L & l) != 0L && kind > 2) - kind = 2; - break; - case 157: - if ((0x10000000100000L & l) != 0L) - jjCheckNAdd(156); - break; - case 158: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 157; - break; - case 159: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 158; - break; - case 160: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 159; - break; - case 161: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 160; - break; - case 162: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 161; - break; - case 163: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 162; - break; - case 164: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 163; - break; - case 165: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 164; - break; - case 166: - case 753: - case 775: - if ((0x20000000200000L & l) != 0L) - jjCheckNAdd(13); - break; - case 167: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 166; - break; - case 169: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 168; - break; - case 170: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 169; - break; - case 171: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 170; - break; - case 172: - case 366: - if ((0x4000000040000L & l) != 0L) - jjCheckNAdd(34); - break; - case 173: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 172; - break; - case 174: - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 173; - break; - case 175: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 174; - break; - case 176: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 175; - break; - case 177: - case 407: - case 651: - case 713: - case 787: - if ((0x400000004000L & l) != 0L) - jjCheckNAdd(64); - break; - case 178: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 177; - break; - case 179: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 178; - break; - case 180: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 179; - break; - case 181: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 180; - break; - case 182: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 181; - break; - case 183: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 182; - break; - case 184: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 183; - break; - case 185: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 184; - break; - case 186: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 185; - break; - case 187: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 186; - break; - case 189: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 188; - break; - case 190: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 189; - break; - case 191: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 190; - break; - case 193: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 192; - break; - case 194: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 193; - break; - case 195: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 194; - break; - case 196: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 195; - break; - case 198: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 197; - break; - case 199: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 198; - break; - case 200: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 199; - break; - case 201: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 200; - break; - case 202: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 201; - break; - case 203: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 202; - break; - case 204: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 203; - break; - case 205: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 204; - break; - case 206: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 205; - break; - case 207: - case 628: - case 680: - if ((0x200000002000L & l) != 0L) - jjCheckNAdd(13); - break; - case 208: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 207; - break; - case 209: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 208; - break; - case 210: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 209; - break; - case 211: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 210; - break; - case 212: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 211; - break; - case 213: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 212; - break; - case 214: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 213; - break; - case 215: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 214; - break; - case 216: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 215; - break; - case 217: - if ((0x1000000010000L & l) != 0L && kind > 2) - kind = 2; - break; - case 218: - case 682: - if ((0x200000002000L & l) != 0L) - jjCheckNAdd(217); - break; - case 219: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 218; - break; - case 220: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 219; - break; - case 221: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 220; - break; - case 222: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 221; - break; - case 223: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 222; - break; - case 224: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 223; - break; - case 225: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 224; - break; - case 226: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 225; - break; - case 227: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 226; - break; - case 228: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 227; - break; - case 229: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 228; - break; - case 230: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 229; - break; - case 231: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 230; - break; - case 232: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 231; - break; - case 234: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 233; - break; - case 235: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 234; - break; - case 236: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 235; - break; - case 237: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 236; - break; - case 238: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 237; - break; - case 239: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 238; - break; - case 240: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 239; - break; - case 241: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 240; - break; - case 242: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 241; - break; - case 243: - case 340: - case 526: - case 639: - case 862: - if ((0x800000008000L & l) != 0L) - jjCheckNAdd(3); - break; - case 244: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 243; - break; - case 245: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 244; - break; - case 246: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 245; - break; - case 247: - if ((0x2000000020L & l) != 0L) - jjAddStates(156, 165); - break; - case 250: - case 311: - case 595: - if ((0x400000004000L & l) != 0L) - jjCheckNAdd(53); - break; - case 251: - if ((0x800000008L & l) != 0L && kind > 2) - kind = 2; - break; - case 252: - if ((0x2000000020L & l) != 0L) - jjCheckNAdd(251); - break; - case 253: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 252; - break; - case 254: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 253; - break; - case 256: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 255; - break; - case 257: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 256; - break; - case 258: - if ((0x1000000010000L & l) != 0L) - jjCheckNAdd(13); - break; - case 259: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 258; - break; - case 260: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 259; - break; - case 261: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 260; - break; - case 262: - if ((0x1000000010000L & l) != 0L) - jjCheckNAdd(34); - break; - case 263: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 262; - break; - case 265: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 264; - break; - case 267: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 266; - break; - case 268: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 267; - break; - case 269: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 268; - break; - case 270: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 269; - break; - case 271: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 270; - break; - case 272: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 271; - break; - case 273: - if ((0x2000000020L & l) != 0L) - jjCheckNAdd(251); - break; - case 274: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 273; - break; - case 276: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 275; - break; - case 277: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 276; - break; - case 278: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 277; - break; - case 279: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 278; - break; - case 280: - if ((0x100000001000L & l) != 0L && kind > 2) - kind = 2; - break; - case 281: - case 316: - case 383: - case 415: - case 440: - case 492: - case 823: - if ((0x200000002L & l) != 0L) - jjCheckNAdd(280); - break; - case 282: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 281; - break; - case 283: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 282; - break; - case 284: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 283; - break; - case 285: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 284; - break; - case 286: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 285; - break; - case 288: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 287; - break; - case 289: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 288; - break; - case 290: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 289; - break; - case 291: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 290; - break; - case 292: - if ((0x4000000040L & l) != 0L) - jjAddStates(149, 155); - break; - case 294: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 293; - break; - case 296: - case 422: - if ((0x800000008L & l) != 0L) - jjCheckNAdd(36); - break; - case 297: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 296; - break; - case 298: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 297; - break; - case 300: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 299; - break; - case 301: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 300; - break; - case 304: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 303; - break; - case 305: - if ((0x800000008000L & l) != 0L) - jjCheckNAdd(3); - break; - case 306: - if ((0x8000000080L & l) != 0L) - jjCheckNAdd(30); - break; - case 307: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 306; - break; - case 308: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 307; - break; - case 309: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 308; - break; - case 310: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 309; - break; - case 312: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 311; - break; - case 313: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 312; - break; - case 314: - if ((0x8000000080L & l) != 0L) - jjCheckNAddStates(144, 148); - break; - case 317: - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 316; - break; - case 318: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 317; - break; - case 319: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 318; - break; - case 320: - if ((0x800000008000L & l) != 0L && kind > 2) - kind = 2; - break; - case 321: - if ((0x10000000100000L & l) != 0L) - jjCheckNAdd(320); - break; - case 322: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 321; - break; - case 325: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 324; - break; - case 326: - if ((0x20000000200L & l) != 0L) - jjAddStates(131, 143); - break; - case 327: - if ((0x10000000100000L & l) != 0L) - jjCheckNAdd(7); - break; - case 328: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 327; - break; - case 329: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 328; - break; - case 330: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 329; - break; - case 331: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 330; - break; - case 334: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 333; - break; - case 335: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 334; - break; - case 336: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 335; - break; - case 337: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 336; - break; - case 338: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 337; - break; - case 339: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 338; - break; - case 341: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 340; - break; - case 342: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 341; - break; - case 343: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 342; - break; - case 344: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 343; - break; - case 346: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 345; - break; - case 347: - if ((0x100000001000L & l) != 0L) - jjCheckNAdd(7); - break; - case 348: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 347; - break; - case 349: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 348; - break; - case 350: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 349; - break; - case 351: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 350; - break; - case 352: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 351; - break; - case 353: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 352; - break; - case 354: - case 480: - if ((0x20000000200000L & l) != 0L) - jjCheckNAdd(34); - break; - case 355: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 354; - break; - case 356: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 355; - break; - case 357: - case 515: - case 561: - if ((0x40000000400000L & l) != 0L) - jjCheckNAdd(13); - break; - case 358: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 357; - break; - case 359: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 358; - break; - case 360: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 359; - break; - case 361: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 360; - break; - case 362: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 361; - break; - case 363: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 362; - break; - case 364: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 363; - break; - case 365: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 364; - break; - case 367: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 366; - break; - case 368: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 367; - break; - case 369: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 368; - break; - case 370: - if ((0x400000004000L & l) != 0L) - jjCheckNAdd(34); - break; - case 374: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 373; - break; - case 375: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 374; - break; - case 379: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 378; - break; - case 380: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 379; - break; - case 381: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 380; - break; - case 382: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 381; - break; - case 384: - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 383; - break; - case 385: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 384; - break; - case 386: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 385; - break; - case 387: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 386; - break; - case 388: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 387; - break; - case 389: - if ((0x10000000100000L & l) != 0L) - jjCheckNAdd(320); - break; - case 390: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 389; - break; - case 392: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 391; - break; - case 393: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 392; - break; - case 394: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 393; - break; - case 395: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 394; - break; - case 397: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 396; - break; - case 398: - if ((0x100000001000L & l) != 0L) - jjAddStates(125, 130); - break; - case 399: - case 769: - if ((0x8000000080L & l) != 0L) - jjCheckNAdd(13); - break; - case 400: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 399; - break; - case 401: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 400; - break; - case 402: - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 401; - break; - case 403: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 402; - break; - case 406: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 405; - break; - case 408: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 407; - break; - case 409: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 408; - break; - case 411: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 410; - break; - case 412: - if ((0x2000000020L & l) != 0L) - jjCheckNAdd(280); - break; - case 413: - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 412; - break; - case 414: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 413; - break; - case 417: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 416; - break; - case 419: - if ((0x80000000800000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 418; - break; - case 420: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 419; - break; - case 421: - if ((0x200000002000L & l) != 0L) - jjAddStates(121, 124); - break; - case 428: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 427; - break; - case 429: - case 668: - case 838: - case 891: - if ((0x100000001000L & l) != 0L) - jjCheckNAdd(13); - break; - case 432: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 431; - break; - case 434: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 433; - break; - case 435: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 434; - break; - case 436: - if ((0x400000004000L & l) != 0L) - jjCheckNAddStates(114, 120); - break; - case 437: - case 529: - case 553: - case 778: - if ((0x2000000020L & l) != 0L) - jjCheckNAdd(156); - break; - case 441: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 440; - break; - case 442: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 441; - break; - case 444: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 443; - break; - case 445: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 444; - break; - case 447: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 446; - break; - case 448: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 447; - break; - case 449: - if ((0x100000001000000L & l) != 0L) - jjCheckNAdd(34); - break; - case 450: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 449; - break; - case 451: - if ((0x4000000040L & l) != 0L && kind > 2) - kind = 2; - break; - case 455: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 454; - break; - case 456: - case 544: - if ((0x20000000200L & l) != 0L) - jjCheckNAdd(251); - break; - case 457: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 456; - break; - case 458: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 457; - break; - case 459: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 458; - break; - case 460: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 459; - break; - case 461: - if ((0x800000008000L & l) != 0L) - jjCheckNAddStates(107, 113); - break; - case 463: - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 462; - break; - case 464: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 463; - break; - case 465: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 464; - break; - case 466: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 465; - break; - case 467: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 466; - break; - case 468: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 467; - break; - case 469: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 468; - break; - case 470: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 469; - break; - case 473: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 472; - break; - case 474: - case 678: - if ((0x2000000020L & l) != 0L) - jjCheckNAdd(30); - break; - case 475: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 474; - break; - case 477: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 476; - break; - case 478: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 477; - break; - case 479: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 478; - break; - case 483: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 482; - break; - case 484: - if ((0x1000000010000L & l) != 0L) - jjCheckNAdd(156); - break; - case 485: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 484; - break; - case 486: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 485; - break; - case 487: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 486; - break; - case 488: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 487; - break; - case 489: - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 488; - break; - case 490: - if ((0x1000000010000L & l) != 0L) - jjAddStates(96, 106); - break; - case 493: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 492; - break; - case 494: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 493; - break; - case 495: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 494; - break; - case 496: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 495; - break; - case 498: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 497; - break; - case 499: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 498; - break; - case 500: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 499; - break; - case 502: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 501; - break; - case 504: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 503; - break; - case 505: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 504; - break; - case 506: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 505; - break; - case 507: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 506; - break; - case 508: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 507; - break; - case 509: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 508; - break; - case 510: - case 537: - case 828: - if ((0x4000000040000L & l) != 0L) - jjCheckNAdd(13); - break; - case 511: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 510; - break; - case 512: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 511; - break; - case 513: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 512; - break; - case 514: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 513; - break; - case 516: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 515; - break; - case 517: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 516; - break; - case 518: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 517; - break; - case 519: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 518; - break; - case 520: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 519; - break; - case 521: - case 671: - if ((0x4000000040000L & l) != 0L) - jjCheckNAdd(7); - break; - case 522: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 521; - break; - case 523: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 522; - break; - case 524: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 523; - break; - case 525: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 524; - break; - case 527: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 526; - break; - case 528: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 527; - break; - case 530: - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 529; - break; - case 531: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 530; - break; - case 532: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 531; - break; - case 533: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 532; - break; - case 534: - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 533; - break; - case 535: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 534; - break; - case 536: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 535; - break; - case 538: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 537; - break; - case 539: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 538; - break; - case 540: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 539; - break; - case 541: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 540; - break; - case 542: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 541; - break; - case 543: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 542; - break; - case 545: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 544; - break; - case 546: - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 545; - break; - case 547: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 546; - break; - case 548: - if ((0x4000000040000L & l) != 0L) - jjAddStates(88, 95); - break; - case 551: - if ((0x200000002L & l) != 0L) - jjCheckNAdd(280); - break; - case 552: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 551; - break; - case 554: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 553; - break; - case 555: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 554; - break; - case 556: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 555; - break; - case 557: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 556; - break; - case 558: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 557; - break; - case 559: - if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 558; - break; - case 560: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 559; - break; - case 562: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 561; - break; - case 563: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 562; - break; - case 564: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 563; - break; - case 565: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 564; - break; - case 566: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 565; - break; - case 568: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 567; - break; - case 569: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 568; - break; - case 570: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 569; - break; - case 571: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 570; - break; - case 572: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 571; - break; - case 573: - if ((0x80000000800L & l) != 0L) - jjCheckNAdd(13); - break; - case 574: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 573; - break; - case 575: - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 574; - break; - case 576: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 575; - break; - case 578: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 577; - break; - case 579: - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 578; - break; - case 580: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 579; - break; - case 582: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 581; - break; - case 583: - if ((0x80000000800000L & l) != 0L) - jjCheckNAdd(156); - break; - case 584: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 583; - break; - case 585: - if ((0x8000000080000L & l) != 0L) - jjAddStates(71, 87); - break; - case 586: - if ((0x200000002L & l) != 0L && kind > 2) - kind = 2; - break; - case 587: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 586; - break; - case 588: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 587; - break; - case 589: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 588; - break; - case 591: - if ((0x100000001000L & l) != 0L) - jjCheckNAdd(280); - break; - case 592: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 591; - break; - case 593: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 592; - break; - case 594: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 593; - break; - case 596: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 595; - break; - case 598: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 597; - break; - case 600: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 599; - break; - case 601: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 600; - break; - case 602: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 601; - break; - case 603: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 602; - break; - case 605: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 604; - break; - case 606: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 605; - break; - case 607: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 606; - break; - case 608: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 607; - break; - case 610: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 609; - break; - case 611: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 610; - break; - case 612: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 611; - break; - case 613: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 612; - break; - case 614: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 613; - break; - case 615: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 614; - break; - case 616: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 615; - break; - case 617: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 616; - break; - case 618: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 617; - break; - case 619: - if ((0x2000000020L & l) != 0L) - jjCheckNAdd(34); - break; - case 621: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 620; - break; - case 623: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 622; - break; - case 624: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 623; - break; - case 625: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 624; - break; - case 626: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 625; - break; - case 627: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 626; - break; - case 629: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 628; - break; - case 631: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 630; - break; - case 632: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 631; - break; - case 633: - if ((0x2000000020000L & l) != 0L) - jjCheckNAdd(280); - break; - case 635: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 634; - break; - case 636: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 635; - break; - case 638: - if ((0x2000000020000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 637; - break; - case 640: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 639; - break; - case 641: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 640; - break; - case 642: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 641; - break; - case 643: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 642; - break; - case 644: - if ((0x2000000020000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 643; - break; - case 646: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 645; - break; - case 647: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 646; - break; - case 648: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 647; - break; - case 649: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 648; - break; - case 650: - if ((0x2000000020000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 649; - break; - case 652: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 651; - break; - case 653: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 652; - break; - case 654: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 653; - break; - case 655: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 654; - break; - case 657: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 656; - break; - case 659: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 658; - break; - case 660: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 659; - break; - case 661: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 660; - break; - case 662: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 661; - break; - case 663: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 662; - break; - case 664: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 663; - break; - case 665: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 664; - break; - case 666: - if ((0x200000002000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 665; - break; - case 667: - if ((0x10000000100000L & l) != 0L) - jjCheckNAddStates(57, 70); - break; - case 672: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 671; - break; - case 673: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 672; - break; - case 674: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 673; - break; - case 675: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 674; - break; - case 676: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 675; - break; - case 677: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 676; - break; - case 679: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 678; - break; - case 681: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 680; - break; - case 683: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 682; - break; - case 684: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 683; - break; - case 685: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 684; - break; - case 686: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 685; - break; - case 687: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 686; - break; - case 688: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 687; - break; - case 690: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 689; - break; - case 691: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 690; - break; - case 692: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 691; - break; - case 693: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 692; - break; - case 694: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 693; - break; - case 695: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 694; - break; - case 696: - if ((0x400000004000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 695; - break; - case 697: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 696; - break; - case 698: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 697; - break; - case 699: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 698; - break; - case 701: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 700; - break; - case 702: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 701; - break; - case 703: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 702; - break; - case 704: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 703; - break; - case 705: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 704; - break; - case 706: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 705; - break; - case 707: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 706; - break; - case 708: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 707; - break; - case 709: - if ((0x400000004000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 708; - break; - case 710: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 709; - break; - case 711: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 710; - break; - case 712: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 711; - break; - case 714: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 713; - break; - case 715: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 714; - break; - case 716: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 715; - break; - case 718: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 717; - break; - case 720: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 719; - break; - case 721: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 720; - break; - case 722: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 721; - break; - case 723: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 722; - break; - case 724: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 723; - break; - case 725: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 724; - break; - case 726: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 725; - break; - case 727: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 726; - break; - case 729: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 728; - break; - case 730: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 729; - break; - case 731: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 730; - break; - case 732: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 731; - break; - case 733: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 732; - break; - case 734: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 733; - break; - case 736: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 735; - break; - case 737: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 736; - break; - case 738: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 737; - break; - case 739: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 738; - break; - case 740: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 739; - break; - case 741: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 740; - break; - case 742: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 741; - break; - case 743: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 742; - break; - case 744: - if ((0x200000002000L & l) != 0L && kind > 2) - kind = 2; - break; - case 745: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 744; - break; - case 746: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 745; - break; - case 747: - if ((0x20000000200000L & l) != 0L) - jjCheckNAdd(13); - break; - case 748: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 747; - break; - case 749: - if ((0x20000000200000L & l) != 0L) - jjAddStates(50, 56); - break; - case 751: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 750; - break; - case 754: - if ((0x2000000020000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 753; - break; - case 755: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 754; - break; - case 756: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 755; - break; - case 757: - if ((0x80000000800000L & l) != 0L) - jjCheckNAdd(30); - break; - case 758: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 757; - break; - case 759: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 758; - break; - case 760: - if ((0x80000000800L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 759; - break; - case 761: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 760; - break; - case 763: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 762; - break; - case 764: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 763; - break; - case 765: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 764; - break; - case 767: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 766; - break; - case 768: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 767; - break; - case 771: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 770; - break; - case 772: - if ((0x2000000020L & l) != 0L) - jjCheckNAdd(3); - break; - case 773: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 772; - break; - case 774: - if ((0x40000000400000L & l) != 0L) - jjAddStates(45, 49); - break; - case 776: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 775; - break; - case 777: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 776; - break; - case 779: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 778; - break; - case 780: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 779; - break; - case 781: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 780; - break; - case 783: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 782; - break; - case 784: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 783; - break; - case 785: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 784; - break; - case 786: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 785; - break; - case 788: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 787; - break; - case 789: - if ((0x200000002000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 788; - break; - case 790: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 789; - break; - case 791: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 790; - break; - case 792: - if ((0x80000000800000L & l) != 0L && kind > 2) - kind = 2; - break; - case 793: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 792; - break; - case 794: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 793; - break; - case 795: - if ((0x80000000800000L & l) != 0L) - jjAddStates(40, 44); - break; - case 799: - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 798; - break; - case 800: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 799; - break; - case 802: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 801; - break; - case 803: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 802; - break; - case 805: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 804; - break; - case 806: - if ((0x4000000040000L & l) != 0L) - jjCheckNAdd(102); - break; - case 807: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 806; - break; - case 809: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 808; - break; - case 810: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 809; - break; - case 811: - if ((0x1000000010L & l) != 0L) - jjAddStates(23, 39); - break; - case 814: - if ((0x200000002L & l) != 0L) - jjCheckNAdd(7); - break; - case 816: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 815; - break; - case 817: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 816; - break; - case 818: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 817; - break; - case 819: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 818; - break; - case 820: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 819; - break; - case 822: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 821; - break; - case 824: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 823; - break; - case 825: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 824; - break; - case 826: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 825; - break; - case 827: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 826; - break; - case 829: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 828; - break; - case 830: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 829; - break; - case 831: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 830; - break; - case 832: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 831; - break; - case 833: - if ((0x100000001000L & l) != 0L) - jjCheckNAdd(34); - break; - case 834: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 833; - break; - case 835: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 834; - break; - case 836: - if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 835; - break; - case 837: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 836; - break; - case 839: - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 838; - break; - case 840: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 839; - break; - case 841: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 840; - break; - case 842: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 841; - break; - case 843: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 842; - break; - case 844: - if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 843; - break; - case 845: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 844; - break; - case 847: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 846; - break; - case 848: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 847; - break; - case 849: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 848; - break; - case 850: - if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 849; - break; - case 851: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 850; - break; - case 853: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 852; - break; - case 854: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 853; - break; - case 855: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 854; - break; - case 856: - if ((0x400000004L & l) != 0L) - jjCheckNAdd(13); - break; - case 857: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 856; - break; - case 860: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 859; - break; - case 861: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 860; - break; - case 863: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 862; - break; - case 864: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 863; - break; - case 865: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 864; - break; - case 866: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 865; - break; - case 867: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 866; - break; - case 868: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 867; - break; - case 869: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 868; - break; - case 870: - if ((0x800000008L & l) != 0L) - jjCheckNAdd(156); - break; - case 871: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 870; - break; - case 872: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 871; - break; - case 873: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 872; - break; - case 874: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 873; - break; - case 875: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 874; - break; - case 876: - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 875; - break; - case 878: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 877; - break; - case 880: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 879; - break; - case 881: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 880; - break; - case 882: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 881; - break; - case 883: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 882; - break; - case 885: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 884; - break; - case 886: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 885; - break; - case 888: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 887; - break; - case 889: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 888; - break; - case 890: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 889; - break; - case 892: - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 891; - break; - case 893: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 892; - break; - case 894: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 893; - break; - case 895: - if ((0x800000008000L & l) != 0L) - jjCheckNAdd(217); - break; - case 896: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 895; - break; - case 897: - if ((0x10000000100000L & l) != 0L && kind > 20) - kind = 20; - break; - case 898: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 897; - break; - case 899: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 898; - break; - case 901: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 900; - break; - case 902: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 901; - break; - case 903: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 902; - break; - case 904: - if ((0x200000002L & l) != 0L) - jjCheckNAddStates(12, 22); - break; - case 906: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 905; - break; - case 907: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 906; - break; - case 912: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 911; - break; - case 914: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 913; - break; - case 915: - if ((0x1000000010L & l) != 0L) - jjCheckNAdd(53); - break; - case 917: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 916; - break; - case 918: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 917; - break; - case 919: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 918; - break; - case 920: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 919; - break; - case 921: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 920; - break; - case 923: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 922; - break; - case 924: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 923; - break; - case 925: - if ((0x400000004000L & l) != 0L) - jjCheckNAdd(7); - break; - case 926: - if ((0x4000000040000L & l) != 0L) - jjCheckNAdd(13); - break; - case 928: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 927; - break; - case 929: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 928; - break; - case 930: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 929; - break; - case 931: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 930; - break; - case 933: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 932; - break; - case 935: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 934; - break; - case 936: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 935; - break; - case 937: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 936; - break; - case 938: - if ((0x400000004000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 937; - break; - case 939: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 938; - break; - case 940: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 939; - break; - case 941: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 940; - break; - case 942: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 941; - break; - case 943: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 942; - break; - case 944: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 943; - break; - case 945: - if ((0x100000001000L & l) != 0L && kind > 20) - kind = 20; - break; - case 946: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 945; - break; - case 949: - if ((0x2000000020L & l) != 0L) - jjAddStates(200, 201); - break; - case 963: - case 964: - if ((0x6fffffffefffffffL & l) == 0L) - break; - if (kind > 101) - kind = 101; - jjCheckNAdd(964); - break; - default : break; - } - } while(i != startsAt); - } - else - { - int i2 = (curChar & 0xff) >> 6; - long l2 = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 23: - if ((jjbitVec0[i2] & l2) == 0L) - break; - if (kind > 90) - kind = 90; - jjAddStates(9, 11); - break; - default : break; - } - } while(i != startsAt); - } - if (kind != 0x7fffffff) - { - jjmatchedKind = kind; - jjmatchedPos = curPos; - kind = 0x7fffffff; - } - ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 965 - (jjnewStateCnt = startsAt))) - return curPos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return curPos; } - } -} -private final int jjStopStringLiteralDfa_1(int pos, long active0, long active1) -{ - switch (pos) - { - default : - return -1; - } -} -private final int jjStartNfa_1(int pos, long active0, long active1) -{ - return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0, active1), pos + 1); -} -private int jjMoveStringLiteralDfa0_1() -{ - switch(curChar) - { - case 39: - return jjStartNfaWithStates_1(0, 93, 1); - default : - return jjMoveNfa_1(0, 0); - } -} -private int jjStartNfaWithStates_1(int pos, int kind, int state) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return pos + 1; } - return jjMoveNfa_1(state, pos + 1); -} -private int jjMoveNfa_1(int startState, int curPos) -{ - int startsAt = 0; - jjnewStateCnt = 3; - int i = 1; - jjstateSet[0] = startState; - int kind = 0x7fffffff; - for (;;) - { - if (++jjround == 0x7fffffff) - ReInitRounds(); - if (curChar < 64) - { - long l = 1L << curChar; - do - { - switch(jjstateSet[--i]) - { - case 0: - if ((0xffffff7fffffffffL & l) != 0L) - { - if (kind > 92) - kind = 92; - } - else if (curChar == 39) - jjstateSet[jjnewStateCnt++] = 1; - break; - case 1: - if (curChar == 39 && kind > 92) - kind = 92; - break; - case 2: - if (curChar == 39) - jjstateSet[jjnewStateCnt++] = 1; - break; - default : break; - } - } while(i != startsAt); - } - else if (curChar < 128) - { - long l = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 0: - kind = 92; - break; - default : break; - } - } while(i != startsAt); - } - else - { - int i2 = (curChar & 0xff) >> 6; - long l2 = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 0: - if ((jjbitVec0[i2] & l2) != 0L && kind > 92) - kind = 92; - break; - default : break; - } - } while(i != startsAt); - } - if (kind != 0x7fffffff) - { - jjmatchedKind = kind; - jjmatchedPos = curPos; - kind = 0x7fffffff; - } - ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt))) - return curPos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return curPos; } - } -} -static final int[] jjnextStates = { - 954, 955, 956, 949, 958, 959, 961, 962, 963, 23, 24, 26, 910, 914, 915, 921, - 924, 925, 926, 933, 34, 944, 946, 813, 814, 822, 827, 832, 837, 845, 851, 855, - 861, 869, 878, 886, 890, 894, 896, 903, 797, 803, 805, 807, 810, 777, 781, 786, - 791, 794, 752, 756, 761, 765, 768, 771, 773, 670, 677, 679, 681, 688, 699, 712, - 320, 718, 727, 734, 743, 746, 748, 590, 594, 598, 603, 608, 618, 619, 621, 627, - 629, 632, 633, 638, 644, 650, 657, 666, 550, 552, 560, 566, 572, 576, 582, 584, - 491, 496, 502, 509, 514, 520, 525, 528, 536, 543, 547, 471, 451, 473, 475, 479, - 483, 489, 439, 445, 448, 450, 320, 455, 460, 424, 428, 432, 435, 404, 406, 411, - 414, 417, 420, 332, 339, 346, 353, 356, 365, 369, 370, 375, 382, 388, 390, 397, - 315, 319, 320, 322, 325, 295, 298, 301, 304, 305, 310, 313, 249, 250, 257, 261, - 265, 272, 274, 279, 286, 291, 52, 59, 61, 63, 69, 71, 78, 87, 101, 105, - 108, 114, 119, 126, 130, 134, 139, 147, 155, 165, 171, 176, 187, 191, 196, 206, - 216, 232, 242, 246, 33, 35, 44, 46, 950, 951, -}; - -/** Token literal values. */ -public static final String[] jjstrLiteralImages = { -"", null, null, "\50", "\51", "\56", "\54", "\73", "\174\174", "\53", "\55", -"\52", "\57", "\75", null, "\74", "\74\75", "\76", "\76\75", null, null, null, null, -null, null, null, null, null, null, null, null, null, null, null, null, null, null, -null, null, null, null, null, null, null, null, null, null, null, null, null, null, -null, null, null, null, null, null, null, null, null, null, null, null, null, null, -null, null, null, null, null, null, null, null, null, null, null, null, null, null, -null, null, null, null, null, null, null, null, null, null, null, null, null, null, -null, null, null, null, null, null, null, null, null, null, }; - -/** Lexer state names. */ -public static final String[] lexStateNames = { - "DEFAULT", - "WithinString", - "WithinDelimitedId", -}; - -/** Lex State array. */ -public static final int[] jjnewLexState = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 0, -1, -1, -1, -1, 2, -1, - 0, -1, -1, -}; -static final long[] jjtoToken = { - 0xfffffffffffffffdL, 0x31e3ffffffL, -}; -static final long[] jjtoSkip = { - 0x2L, 0x4000000L, -}; -static final long[] jjtoMore = { - 0x0L, 0xc18000000L, -}; -protected SimpleCharStream input_stream; -private final int[] jjrounds = new int[965]; -private final int[] jjstateSet = new int[1930]; -protected char curChar; -/** Constructor. */ -public ADQLParserTokenManager(SimpleCharStream stream){ - if (SimpleCharStream.staticFlag) - throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); - input_stream = stream; -} - -/** Constructor. */ -public ADQLParserTokenManager(SimpleCharStream stream, int lexState){ - this(stream); - SwitchTo(lexState); -} - -/** Reinitialise parser. */ -public void ReInit(SimpleCharStream stream) -{ - jjmatchedPos = jjnewStateCnt = 0; - curLexState = defaultLexState; - input_stream = stream; - ReInitRounds(); -} -private void ReInitRounds() -{ - int i; - jjround = 0x80000001; - for (i = 965; i-- > 0;) - jjrounds[i] = 0x80000000; -} - -/** Reinitialise parser. */ -public void ReInit(SimpleCharStream stream, int lexState) -{ - ReInit(stream); - SwitchTo(lexState); -} - -/** Switch to specified lex state. */ -public void SwitchTo(int lexState) -{ - if (lexState >= 3 || lexState < 0) - throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); - else - curLexState = lexState; -} - -protected Token jjFillToken() -{ - final Token t; - final String curTokenImage; - final int beginLine; - final int endLine; - final int beginColumn; - final int endColumn; - String im = jjstrLiteralImages[jjmatchedKind]; - curTokenImage = (im == null) ? input_stream.GetImage() : im; - beginLine = input_stream.getBeginLine(); - beginColumn = input_stream.getBeginColumn(); - endLine = input_stream.getEndLine(); - endColumn = input_stream.getEndColumn(); - t = Token.newToken(jjmatchedKind, curTokenImage); - - t.beginLine = beginLine; - t.endLine = endLine; - t.beginColumn = beginColumn; - t.endColumn = endColumn; - - return t; -} - -int curLexState = 0; -int defaultLexState = 0; -int jjnewStateCnt; -int jjround; -int jjmatchedPos; -int jjmatchedKind; - -/** Get the next Token. */ -public Token getNextToken() -{ - Token matchedToken; - int curPos = 0; - - EOFLoop : - for (;;) - { - try - { - curChar = input_stream.BeginToken(); - } - catch(java.io.IOException e) - { - jjmatchedKind = 0; - matchedToken = jjFillToken(); - CommonTokenAction(matchedToken); - return matchedToken; - } - image = jjimage; - image.setLength(0); - jjimageLen = 0; - - for (;;) - { - switch(curLexState) - { - case 0: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_0(); - break; - case 1: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_1(); - break; - case 2: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_2(); - break; - } - if (jjmatchedKind != 0x7fffffff) - { - if (jjmatchedPos + 1 < curPos) - input_stream.backup(curPos - jjmatchedPos - 1); - if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) - { - matchedToken = jjFillToken(); - TokenLexicalActions(matchedToken); - if (jjnewLexState[jjmatchedKind] != -1) - curLexState = jjnewLexState[jjmatchedKind]; - CommonTokenAction(matchedToken); - return matchedToken; - } - else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) - { - if (jjnewLexState[jjmatchedKind] != -1) - curLexState = jjnewLexState[jjmatchedKind]; - continue EOFLoop; - } - jjimageLen += jjmatchedPos + 1; - if (jjnewLexState[jjmatchedKind] != -1) - curLexState = jjnewLexState[jjmatchedKind]; - curPos = 0; - jjmatchedKind = 0x7fffffff; - try { - curChar = input_stream.readChar(); - continue; - } - catch (java.io.IOException e1) { } - } - int error_line = input_stream.getEndLine(); - int error_column = input_stream.getEndColumn(); - String error_after = null; - boolean EOFSeen = false; - try { input_stream.readChar(); input_stream.backup(1); } - catch (java.io.IOException e1) { - EOFSeen = true; - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - if (curChar == '\n' || curChar == '\r') { - error_line++; - error_column = 0; - } - else - error_column++; - } - if (!EOFSeen) { - input_stream.backup(1); - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - } - throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); - } - } -} - -void TokenLexicalActions(Token matchedToken) -{ - switch(jjmatchedKind) - { - case 2 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.sqlReserved = true; - break; - case 19 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 20 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 21 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 22 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 23 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 24 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 25 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 26 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 27 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 28 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 29 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 30 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 31 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 32 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 33 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 34 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 35 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 36 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 37 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 38 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 39 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 40 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 41 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 42 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 43 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 44 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 45 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 46 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 47 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 48 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 49 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 50 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 51 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 52 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 53 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 54 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 55 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 56 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 57 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 58 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 59 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 60 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 61 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 62 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 63 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 64 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 65 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 66 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 67 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 68 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 69 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 70 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 71 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 72 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 73 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 74 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 75 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 76 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 77 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 78 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 79 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 80 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 81 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 82 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 83 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 84 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 85 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 86 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 87 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 88 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 89 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - default : - break; - } -} -private void jjCheckNAdd(int state) -{ - if (jjrounds[state] != jjround) - { - jjstateSet[jjnewStateCnt++] = state; - jjrounds[state] = jjround; - } -} -private void jjAddStates(int start, int end) -{ - do { - jjstateSet[jjnewStateCnt++] = jjnextStates[start]; - } while (start++ != end); -} -private void jjCheckNAddTwoStates(int state1, int state2) -{ - jjCheckNAdd(state1); - jjCheckNAdd(state2); -} - -private void jjCheckNAddStates(int start, int end) -{ - do { - jjCheckNAdd(jjnextStates[start]); - } while (start++ != end); -} - - /** Constructor. */ - public ADQLParser200TokenManager(SimpleCharStream stream){ - - if (SimpleCharStream.staticFlag) - throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); - - input_stream = stream; - } - - /** Constructor. */ - public ADQLParser200TokenManager (SimpleCharStream stream, int lexState){ - ReInit(stream); - SwitchTo(lexState); - } - - /** Reinitialise parser. */ - public void ReInit(SimpleCharStream stream) - { - jjmatchedPos = jjnewStateCnt = 0; - curLexState = defaultLexState; - input_stream = stream; - ReInitRounds(); - } - - private void ReInitRounds() - { - int i; - jjround = 0x80000001; - for (i = 965; i-- > 0;) - jjrounds[i] = 0x80000000; - } - - /** Reinitialise parser. */ - public void ReInit(SimpleCharStream stream, int lexState) - { - ReInit(stream); - SwitchTo(lexState); - } - - /** Switch to specified lex state. */ - public void SwitchTo(int lexState) - { - if (lexState >= 3 || lexState < 0) - throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); - else - curLexState = lexState; - } - -/** Lexer state names. */ -public static final String[] lexStateNames = { - "DEFAULT", - "WithinString", - "WithinDelimitedId", -}; - -/** Lex State array. */ -public static final int[] jjnewLexState = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 0, -1, -1, -1, -1, 2, -1, - 0, -1, -1, -}; -static final long[] jjtoToken = { - 0xfffffffffffffffdL, 0x31e3ffffffL, -}; -static final long[] jjtoSkip = { - 0x2L, 0x4000000L, -}; -static final long[] jjtoMore = { - 0x0L, 0xc18000000L, -}; - protected SimpleCharStream input_stream; - - private final int[] jjrounds = new int[965]; - private final int[] jjstateSet = new int[2 * 965]; - - private final StringBuilder jjimage = new StringBuilder(); - private StringBuilder image = jjimage; - private int jjimageLen; - private int lengthOfMatch; - - protected char curChar; -} diff --git a/src/adql/parser/ADQLParser201.java b/src/adql/parser/ADQLParser201.java deleted file mode 100644 index 1d8499f57c5a67f76299eb933ad7e99b3dc8908b..0000000000000000000000000000000000000000 --- a/src/adql/parser/ADQLParser201.java +++ /dev/null @@ -1,6695 +0,0 @@ -/* ADQLParser201.java */ -/* Generated By:JavaCC: Do not edit this line. ADQLParser201.java */ -package adql.parser; - -import java.util.ArrayList; - -/* - * This file is part of ADQLLibrary. - * - * ADQLLibrary is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * ADQLLibrary is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2019 - UDS/Centre de Données astronomiques de Strasbourg (CDS) - */ - -import java.util.Stack; -import java.util.Vector; - -import adql.db.exception.UnresolvedIdentifiersException; -import adql.db.exception.UnsupportedFeatureException; -import adql.parser.ADQLParserFactory.ADQLVersion; -import adql.parser.ADQLQueryFactory.JoinType; -import adql.parser.IdentifierItems.IdentifierItem; -import adql.parser.feature.FeatureSet; -import adql.query.ADQLObject; -import adql.query.ADQLOrder; -import adql.query.ADQLQuery; -import adql.query.ClauseADQL; -import adql.query.ClauseConstraints; -import adql.query.ClauseSelect; -import adql.query.SelectAllColumns; -import adql.query.SelectItem; -import adql.query.TextPosition; -import adql.query.constraint.ADQLConstraint; -import adql.query.constraint.Between; -import adql.query.constraint.Comparison; -import adql.query.constraint.ComparisonOperator; -import adql.query.constraint.ConstraintsGroup; -import adql.query.constraint.Exists; -import adql.query.constraint.In; -import adql.query.constraint.IsNull; -import adql.query.constraint.NotConstraint; -import adql.query.from.ADQLJoin; -import adql.query.from.FromContent; -import adql.query.operand.ADQLColumn; -import adql.query.operand.ADQLOperand; -import adql.query.operand.Concatenation; -import adql.query.operand.NegativeOperand; -import adql.query.operand.NumericConstant; -import adql.query.operand.Operation; -import adql.query.operand.OperationType; -import adql.query.operand.StringConstant; -import adql.query.operand.WrappedOperand; -import adql.query.operand.function.ADQLFunction; -import adql.query.operand.function.MathFunction; -import adql.query.operand.function.MathFunctionType; -import adql.query.operand.function.SQLFunction; -import adql.query.operand.function.SQLFunctionType; -import adql.query.operand.function.UserDefinedFunction; -import adql.query.operand.function.geometry.GeometryFunction; -import adql.query.operand.function.geometry.GeometryFunction.GeometryValue; -import adql.query.operand.function.geometry.PointFunction; -import adql.query.operand.function.string.LowerFunction; -import adql.search.SearchOptionalFeaturesHandler; - -/** -* Parses an ADQL-2.1 query thanks to the {@link ADQLParser201#Query() Query()} function. -* -* <p> -* This parser is able, thanks to a {@link QueryChecker} object, to check each -* {@link 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 {@link QueryChecker}. Thus -* you must extend {@link QueryChecker} to check semantically all generated -* ADQLQuery objects. -* </p> -* -* <p> -* To create an object representation of the given ADQL query, this parser uses -* a {@link 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 {@link ADQLQueryFactory} -* (ie. createContains(...)). -* </p> -* -* <p>Here are the key functions to use:</p> -* <ul> -* <li>{@link #parseQuery(java.lang.String)} (or any of its alternatives) -* to parse an input ADQL query String and get its corresponding ADQL tree -* </li> -* <li>{@link #tryQuickFix(java.lang.String)} to try fixing the most common -* issues with ADQL queries (e.g. Unicode confusable characters, -* unescaped ADQL identifiers, SQL reserved keywords, ...)</li> -* <li>{@link #setSupportedFeatures(FeatureSet)} to set which optional ADQL -* features are supported or not ; all optional features used in the query -* while being declared as un-supported will throw an error at the end of -* the parsing</li> -* </ul> -* -* <p><b><u>WARNING:</u> -* To modify this class it's strongly encouraged to modify the .jj file in the -* section between <i>PARSER_BEGIN</i> and <i>PARSER_END</i> and to re-compile -* it with JavaCC. -* </b></p> -* -* @see QueryChecker -* @see ADQLQueryFactory -* -* @author Grégory Mantelet (CDS) -* @version 2.0 (07/2019) -* @since 2.0 -*/ -public class ADQLParser201 implements ADQLParser, ADQLParser201Constants { - - /** Tools to build the object representation of the ADQL query. */ - private ADQLQueryFactory queryFactory = new ADQLQueryFactory(); - - /** Default set of supported language features. - * <p><i><b>Note:</b> - * By default, all optional features are supported. - * </i></p> */ - private FeatureSet supportedFeatures = new FeatureSet(true, true); - - /** The stack of queries (because there may be some sub-queries). */ - private Stack<ADQLQuery> stackQuery = new Stack<ADQLQuery>(); - - /** The object representation of the ADQL query to parse. - * (ONLY USED DURING THE PARSING, else it is always <i>null</i>). */ - private ADQLQuery query = null; - - /** Checks each {@link ADQLQuery} (sub-query or not) just after their - * generation. */ - private QueryChecker queryChecker = null; - - /** - * Builds an ADQL parser without a query to parse. - */ - public ADQLParser201() { - this(new java.io.ByteArrayInputStream("".getBytes())); - setDebug(false); - } - - /** - * Builds an ADQL parser without a query to parse but with a - * {@link QueryChecker} and a {@link ADQLQueryFactory}. - * - * @param checker The object to use to check each {@link ADQLQuery}. - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser201(QueryChecker checker, ADQLQueryFactory factory) { - this(); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds an ADQL parser without a query to parse but with a - * {@link QueryChecker}. - * - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser201(QueryChecker checker) { - this(checker, null); - } - - /** - * Builds an ADQL parser without a query to parse but with a - * {@link ADQLQueryFactory}. - * - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser201(ADQLQueryFactory factory) { - this((QueryChecker)null, factory); - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param checker The object to use to check each {@link ADQLQuery}. - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser201(java.io.InputStream stream, QueryChecker checker, ADQLQueryFactory factory) { - this(stream); - - setDebug(false); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser201(java.io.InputStream stream, QueryChecker checker) { - this(stream, checker, null); - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser201(java.io.InputStream stream, ADQLQueryFactory factory) { - this(stream, (QueryChecker)null, factory); - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param encoding The supplied encoding. - * @param checker The object to use to check each {@link ADQLQuery}. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser201(java.io.InputStream stream, String encoding, QueryChecker checker, ADQLQueryFactory factory) { - this(stream, encoding); - - setDebug(false); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param encoding The supplied encoding. - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser201(java.io.InputStream stream, String encoding, QueryChecker checker) { - this(stream, encoding, checker, null); - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param encoding The supplied encoding. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser201(java.io.InputStream stream, String encoding, ADQLQueryFactory factory) { - this(stream, encoding, null, factory); - } - - /** - * Builds a parser with a reader containing the query to parse. - * - * @param reader The reader in which the ADQL query to parse is given. - * @param checker The object to use to check each {@link ADQLQuery}. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser201(java.io.Reader reader, QueryChecker checker, ADQLQueryFactory factory) { - this(reader); - - setDebug(false); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds a parser with a reader containing the query to parse. - * - * @param reader The reader in which the ADQL query to parse is given. - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser201(java.io.Reader reader, QueryChecker checker) { - this(reader, checker, null); - } - - /** - * Builds a parser with a reader containing the query to parse. - * - * @param reader The reader in which the ADQL query to parse is given. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser201(java.io.Reader reader, ADQLQueryFactory factory) { - this(reader, null, factory); - } - - /** - * Builds a parser with another token manager. - * - * @param tm The manager which associates a token to a numeric code. - * @param checker The object to use to check each {@link ADQLQuery }. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser201(ADQLParser201TokenManager tm, QueryChecker checker, ADQLQueryFactory factory) { - this(tm); - - setDebug(false); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds a parser with another token manager. - * - * @param tm The manager which associates a token to a numeric code. - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser201(ADQLParser201TokenManager tm, QueryChecker checker) { - this(tm, checker, null); - } - - /** - * Builds a parser with another token manager. - * - * @param tm The manager which associates a token to a numeric code. - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser201(ADQLParser201TokenManager tm, ADQLQueryFactory factory) { - this(tm, null, factory); - } - - /* ADDITIONAL GETTERS & SETTERS */ - - @Override - public final ADQLVersion getADQLVersion() { - return ADQLVersion.V2_1; - } - - @Override - public final void setDebug(boolean debug) { - if (debug) - enable_tracing(); - else - disable_tracing(); - } - - @Override - public final QueryChecker getQueryChecker() { - return queryChecker; - } - - @Override - public final void setQueryChecker(QueryChecker checker) { - queryChecker = checker; - } - - @Override - public final ADQLQueryFactory getQueryFactory() { - return queryFactory; - } - - @Override - public final void setQueryFactory(ADQLQueryFactory factory) { - queryFactory = (factory != null) ? factory : (new ADQLQueryFactory()); - } - - @Override - public final FeatureSet getSupportedFeatures() { - return supportedFeatures; - } - - @Override - public void setSupportedFeatures(final FeatureSet features) { - if (features != null) - supportedFeatures = features; - } - - /* EXCEPTION HELPER FUNCTION */ - - private final ParseException generateParseException(Exception ex) { - if (!(ex instanceof ParseException)) { - ParseException pex = new ParseException("[" + ex.getClass().getName() + "] " + ex.getMessage()); - pex.setStackTrace(ex.getStackTrace()); - return pex; - } else - return (ParseException)ex; - } - - /* QUERY PARSING FUNCTIONS */ - - /** - * Tell whether the given string is a valid ADQL regular identifier. - * - * <p> - * According to the ADQL-2.0's BNF, a regular identifier (i.e. not delimited - * ; not between double quotes) must be a letter followed by a letter, digit - * or underscore. So, the following regular expression: - * </p> - * <pre>[a-zA-Z]+[a-zA-Z0-9_]*</pre> - * - * <p>This is what this function tests on the given string.</p> - * - * @param idCandidate The string to test. - * - * @return <code>true</code> if the given string is a valid regular - * identifier, - * <code>false</code> otherwise. - * - * @see #testRegularIdentifier(adql.parser.Token) - * - * @since 1.5 - */ - @Override - public final boolean isRegularIdentifier(final String idCandidate) { - return idCandidate.matches("[a-zA-Z]+[a-zA-Z0-9_]*"); - } - - /** - * Test the given token as an ADQL's regular identifier. - * - * <p> - * This function uses {@link #isRegularIdentifier(java.lang.String)} to - * test the given token's image. If the test fails, a - * {@link adql.parser.ParseException} is thrown. - * </p> - * - * @param token The token to test. - * - * @throws ParseException If the given token is not a valid ADQL regular - * identifier. - * - * @see #isRegularIdentifier(java.lang.String) - * - * @since 1.5 - */ - @Override - public final void testRegularIdentifier(final Token token) throws ParseException { - if (!isRegularIdentifier(token.image)) - throw new ParseException("Invalid ADQL regular identifier: \u005c"" + token.image + "\u005c"! If it aims to be a column/table name/alias, you should write it between double quotes.", new TextPosition(token)); - } - - /** - * Parses the query given at the creation of this parser or in the - * <i>ReInit</i> functions. - * - * @return The object representation of the given ADQL query. - * - * @throws ParseException If there is at least one syntactic error. - * - * @see ADQLParser201#Query() - */ - @Override - public final ADQLQuery parseQuery() throws ParseException { - stackQuery.clear(); - query = null; - try { - return Query(); - } catch(TokenMgrError tme) { - throw new ParseException(tme); - } - } - - /** - * Parses the query given in parameter. - * - * @param q The ADQL query to parse. - * - * @return The object representation of the given ADQL query. - * - * @throws ParseException If there is at least one syntactic error. - * - * @see ADQLParser201#ReInit(java.io.InputStream) - * @see ADQLParser201#setDebug(boolean) - * @see ADQLParser201#Query() - */ - @Override - public final ADQLQuery parseQuery(String q) throws ParseException { - stackQuery.clear(); - query = null; - ReInit(new java.io.ByteArrayInputStream(q.getBytes())); - try { - return Query(); - } catch(TokenMgrError tme) { - throw new ParseException(tme); - } - } - - /** - * Parses the query contained in the stream given in parameter. - * - * @param stream The stream which contains the ADQL query to parse. - * - * @return The object representation of the given ADQL query. - * - * @throws ParseException If there is at least one syntactic error. - * - * @see ADQLParser201#ReInit(java.io.InputStream) - * @see ADQLParser201#setDebug(boolean) - * @see ADQLParser201#Query() - */ - @Override - public final ADQLQuery parseQuery(java.io.InputStream stream) throws ParseException { - stackQuery.clear(); - query = null; - ReInit(stream); - try { - return Query(); - } catch(TokenMgrError tme) { - throw new ParseException(tme); - } - } - - @Override - public final ClauseSelect parseSelect(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_1); - - // Parse the string as a SELECT clause: - Select(); - - // Return what's just got parsed: - return query.getSelect(); - - } catch(TokenMgrError tme) { - throw new ParseException(tme); - } catch(Exception ex) { - throw generateParseException(ex); - } - } - - @Override - public final FromContent parseFrom(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_1); - - // Parse the string as a FROM clause: - From(); - - // Return what's just got parsed: - return query.getFrom(); - - } catch(TokenMgrError tme) { - throw new ParseException(tme); - } catch(Exception ex) { - throw generateParseException(ex); - } - } - - @Override - public final ClauseConstraints parseWhere(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_1); - - // Parse the string as a WHERE clause: - Where(); - - // Return what's just got parsed: - return query.getWhere(); - - } catch(TokenMgrError tme) { - throw new ParseException(tme); - } catch(Exception ex) { - throw generateParseException(ex); - } - } - - @Override - public final ClauseADQL<ADQLOrder> parseOrderBy(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_1); - - // Parse the string as a ORDER BY clause: - OrderBy(); - - // Return what's just got parsed: - return query.getOrderBy(); - - } catch(TokenMgrError tme) { - throw new ParseException(tme); - } catch(Exception ex) { - throw generateParseException(ex); - } - } - - @Override - public final ClauseADQL<ADQLColumn> parseGroupBy(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_1); - - // Parse the string as a GROUP BY clause: - GroupBy(); - - // Return what's just got parsed: - return query.getGroupBy(); - - } catch(TokenMgrError tme) { - throw new ParseException(tme); - } catch(Exception ex) { - throw generateParseException(ex); - } - } - - /* TOKENIZATION FUNCTION */ - - @Override - public Token[] tokenize(final String expr) throws ParseException { - ADQLParser201TokenManager parser = new ADQLParser201TokenManager(new SimpleCharStream(new java.io.ByteArrayInputStream(expr.getBytes()))); - try { - ArrayList<Token> tokens = new ArrayList<Token>(); - Token token; - while(!isEnd((token = parser.getNextToken()))) { - tokens.add(token); - } - return tokens.toArray(new Token[tokens.size()]); - } catch(TokenMgrError err) { - // wrap such errors and propagate them: - throw new ParseException(err); - } - } - - /* CORRECTION SUGGESTION */ - - /** - * Try fixing tokens/terms of the input ADQL query. - * - * <p> - * <b>This function does not try to fix syntactical or semantical errors.</b> - * It just try to fix the most common issues in ADQL queries, such as: - * </p> - * <ul> - * <li>some Unicode characters confusable with ASCII characters (like a - * space, a dash, ...) ; this function replace them by their ASCII - * alternative,</li> - * <li>any of the following are double quoted: - * <ul> - * <li>non regular ADQL identifiers - * (e.g. <code>_RAJ2000</code>),</li> - * <li>ADQL function names used as identifiers - * (e.g. <code>distance</code>)</li> - * <li>and SQL reserved keywords - * (e.g. <code>public</code>).</li> - * </ul> - * </li> - * </ul> - * - * <p><i><b>Note 1:</b> - * The given stream is NOT closed by this function even if the EOF is - * reached. It is the responsibility of the caller to close it. - * </i></p> - * - * <p><i><b>Note 2:</b> - * This function does not use any instance variable of this parser - * (especially the InputStream or Reader provided at initialisation or - * ReInit). - * </i></p> - * - * @param input Stream containing the input ADQL query to fix. - * - * @return The suggested correction of the input ADQL query. - * - * @throws java.io.IOException If there is any error while reading from the - * given input stream. - * @throws ParseException If any unrecognised character is encountered, - * or if anything else prevented the tokenization - * of some characters/words/terms. - * - * @see #tryQuickFix(java.lang.String) - * - * @since 1.5 - */ - @Override - public final String tryQuickFix(final java.io.InputStream input) throws java.io.IOException, ParseException { - // Fetch everything into a single string: - StringBuffer buf = new StringBuffer(); - byte[] cBuf = new byte[1024]; - int nbChar; - while((nbChar = input.read(cBuf)) > -1) { - buf.append(new String(cBuf, 0, nbChar)); - } - - // Convert the buffer into a String and now try to fix it: - return tryQuickFix(buf.toString()); - } - - /** - * Try fixing tokens/terms of the given ADQL query. - * - * <p> - * <b>This function does not try to fix syntactical or semantical errors.</b> - * It just try to fix the most common issues in ADQL queries, such as: - * </p> - * <ul> - * <li>some Unicode characters confusable with ASCII characters (like a - * space, a dash, ...) ; this function replace them by their ASCII - * alternative,</li> - * <li>any of the following are double quoted: - * <ul> - * <li>non regular ADQL identifiers - * (e.g. <code>_RAJ2000</code>),</li> - * <li>ADQL function names used as identifiers - * (e.g. <code>distance</code>)</li> - * <li>and SQL reserved keywords - * (e.g. <code>public</code>).</li> - * </ul> - * </li> - * </ul> - * - * <p><i><b>Note:</b> - * This function does not use any instance variable of this parser - * (especially the InputStream or Reader provided at initialisation or - * ReInit). - * </i></p> - * - * @param adqlQuery The input ADQL query to fix. - * - * @return The suggested correction of the given ADQL query. - * - * @throws ParseException If any unrecognised character is encountered, - * or if anything else prevented the tokenization - * of some characters/words/terms. - * - * @since 1.5 - */ - @Override - public String tryQuickFix(String adqlQuery) throws ParseException { - StringBuffer suggestedQuery = new StringBuffer(); - - // 1. Replace all Unicode confusable characters: - adqlQuery = replaceUnicodeConfusables(adqlQuery); - - /* 1.bis. Normalise new lines and tabulations - * (to simplify the column counting): */ - adqlQuery = adqlQuery.replaceAll("(\u005cr\u005cn|\u005cr|\u005cn)", System.getProperty("line.separator")).replaceAll("\u005ct", " "); - - // 2. Analyse the query token by token: - ADQLParser201TokenManager parser = new ADQLParser201TokenManager(new SimpleCharStream(new java.io.ByteArrayInputStream(adqlQuery.getBytes()))); - - final String[] lines = adqlQuery.split(System.getProperty("line.separator")); - - try { - String suggestedToken; - int lastLine = 1, lastCol = 1; - - Token token = null, nextToken = parser.getNextToken(); - // for all tokens until the EOF or EOQ: - do { - // get the next token: - token = nextToken; - nextToken = (isEnd(token) ? null : parser.getNextToken()); - - // 3. Double quote any suspect token: - if (mustEscape(token, nextToken)) { - suggestedToken = "\u005c"" + token.image + "\u005c""; - } else - suggestedToken = token.image; - - /* 4. Append all space characters (and comments) before the - * token: */ - /* same line, just get the space characters between the last - * token and the one to append: */ - if (lastLine == token.beginLine) { - if (token.kind == ADQLParser201Constants.EOF) - suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1)); - else - suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1, token.beginColumn - (isEnd(token) ? 0 : 1))); - lastCol = token.endColumn + 1; - } - // not the same line... - else { - /* append all remaining space characters until the position - * of the token to append: */ - do { - suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1)).append('\u005cn'); - lastLine++; - lastCol = 1; - } while(lastLine < token.beginLine); - /* if there are still space characters before the token, - * append them as well: */ - if (lastCol < token.beginColumn) - suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1, token.beginColumn - 1)); - // finally, set the correct column position: - lastCol = token.endColumn + 1; - } - - // 5. Append the suggested token: - suggestedQuery.append(suggestedToken); - - } while(!isEnd(token)); - - } catch(TokenMgrError err) { - // wrap such errors and propagate them: - throw new ParseException(err); - } - - return suggestedQuery.toString(); - } - - /** - * All of the most common Unicode confusable characters and their - * ASCII/UTF-8 alternative. - * - * <p> - * Keys of this map represent the ASCII character while the values are the - * regular expression for all possible Unicode alternatives. - * </p> - * - * <p><i><b>Note:</b> - * All of them have been listed using - * <a href="https://unicode.org/cldr/utility/confusables.jsp">Unicode Utilities: Confusables</a>. - * </i></p> - * - * @since 1.5 - */ - protected final static java.util.Map<String, String> REGEX_UNICODE_CONFUSABLES = new java.util.HashMap<String, String>(10); - /** Regular expression matching all Unicode alternatives for <code>-</code>. - * @since 1.5 */ - protected final static String REGEX_DASH = "[-\u02d7\u06d4\u2010\u2011\u2012\u2013\u2043\u2212\u2796\u2cba\ufe58\u2014\u2015\u207b\u208b\u0096\u058a\ufe63\uff0d]"; - /** Regular expression matching all Unicode alternatives for <code>_</code>. - * @since 1.5 */ - protected final static String REGEX_UNDERSCORE = "[_\u07fa\ufe4d\ufe4e\ufe4f]"; - /** Regular expression matching all Unicode alternatives for <code>'</code>. - * @since 1.5 */ - protected final static String REGEX_QUOTE = "['`\u00b4\u02b9\u02bb\u02bc\u02bd\u02be\u02c8\u02ca\u02cb\u02f4\u0374\u0384\u055a\u055d\u05d9\u05f3\u07f4\u07f5\u144a\u16cc\u1fbd\u1fbf\u1fef\u1ffd\u1ffe\u2018\u2019\u201b\u2032\u2035\ua78c\uff07\uff40]"; - /** Regular expression matching all Unicode alternatives for <code>"</code>. - * @since 1.5 */ - protected final static String REGEX_DOUBLE_QUOTE = "[\u02ba\u02dd\u02ee\u02f6\u05f2\u05f4\u1cd3\u201c\u201d\u201f\u2033\u2036\u3003\uff02]"; - /** Regular expression matching all Unicode alternatives for <code>.</code>. - * @since 1.5 */ - protected final static String REGEX_STOP = "[.\u0660\u06f0\u0701\u0702\u2024\ua4f8\ua60e]"; - /** Regular expression matching all Unicode alternatives for <code>+</code>. - * @since 1.5 */ - protected final static String REGEX_PLUS = "[+\u16ed\u2795]"; - /** Regular expression matching all Unicode alternatives for <code> </code>. - * @since 1.5 */ - protected final static String REGEX_SPACE = "[ \u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f]"; - /** Regular expression matching all Unicode alternatives for <code><</code>. - * @since 1.5 */ - protected final static String REGEX_LESS_THAN = "[<\u02c2\u1438\u16b2\u2039\u276e]"; - /** Regular expression matching all Unicode alternatives for <code>></code>. - * @since 1.5 */ - protected final static String REGEX_GREATER_THAN = "[>\u02c3\u1433\u203a\u276f]"; - /** Regular expression matching all Unicode alternatives for <code>=</code>. - * @since 1.5 */ - protected final static String REGEX_EQUAL = "[=\u1400\u2e40\u30a0\ua4ff]"; - static { - REGEX_UNICODE_CONFUSABLES.put("-", REGEX_DASH); - REGEX_UNICODE_CONFUSABLES.put("_", REGEX_UNDERSCORE); - REGEX_UNICODE_CONFUSABLES.put("'", REGEX_QUOTE); - REGEX_UNICODE_CONFUSABLES.put("\u005c"", REGEX_DOUBLE_QUOTE); - REGEX_UNICODE_CONFUSABLES.put(".", REGEX_STOP); - REGEX_UNICODE_CONFUSABLES.put("+", REGEX_PLUS); - REGEX_UNICODE_CONFUSABLES.put(" ", REGEX_SPACE); - REGEX_UNICODE_CONFUSABLES.put("<", REGEX_LESS_THAN); - REGEX_UNICODE_CONFUSABLES.put(">", REGEX_GREATER_THAN); - REGEX_UNICODE_CONFUSABLES.put("=", REGEX_EQUAL); - } - - /** - * Replace all Unicode characters that can be confused with other ASCI/UTF-8 - * characters (e.g. different spaces, dashes, ...) in their ASCII version. - * - * @param adqlQuery The ADQL query string in which Unicode confusable - * characters must be replaced. - * - * @return The same query without the most common Unicode confusable - * characters. - * - * @since 1.5 - */ - protected String replaceUnicodeConfusables(final String adqlQuery) { - String newAdqlQuery = adqlQuery; - for(java.util.Map.Entry<String, String> confusable : REGEX_UNICODE_CONFUSABLES.entrySet()) - newAdqlQuery = newAdqlQuery.replaceAll(confusable.getValue(), confusable.getKey()); - return newAdqlQuery; - } - - /** - * Tell whether the given token represents the end of an ADQL query. - * - * @param token Token to analyze. - * - * @return <code>true</code> if the given token represents a query end, - * <code>false</code> otherwise. - * - * @since 1.5 - */ - protected boolean isEnd(final Token token) { - return token.kind == ADQLParser201Constants.EOF || token.kind == ADQLParser201Constants.EOQ; - } - - /** - * Tell whether the given token must be double quoted. - * - * <p> - * This function considers all the following as terms to double quote: - * </p> - * <ul> - * <li>SQL reserved keywords</li>, - * <li>unrecognised regular identifiers (e.g. neither a delimited nor a - * valid ADQL regular identifier)</li> - * <li>and ADQL function name without a parameters list.</li> - * </ul> - * - * @param token The token to analyze. - * @param nextToken The following token. (useful to detect the start of a - * function's parameters list) - * - * @return <code>true</code> if the given token must be double quoted, - * <code>false</code> to keep it as provided. - * - * @since 1.5 - */ - protected boolean mustEscape(final Token token, final Token nextToken) { - switch(token.kind) { - case ADQLParser201Constants.SQL_RESERVED_WORD: - return true; - case ADQLParser201Constants.REGULAR_IDENTIFIER_CANDIDATE: - return !isRegularIdentifier(token.image); - default: - return token.isFunctionName && (nextToken == null || nextToken.kind != ADQLParser201Constants.LEFT_PAR); - } - } - - /* ########## */ - /* # SYNTAX # */ - /* ########## */ - - /* ******************* */ - /* GENERAL ADQL SYNTAX */ - /* ******************* */ - /** - * Parses the ADQL query given at the parser creation or in the {@link ADQLParser201#ReInit(java.io.InputStream)} - * or in the <i>parseQuery</i> functions. - * - * @return The object representation of the query. - * @throws ParseException If the query syntax is incorrect. - */ - final public ADQLQuery Query() throws ParseException { - trace_call("Query"); - try { - ADQLQuery q = null; - q = QueryExpression(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case 0: { - jj_consume_token(0); - break; - } - case EOQ: { - jj_consume_token(EOQ); - break; - } - default: - jj_la1[0] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - /* check the optional features before any other check: - * (note: this check is very close to grammar check...hence its higher - * priority) */ - UnresolvedIdentifiersException exUnsupportedFeatures = new UnresolvedIdentifiersException("unsupported expression"); - SearchOptionalFeaturesHandler sFeaturesHandler = new SearchOptionalFeaturesHandler(true, false); - sFeaturesHandler.search(q); - for(ADQLObject obj : sFeaturesHandler) { - if (!supportedFeatures.isSupporting(obj.getFeatureDescription())) - exUnsupportedFeatures.addException(new UnsupportedFeatureException(obj)); - } - if (exUnsupportedFeatures.getNbErrors() > 0) { - if (true) - throw exUnsupportedFeatures; - } - - // check the query: - if (queryChecker != null) - queryChecker.check(q); - - { - if ("" != null) - return q; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("Query"); - } - } - - final public ADQLQuery QueryExpression() throws ParseException { - trace_call("QueryExpression"); - try { - TextPosition endPos = null; - try { - // create the query: - query = queryFactory.createQuery(ADQLVersion.V2_1); - stackQuery.push(query); - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - Select(); - From(); - endPos = query.getFrom().getPosition(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case WHERE: { - Where(); - endPos = query.getWhere().getPosition(); - break; - } - default: - jj_la1[1] = jj_gen; - ; - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case GROUP: { - GroupBy(); - endPos = query.getGroupBy().getPosition(); - break; - } - default: - jj_la1[2] = jj_gen; - ; - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case HAVING: { - Having(); - endPos = query.getHaving().getPosition(); - break; - } - default: - jj_la1[3] = jj_gen; - ; - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ORDER: { - OrderBy(); - endPos = query.getOrderBy().getPosition(); - break; - } - default: - jj_la1[4] = jj_gen; - ; - } - // set the position of the query: - query.setPosition(new TextPosition(query.getSelect().getPosition(), endPos)); - - // get the previous query (!= null if the current query is a sub-query): - ADQLQuery previousQuery = stackQuery.pop(); - if (stackQuery.isEmpty()) - query = null; - else - query = stackQuery.peek(); - - { - if ("" != null) - return previousQuery; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("QueryExpression"); - } - } - - final public ADQLQuery SubQueryExpression() throws ParseException { - trace_call("SubQueryExpression"); - try { - ADQLQuery q = null; - Token start, end; - start = jj_consume_token(LEFT_PAR); - q = QueryExpression(); - end = jj_consume_token(RIGHT_PAR); - q.setPosition(new TextPosition(start, end)); - { - if ("" != null) - return q; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("SubQueryExpression"); - } - } - - final public void Select() throws ParseException { - trace_call("Select"); - try { - ClauseSelect select = query.getSelect(); - SelectItem item = null; - Token start, t = null; - start = jj_consume_token(SELECT); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case QUANTIFIER: { - t = jj_consume_token(QUANTIFIER); - select.setDistinctColumns(t.image.equalsIgnoreCase("DISTINCT")); - break; - } - default: - jj_la1[5] = jj_gen; - ; - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case TOP: { - jj_consume_token(TOP); - t = jj_consume_token(UNSIGNED_INTEGER); - try { - select.setLimit(Integer.parseInt(t.image)); - } catch(NumberFormatException nfe) { - { - if (true) - throw new ParseException("[l." + t.beginLine + ";c." + t.beginColumn + "] The TOP limit (\u005c"" + t.image + "\u005c") isn't a regular unsigned integer !"); - } - } - break; - } - default: - jj_la1[6] = jj_gen; - ; - } - item = SelectItem(); - select.add(item); - label_1: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[7] = jj_gen; - break label_1; - } - jj_consume_token(COMMA); - item = SelectItem(); - select.add(item); - } - TextPosition lastItemPos = query.getSelect().get(query.getSelect().size() - 1).getPosition(); - select.setPosition(new TextPosition(start.beginLine, start.beginColumn, lastItemPos.endLine, lastItemPos.endColumn)); - } finally { - trace_return("Select"); - } - } - - final public SelectItem SelectItem() throws ParseException { - trace_call("SelectItem"); - try { - IdentifierItems identifiers = new IdentifierItems(true); - IdentifierItem id = null, label = null; - ADQLOperand op = null; - SelectItem item; - Token starToken; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASTERISK: { - starToken = jj_consume_token(ASTERISK); - item = new SelectAllColumns(query); - item.setPosition(new TextPosition(starToken)); - { - if ("" != null) - return item; - } - break; - } - default: - jj_la1[12] = jj_gen; - if (jj_2_1(7)) { - id = Identifier(); - jj_consume_token(DOT); - identifiers.append(id); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - id = Identifier(); - jj_consume_token(DOT); - identifiers.append(id); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - id = Identifier(); - jj_consume_token(DOT); - identifiers.append(id); - break; - } - default: - jj_la1[8] = jj_gen; - ; - } - break; - } - default: - jj_la1[9] = jj_gen; - ; - } - starToken = jj_consume_token(ASTERISK); - try { - item = new SelectAllColumns(queryFactory.createTable(identifiers, null)); - TextPosition firstPos = identifiers.get(0).position; - item.setPosition(new TextPosition(firstPos.beginLine, firstPos.beginColumn, starToken.endLine, (starToken.endColumn < 0) ? -1 : (starToken.endColumn + 1))); - { - if ("" != null) - return item; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: - case PLUS: - case MINUS: - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: - case BOX: - case CENTROID: - case CIRCLE: - case POINT: - case POLYGON: - case CONTAINS: - case INTERSECTS: - case AREA: - case COORD1: - case COORD2: - case COORDSYS: - case DISTANCE: - case LOWER: - case ABS: - case CEILING: - case DEGREES: - case EXP: - case FLOOR: - case LOG: - case LOG10: - case MOD: - case PI: - case POWER: - case RADIANS: - case RAND: - case ROUND: - case SQRT: - case TRUNCATE: - case ACOS: - case ASIN: - case ATAN: - case ATAN2: - case COS: - case COT: - case SIN: - case TAN: - case STRING_LITERAL: - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - op = ValueExpression(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AS: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AS: { - jj_consume_token(AS); - break; - } - default: - jj_la1[10] = jj_gen; - ; - } - label = Identifier(); - break; - } - default: - jj_la1[11] = jj_gen; - ; - } - break; - } - default: - jj_la1[13] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - try { - item = queryFactory.createSelectItem(op, (label == null) ? null : label.identifier); - if (label != null) { - item.setCaseSensitive(label.caseSensitivity); - item.setPosition(new TextPosition(op.getPosition(), label.position)); - } else - item.setPosition(new TextPosition(op.getPosition())); - { - if ("" != null) - return item; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("SelectItem"); - } - } - - final public void From() throws ParseException { - trace_call("From"); - try { - FromContent content = null, content2 = null; - try { - jj_consume_token(FROM); - content = TableRef(); - label_2: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[14] = jj_gen; - break label_2; - } - jj_consume_token(COMMA); - content2 = TableRef(); - TextPosition startPos = content.getPosition(), endPos = content2.getPosition(); - content = queryFactory.createJoin(JoinType.CROSS, content, content2); - content.setPosition(new TextPosition(startPos, endPos)); - } - query.setFrom(content); - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - } finally { - trace_return("From"); - } - } - - final public void Where() throws ParseException { - trace_call("Where"); - try { - ClauseConstraints where = query.getWhere(); - ADQLConstraint condition; - Token start; - start = jj_consume_token(WHERE); - ConditionsList(where); - TextPosition endPosition = where.getPosition(); - where.setPosition(new TextPosition(start.beginLine, start.beginColumn, endPosition.endLine, endPosition.endColumn)); - } finally { - trace_return("Where"); - } - } - - final public void GroupBy() throws ParseException { - trace_call("GroupBy"); - try { - ClauseADQL<ADQLColumn> groupBy = query.getGroupBy(); - ADQLColumn colRef = null; - Token start; - start = jj_consume_token(GROUP); - jj_consume_token(BY); - colRef = Column(); - groupBy.add(colRef); - label_3: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[15] = jj_gen; - break label_3; - } - jj_consume_token(COMMA); - colRef = Column(); - groupBy.add(colRef); - } - groupBy.setPosition(new TextPosition(start.beginLine, start.beginColumn, colRef.getPosition().endLine, colRef.getPosition().endColumn)); - } finally { - trace_return("GroupBy"); - } - } - - final public void Having() throws ParseException { - trace_call("Having"); - try { - ClauseConstraints having = query.getHaving(); - Token start; - start = jj_consume_token(HAVING); - ConditionsList(having); - TextPosition endPosition = having.getPosition(); - having.setPosition(new TextPosition(start.beginLine, start.beginColumn, endPosition.endLine, endPosition.endColumn)); - } finally { - trace_return("Having"); - } - } - - final public void OrderBy() throws ParseException { - trace_call("OrderBy"); - try { - ClauseADQL<ADQLOrder> orderBy = query.getOrderBy(); - ADQLOrder order = null; - Token start; - start = jj_consume_token(ORDER); - jj_consume_token(BY); - order = OrderItem(); - orderBy.add(order); - label_4: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[16] = jj_gen; - break label_4; - } - jj_consume_token(COMMA); - order = OrderItem(); - orderBy.add(order); - } - orderBy.setPosition(new TextPosition(start, token)); - } finally { - trace_return("OrderBy"); - } - } - - /* *************************** */ - /* COLUMN AND TABLE REFERENCES */ - /* *************************** */ - final public IdentifierItem Identifier() throws ParseException { - trace_call("Identifier"); - try { - Token t; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case REGULAR_IDENTIFIER_CANDIDATE: { - t = jj_consume_token(REGULAR_IDENTIFIER_CANDIDATE); - testRegularIdentifier(t); - { - if ("" != null) - return new IdentifierItem(t, false); - } - break; - } - case DELIMITED_IDENTIFIER: { - t = jj_consume_token(DELIMITED_IDENTIFIER); - { - if ("" != null) - return new IdentifierItem(t, true); - } - break; - } - default: - jj_la1[17] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("Identifier"); - } - } - - /** - * Extracts the name of a table with its possible catalog and schema prefixes. - * - * @return A {@link IdentifierItems} which contains at most three items: catalogName, schemaName and tableName. - */ - final public IdentifierItems TableName() throws ParseException { - trace_call("TableName"); - try { - IdentifierItems identifiers = new IdentifierItems(true); - IdentifierItem id = null; - id = Identifier(); - identifiers.append(id); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DOT: { - jj_consume_token(DOT); - id = Identifier(); - identifiers.append(id); - break; - } - default: - jj_la1[18] = jj_gen; - ; - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DOT: { - jj_consume_token(DOT); - id = Identifier(); - identifiers.append(id); - break; - } - default: - jj_la1[19] = jj_gen; - ; - } - { - if ("" != null) - return identifiers; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("TableName"); - } - } - - /** - * Extracts the name of a column with its possible catalog, schema and table prefixes. - * - * @return A {@link IdentifierItems} which contains at most four items: catalogName, schemaName, tableName and columnName. - */ - final public IdentifierItems ColumnName() throws ParseException { - trace_call("ColumnName"); - try { - IdentifierItem id; - IdentifierItems table = null, identifiers = new IdentifierItems(false); - id = Identifier(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DOT: { - jj_consume_token(DOT); - table = TableName(); - break; - } - default: - jj_la1[20] = jj_gen; - ; - } - identifiers.append(id); - if (table != null) { - for(int i = 0; i < table.size(); i++) - identifiers.append(table.get(i)); - } - { - if ("" != null) - return identifiers; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("ColumnName"); - } - } - - final public ADQLColumn Column() throws ParseException { - trace_call("Column"); - try { - IdentifierItems identifiers; - identifiers = ColumnName(); - try { - { - if ("" != null) - return queryFactory.createColumn(identifiers); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("Column"); - } - } - - final public ADQLOrder OrderItem() throws ParseException { - trace_call("OrderItem"); - try { - IdentifierItem identifier = null; - Token ind = null, desc = null; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - identifier = Identifier(); - break; - } - case UNSIGNED_INTEGER: { - ind = jj_consume_token(UNSIGNED_INTEGER); - break; - } - default: - jj_la1[21] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASC: - case DESC: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASC: { - jj_consume_token(ASC); - break; - } - case DESC: { - desc = jj_consume_token(DESC); - break; - } - default: - jj_la1[22] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[23] = jj_gen; - ; - } - try { - ADQLOrder order = null; - if (identifier != null) { - order = queryFactory.createOrder(identifier, desc != null); - order.setPosition(identifier.position); - } else { - order = queryFactory.createOrder(Integer.parseInt(ind.image), desc != null); - order.setPosition(new TextPosition(ind)); - } - { - if ("" != null) - return order; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("OrderItem"); - } - } - - final public FromContent SimpleTableRef() throws ParseException { - trace_call("SimpleTableRef"); - try { - IdentifierItem alias = null; - IdentifierItems identifiers = null; - ADQLQuery subQuery = null; - FromContent content = null; - Token start, end; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - identifiers = TableName(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AS: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AS: { - jj_consume_token(AS); - break; - } - default: - jj_la1[24] = jj_gen; - ; - } - alias = Identifier(); - break; - } - default: - jj_la1[25] = jj_gen; - ; - } - content = queryFactory.createTable(identifiers, alias); - if (alias == null) - content.setPosition(new TextPosition(identifiers.get(0).position, identifiers.get(identifiers.size() - 1).position)); - else - content.setPosition(new TextPosition(identifiers.get(0).position, alias.position)); - { - if ("" != null) - return content; - } - break; - } - default: - jj_la1[27] = jj_gen; - if (jj_2_2(2)) { - subQuery = SubQueryExpression(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AS: { - jj_consume_token(AS); - break; - } - default: - jj_la1[26] = jj_gen; - ; - } - alias = Identifier(); - content = queryFactory.createTable(subQuery, alias); - if (alias == null) - content.setPosition(new TextPosition(subQuery.getPosition())); - else - content.setPosition(new TextPosition(subQuery.getPosition(), alias.position)); - { - if ("" != null) - return content; - } - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: { - start = jj_consume_token(LEFT_PAR); - content = JoinedTable(); - end = jj_consume_token(RIGHT_PAR); - content.setPosition(new TextPosition(start, end)); - { - if ("" != null) - return content; - } - break; - } - default: - jj_la1[28] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("SimpleTableRef"); - } - } - - final public FromContent TableRef() throws ParseException { - trace_call("TableRef"); - try { - FromContent content; - content = SimpleTableRef(); - label_5: while(true) { - if (jj_2_3(2)) { - ; - } else { - break label_5; - } - content = JoinSpecification(content); - } - { - if ("" != null) - return content; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("TableRef"); - } - } - - final public FromContent JoinedTable() throws ParseException { - trace_call("JoinedTable"); - try { - FromContent content; - content = SimpleTableRef(); - label_6: while(true) { - content = JoinSpecification(content); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NATURAL: - case INNER: - case RIGHT: - case LEFT: - case FULL: - case JOIN: { - ; - break; - } - default: - jj_la1[29] = jj_gen; - break label_6; - } - } - { - if ("" != null) - return content; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("JoinedTable"); - } - } - - final public ADQLJoin JoinSpecification(FromContent leftTable) throws ParseException { - trace_call("JoinSpecification"); - try { - boolean natural = false; - JoinType type = JoinType.INNER; - ClauseConstraints condition = new ClauseConstraints("ON"); - ArrayList<ADQLColumn> lstColumns = new ArrayList<ADQLColumn>(); - IdentifierItem id; - FromContent rightTable; - ADQLJoin join; - Token lastPar; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NATURAL: { - jj_consume_token(NATURAL); - natural = true; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case INNER: - case RIGHT: - case LEFT: - case FULL: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case INNER: { - jj_consume_token(INNER); - break; - } - case RIGHT: - case LEFT: - case FULL: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT: { - jj_consume_token(LEFT); - type = JoinType.OUTER_LEFT; - break; - } - case RIGHT: { - jj_consume_token(RIGHT); - type = JoinType.OUTER_RIGHT; - break; - } - case FULL: { - jj_consume_token(FULL); - type = JoinType.OUTER_FULL; - break; - } - default: - jj_la1[30] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case OUTER: { - jj_consume_token(OUTER); - break; - } - default: - jj_la1[31] = jj_gen; - ; - } - break; - } - default: - jj_la1[32] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[33] = jj_gen; - ; - } - jj_consume_token(JOIN); - rightTable = SimpleTableRef(); - join = queryFactory.createJoin(type, leftTable, rightTable); - join.setPosition(new TextPosition(leftTable.getPosition(), rightTable.getPosition())); - { - if ("" != null) - return join; - } - break; - } - case INNER: - case RIGHT: - case LEFT: - case FULL: - case JOIN: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case INNER: - case RIGHT: - case LEFT: - case FULL: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case INNER: { - jj_consume_token(INNER); - break; - } - case RIGHT: - case LEFT: - case FULL: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT: { - jj_consume_token(LEFT); - type = JoinType.OUTER_LEFT; - break; - } - case RIGHT: { - jj_consume_token(RIGHT); - type = JoinType.OUTER_RIGHT; - break; - } - case FULL: { - jj_consume_token(FULL); - type = JoinType.OUTER_FULL; - break; - } - default: - jj_la1[34] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case OUTER: { - jj_consume_token(OUTER); - break; - } - default: - jj_la1[35] = jj_gen; - ; - } - break; - } - default: - jj_la1[36] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[37] = jj_gen; - ; - } - jj_consume_token(JOIN); - rightTable = SimpleTableRef(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ON: { - jj_consume_token(ON); - ConditionsList(condition); - join = queryFactory.createJoin(type, leftTable, rightTable, condition); - join.setPosition(new TextPosition(leftTable.getPosition(), condition.getPosition())); - { - if ("" != null) - return join; - } - break; - } - case USING: { - jj_consume_token(USING); - jj_consume_token(LEFT_PAR); - id = Identifier(); - lstColumns.add(queryFactory.createColumn(id)); - label_7: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[38] = jj_gen; - break label_7; - } - jj_consume_token(COMMA); - id = Identifier(); - lstColumns.add(queryFactory.createColumn(id)); - } - lastPar = jj_consume_token(RIGHT_PAR); - join = queryFactory.createJoin(type, leftTable, rightTable, lstColumns); - join.setPosition(new TextPosition(leftTable.getPosition().beginLine, leftTable.getPosition().beginColumn, lastPar.endLine, (lastPar.endColumn < 0) ? -1 : (lastPar.endColumn + 1))); - { - if ("" != null) - return join; - } - break; - } - default: - jj_la1[39] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[40] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("JoinSpecification"); - } - } - - /* ****** */ - /* STRING */ - /* ****** */ - final public StringConstant String() throws ParseException { - trace_call("String"); - try { - Token t, start = null; - String str = ""; - StringConstant cst; - label_8: while(true) { - t = jj_consume_token(STRING_LITERAL); - str += t.image.substring(1, t.image.length() - 1).replaceAll("''", "'"); - if (start == null) - start = t; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case STRING_LITERAL: { - ; - break; - } - default: - jj_la1[41] = jj_gen; - break label_8; - } - } - try { - cst = queryFactory.createStringConstant(str); - cst.setPosition(new TextPosition(start, t)); - { - if ("" != null) - return cst; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("String"); - } - } - - /* ************* */ - /* NUMERIC TYPES */ - /* ************* */ - final public NumericConstant UnsignedNumeric() throws ParseException { - trace_call("UnsignedNumeric"); - try { - Token t; - NumericConstant cst; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case SCIENTIFIC_NUMBER: { - t = jj_consume_token(SCIENTIFIC_NUMBER); - break; - } - case UNSIGNED_FLOAT: { - t = jj_consume_token(UNSIGNED_FLOAT); - break; - } - case UNSIGNED_INTEGER: { - t = jj_consume_token(UNSIGNED_INTEGER); - break; - } - default: - jj_la1[42] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - try { - cst = queryFactory.createNumericConstant(t.image); - cst.setPosition(new TextPosition(t)); - { - if ("" != null) - return cst; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("UnsignedNumeric"); - } - } - - final public NumericConstant UnsignedFloat() throws ParseException { - trace_call("UnsignedFloat"); - try { - Token t; - NumericConstant cst; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case UNSIGNED_INTEGER: { - t = jj_consume_token(UNSIGNED_INTEGER); - break; - } - case UNSIGNED_FLOAT: { - t = jj_consume_token(UNSIGNED_FLOAT); - break; - } - default: - jj_la1[43] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - try { - cst = queryFactory.createNumericConstant(t.image); - cst.setPosition(new TextPosition(t)); - { - if ("" != null) - return cst; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("UnsignedFloat"); - } - } - - final public NumericConstant SignedInteger() throws ParseException { - trace_call("SignedInteger"); - try { - Token sign = null, number; - NumericConstant cst; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case PLUS: - case MINUS: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case PLUS: { - sign = jj_consume_token(PLUS); - break; - } - case MINUS: { - sign = jj_consume_token(MINUS); - break; - } - default: - jj_la1[44] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[45] = jj_gen; - ; - } - number = jj_consume_token(UNSIGNED_INTEGER); - try { - if (sign == null) { - cst = queryFactory.createNumericConstant(number.image); - cst.setPosition(new TextPosition(number)); - } else { - cst = queryFactory.createNumericConstant(sign.image + number.image); - cst.setPosition(new TextPosition(sign, number)); - } - { - if ("" != null) - return cst; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("SignedInteger"); - } - } - - /* *********** */ - /* EXPRESSIONS */ - /* *********** */ - final public ADQLOperand NumericValueExpressionPrimary() throws ParseException { - trace_call("NumericValueExpressionPrimary"); - try { - ADQLColumn column; - ADQLOperand op; - Token left, right; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: { - // unsigned_value_specification - op = UnsignedNumeric(); - { - if ("" != null) - return op; - } - break; - } - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - column = Column(); - column.setExpectedType('N'); - { - if ("" != null) - return column; - } - break; - } - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: { - op = SqlFunction(); - { - if ("" != null) - return op; - } - break; - } - case LEFT_PAR: { - left = jj_consume_token(LEFT_PAR); - op = NumericExpression(); - right = jj_consume_token(RIGHT_PAR); - WrappedOperand wop = queryFactory.createWrappedOperand(op); - wop.setPosition(new TextPosition(left, right)); - { - if ("" != null) - return wop; - } - break; - } - default: - jj_la1[46] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("NumericValueExpressionPrimary"); - } - } - - final public ADQLOperand StringValueExpressionPrimary() throws ParseException { - trace_call("StringValueExpressionPrimary"); - try { - StringConstant expr; - ADQLColumn column; - ADQLOperand op; - Token left, right; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case STRING_LITERAL: { - // string - expr = String(); - { - if ("" != null) - return expr; - } - break; - } - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: { - op = UnsignedNumeric(); - { - if ("" != null) - return op; - } - break; - } - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: { - op = SqlFunction(); - { - if ("" != null) - return op; - } - break; - } - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - column = Column(); - column.setExpectedType('*'); - { - if ("" != null) - return column; - } - break; - } - case LEFT_PAR: { - left = jj_consume_token(LEFT_PAR); - op = ValueExpression(); - right = jj_consume_token(RIGHT_PAR); - WrappedOperand wop = queryFactory.createWrappedOperand(op); - wop.setPosition(new TextPosition(left, right)); - { - if ("" != null) - return wop; - } - break; - } - default: - jj_la1[47] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("StringValueExpressionPrimary"); - } - } - - final public ADQLOperand ValueExpression() throws ParseException { - trace_call("ValueExpression"); - try { - ADQLOperand valueExpr = null; - Token left, right; - try { - if (jj_2_4(2147483647)) { - valueExpr = NumericExpression(); - } else if (jj_2_5(2147483647)) { - valueExpr = StringExpression(); - } else if (jj_2_6(2147483647)) { - left = jj_consume_token(LEFT_PAR); - valueExpr = ValueExpression(); - right = jj_consume_token(RIGHT_PAR); - valueExpr = queryFactory.createWrappedOperand(valueExpr); - ((WrappedOperand)valueExpr).setPosition(new TextPosition(left, right)); - } else if (jj_2_7(2147483647)) { - valueExpr = UserDefinedFunction(); - } else if (jj_2_8(2)) { - valueExpr = GeometryValueFunction(); - } else if (jj_2_9(2147483647)) { - valueExpr = Column(); - } else if (jj_2_10(2147483647)) { - valueExpr = StringFactor(); - } else if (jj_2_11(3)) { - valueExpr = Factor(); - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - valueExpr = Column(); - break; - } - default: - jj_la1[48] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if ("" != null) - return valueExpr; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("ValueExpression"); - } - } - - final public ADQLOperand NumericExpression() throws ParseException { - trace_call("NumericExpression"); - try { - Token sign = null; - ADQLOperand leftOp, rightOp = null; - leftOp = NumericTerm(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case PLUS: - case MINUS: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case PLUS: { - sign = jj_consume_token(PLUS); - break; - } - case MINUS: { - sign = jj_consume_token(MINUS); - break; - } - default: - jj_la1[49] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - rightOp = NumericExpression(); - break; - } - default: - jj_la1[50] = jj_gen; - ; - } - if (sign == null) { - if ("" != null) - return leftOp; - } else { - try { - Operation operation = queryFactory.createOperation(leftOp, OperationType.getOperator(sign.image), rightOp); - operation.setPosition(new TextPosition(leftOp.getPosition(), rightOp.getPosition())); - { - if ("" != null) - return operation; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("NumericExpression"); - } - } - - final public ADQLOperand NumericTerm() throws ParseException { - trace_call("NumericTerm"); - try { - Token sign = null; - ADQLOperand leftOp, rightOp = null; - leftOp = Factor(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASTERISK: - case DIVIDE: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASTERISK: { - sign = jj_consume_token(ASTERISK); - break; - } - case DIVIDE: { - sign = jj_consume_token(DIVIDE); - break; - } - default: - jj_la1[51] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - rightOp = NumericTerm(); - break; - } - default: - jj_la1[52] = jj_gen; - ; - } - if (sign == null) { - if ("" != null) - return leftOp; - } else { - try { - Operation operation = queryFactory.createOperation(leftOp, OperationType.getOperator(sign.image), rightOp); - operation.setPosition(new TextPosition(leftOp.getPosition(), rightOp.getPosition())); - { - if ("" != null) - return operation; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("NumericTerm"); - } - } - - final public ADQLOperand Factor() throws ParseException { - trace_call("Factor"); - try { - boolean negative = false; - Token minusSign = null; - ADQLOperand op; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case PLUS: - case MINUS: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case PLUS: { - jj_consume_token(PLUS); - break; - } - case MINUS: { - minusSign = jj_consume_token(MINUS); - negative = true; - break; - } - default: - jj_la1[53] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - } - default: - jj_la1[54] = jj_gen; - ; - } - if (jj_2_12(2)) { - op = NumericFunction(); - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - op = NumericValueExpressionPrimary(); - break; - } - default: - jj_la1[55] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - if (negative) { - try { - TextPosition position = op.getPosition(); - op = queryFactory.createNegativeOperand(op); - NegativeOperand negativeOp = (NegativeOperand)op; - if (minusSign != null) - negativeOp.setPosition(new TextPosition(minusSign.beginLine, minusSign.beginColumn, position.endLine, position.endColumn)); - else - negativeOp.setPosition(position); - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - } - - { - if ("" != null) - return op; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("Factor"); - } - } - - @Override - final public ADQLOperand StringExpression() throws ParseException { - trace_call("StringExpression"); - try { - ADQLOperand leftOp; - ADQLOperand rightOp = null; - leftOp = StringFactor(); - label_9: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case CONCAT: { - ; - break; - } - default: - jj_la1[56] = jj_gen; - break label_9; - } - jj_consume_token(CONCAT); - rightOp = StringFactor(); - if (!(leftOp instanceof Concatenation)) { - try { - ADQLOperand temp = leftOp; - leftOp = queryFactory.createConcatenation(); - ((Concatenation)leftOp).add(temp); - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - } - ((Concatenation)leftOp).add(rightOp); - } - if (leftOp instanceof Concatenation) { - Concatenation concat = (Concatenation)leftOp; - concat.setPosition(new TextPosition(concat.get(0).getPosition(), concat.get(concat.size() - 1).getPosition())); - } - { - if ("" != null) - return leftOp; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("StringExpression"); - } - } - - final public ADQLOperand StringFactor() throws ParseException { - trace_call("StringFactor"); - try { - ADQLOperand op; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COORDSYS: { - op = ExtractCoordSys(); - break; - } - case LOWER: { - op = LowerFunction(); - break; - } - default: - jj_la1[57] = jj_gen; - if (jj_2_13(2)) { - op = UserDefinedFunction(); - ((UserDefinedFunction)op).setExpectedType('S'); - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: - case STRING_LITERAL: - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - op = StringValueExpressionPrimary(); - break; - } - default: - jj_la1[58] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - { - if ("" != null) - return op; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("StringFactor"); - } - } - - final public GeometryValue<GeometryFunction> GeometryExpression() throws ParseException { - trace_call("GeometryExpression"); - try { - ADQLColumn col = null; - GeometryFunction gf = null; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - col = Column(); - break; - } - case BOX: - case CENTROID: - case CIRCLE: - case POINT: - case POLYGON: { - gf = GeometryValueFunction(); - break; - } - default: - jj_la1[59] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - if (col != null) { - col.setExpectedType('G'); - { - if ("" != null) - return new GeometryValue<GeometryFunction>(col); - } - } else { - if ("" != null) - return new GeometryValue<GeometryFunction>(gf); - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("GeometryExpression"); - } - } - - /* ********************************** */ - /* BOOLEAN EXPRESSIONS (WHERE clause) */ - /* ********************************** */ - final public ClauseConstraints ConditionsList(ClauseConstraints clause) throws ParseException { - trace_call("ConditionsList"); - try { - ADQLConstraint constraint = null; - Token op = null; - boolean notOp = false; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NOT: { - op = jj_consume_token(NOT); - notOp = true; - break; - } - default: - jj_la1[60] = jj_gen; - ; - } - constraint = Constraint(); - if (notOp) { - TextPosition oldPos = constraint.getPosition(); - constraint = queryFactory.createNot(constraint); - ((NotConstraint)constraint).setPosition(new TextPosition(op.beginLine, op.beginColumn, oldPos.endLine, oldPos.endColumn)); - } - notOp = false; - - if (clause instanceof ADQLConstraint) - clause.add(constraint); - else - clause.add(constraint); - label_10: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AND: - case OR: { - ; - break; - } - default: - jj_la1[61] = jj_gen; - break label_10; - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AND: { - op = jj_consume_token(AND); - break; - } - case OR: { - op = jj_consume_token(OR); - break; - } - default: - jj_la1[62] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NOT: { - jj_consume_token(NOT); - notOp = true; - break; - } - default: - jj_la1[63] = jj_gen; - ; - } - constraint = Constraint(); - if (notOp) { - TextPosition oldPos = constraint.getPosition(); - constraint = queryFactory.createNot(constraint); - ((NotConstraint)constraint).setPosition(new TextPosition(op.beginLine, op.beginColumn, oldPos.endLine, oldPos.endColumn)); - } - notOp = false; - - if (clause instanceof ADQLConstraint) - clause.add(op.image, constraint); - else - clause.add(op.image, constraint); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - if (!clause.isEmpty()) { - TextPosition start = clause.get(0).getPosition(); - TextPosition end = clause.get(clause.size() - 1).getPosition(); - clause.setPosition(new TextPosition(start, end)); - } - { - if ("" != null) - return clause; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("ConditionsList"); - } - } - - final public ADQLConstraint Constraint() throws ParseException { - trace_call("Constraint"); - try { - ADQLConstraint constraint = null; - Token start, end; - if (jj_2_14(2147483647)) { - constraint = Predicate(); - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: { - start = jj_consume_token(LEFT_PAR); - try { - constraint = queryFactory.createGroupOfConstraints(); - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - ConditionsList((ConstraintsGroup)constraint); - end = jj_consume_token(RIGHT_PAR); - ((ConstraintsGroup)constraint).setPosition(new TextPosition(start, end)); - break; - } - default: - jj_la1[64] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if ("" != null) - return constraint; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("Constraint"); - } - } - - final public ADQLConstraint Predicate() throws ParseException { - trace_call("Predicate"); - try { - ADQLQuery q = null; - ADQLColumn column = null; - ADQLOperand strExpr1 = null, strExpr2 = null; - ADQLOperand op; - Token start, notToken = null, end; - ADQLConstraint constraint = null; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case EXISTS: { - start = jj_consume_token(EXISTS); - q = SubQueryExpression(); - Exists e = queryFactory.createExists(q); - e.setPosition(new TextPosition(start.beginLine, start.beginColumn, q.getPosition().endLine, q.getPosition().endColumn)); - { - if ("" != null) - return e; - } - break; - } - default: - jj_la1[69] = jj_gen; - if (jj_2_16(2147483647)) { - column = Column(); - jj_consume_token(IS); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NOT: { - notToken = jj_consume_token(NOT); - break; - } - default: - jj_la1[65] = jj_gen; - ; - } - end = jj_consume_token(NULL); - IsNull in = queryFactory.createIsNull((notToken != null), column); - in.setPosition(new TextPosition(column.getPosition().beginLine, column.getPosition().beginColumn, end.endLine, (end.endColumn < 0) ? -1 : (end.endColumn + 1))); - { - if ("" != null) - return in; - } - } else if (jj_2_17(2147483647)) { - strExpr1 = StringExpression(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NOT: { - notToken = jj_consume_token(NOT); - break; - } - default: - jj_la1[66] = jj_gen; - ; - } - jj_consume_token(LIKE); - strExpr2 = StringExpression(); - Comparison comp = queryFactory.createComparison(strExpr1, (notToken == null) ? ComparisonOperator.LIKE : ComparisonOperator.NOTLIKE, strExpr2); - comp.setPosition(new TextPosition(strExpr1.getPosition(), strExpr2.getPosition())); - { - if ("" != null) - return comp; - } - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: - case PLUS: - case MINUS: - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: - case BOX: - case CENTROID: - case CIRCLE: - case POINT: - case POLYGON: - case CONTAINS: - case INTERSECTS: - case AREA: - case COORD1: - case COORD2: - case COORDSYS: - case DISTANCE: - case LOWER: - case ABS: - case CEILING: - case DEGREES: - case EXP: - case FLOOR: - case LOG: - case LOG10: - case MOD: - case PI: - case POWER: - case RADIANS: - case RAND: - case ROUND: - case SQRT: - case TRUNCATE: - case ACOS: - case ASIN: - case ATAN: - case ATAN2: - case COS: - case COT: - case SIN: - case TAN: - case STRING_LITERAL: - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - op = ValueExpression(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case EQUAL: - case NOT_EQUAL: - case LESS_THAN: - case LESS_EQUAL_THAN: - case GREATER_THAN: - case GREATER_EQUAL_THAN: { - constraint = ComparisonEnd(op); - break; - } - default: - jj_la1[67] = jj_gen; - if (jj_2_15(2)) { - constraint = BetweenEnd(op); - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NOT: - case IN: { - constraint = InEnd(op); - break; - } - default: - jj_la1[68] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - break; - } - default: - jj_la1[70] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - { - if ("" != null) - return constraint; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("Predicate"); - } - } - - final public Comparison ComparisonEnd(ADQLOperand leftOp) throws ParseException { - trace_call("ComparisonEnd"); - try { - Token comp; - ADQLOperand rightOp; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case EQUAL: { - comp = jj_consume_token(EQUAL); - break; - } - case NOT_EQUAL: { - comp = jj_consume_token(NOT_EQUAL); - break; - } - case LESS_THAN: { - comp = jj_consume_token(LESS_THAN); - break; - } - case LESS_EQUAL_THAN: { - comp = jj_consume_token(LESS_EQUAL_THAN); - break; - } - case GREATER_THAN: { - comp = jj_consume_token(GREATER_THAN); - break; - } - case GREATER_EQUAL_THAN: { - comp = jj_consume_token(GREATER_EQUAL_THAN); - break; - } - default: - jj_la1[71] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - rightOp = ValueExpression(); - try { - Comparison comparison = queryFactory.createComparison(leftOp, ComparisonOperator.getOperator(comp.image), rightOp); - comparison.setPosition(new TextPosition(leftOp.getPosition(), rightOp.getPosition())); - { - if ("" != null) - return comparison; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("ComparisonEnd"); - } - } - - final public Between BetweenEnd(ADQLOperand leftOp) throws ParseException { - trace_call("BetweenEnd"); - try { - Token start, notToken = null; - ADQLOperand min, max; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NOT: { - notToken = jj_consume_token(NOT); - break; - } - default: - jj_la1[72] = jj_gen; - ; - } - start = jj_consume_token(BETWEEN); - min = ValueExpression(); - jj_consume_token(AND); - max = ValueExpression(); - try { - Between bet = queryFactory.createBetween((notToken != null), leftOp, min, max); - if (notToken != null) - start = notToken; - bet.setPosition(new TextPosition(start.beginLine, start.beginColumn, max.getPosition().endLine, max.getPosition().endColumn)); - { - if ("" != null) - return bet; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("BetweenEnd"); - } - } - - final public In InEnd(ADQLOperand leftOp) throws ParseException { - trace_call("InEnd"); - try { - Token not = null, start; - ADQLQuery q = null; - ADQLOperand item; - Vector<ADQLOperand> items = new Vector<ADQLOperand>(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case NOT: { - not = jj_consume_token(NOT); - break; - } - default: - jj_la1[73] = jj_gen; - ; - } - start = jj_consume_token(IN); - if (jj_2_18(2)) { - q = SubQueryExpression(); - } else { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: { - jj_consume_token(LEFT_PAR); - item = ValueExpression(); - items.add(item); - label_11: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[74] = jj_gen; - break label_11; - } - jj_consume_token(COMMA); - item = ValueExpression(); - items.add(item); - } - jj_consume_token(RIGHT_PAR); - break; - } - default: - jj_la1[75] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - try { - In in; - start = (not != null) ? not : start; - if (q != null) { - in = queryFactory.createIn(leftOp, q, not != null); - in.setPosition(new TextPosition(start.beginLine, start.beginColumn, q.getPosition().endLine, q.getPosition().endColumn)); - } else { - ADQLOperand[] list = new ADQLOperand[items.size()]; - int i = 0; - for(ADQLOperand op : items) - list[i++] = op; - in = queryFactory.createIn(leftOp, list, not != null); - in.setPosition(new TextPosition(start.beginLine, start.beginColumn, list[list.length - 1].getPosition().endLine, list[list.length - 1].getPosition().endColumn)); - } - { - if ("" != null) - return in; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("InEnd"); - } - } - - /* ************* */ - /* SQL FUNCTIONS */ - /* ************* */ - final public SQLFunction SqlFunction() throws ParseException { - trace_call("SqlFunction"); - try { - Token fct, all = null, distinct = null, end; - ADQLOperand op = null; - SQLFunction funct = null; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COUNT: { - fct = jj_consume_token(COUNT); - jj_consume_token(LEFT_PAR); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case QUANTIFIER: { - distinct = jj_consume_token(QUANTIFIER); - break; - } - default: - jj_la1[76] = jj_gen; - ; - } - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ASTERISK: { - all = jj_consume_token(ASTERISK); - break; - } - case LEFT_PAR: - case PLUS: - case MINUS: - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: - case BOX: - case CENTROID: - case CIRCLE: - case POINT: - case POLYGON: - case CONTAINS: - case INTERSECTS: - case AREA: - case COORD1: - case COORD2: - case COORDSYS: - case DISTANCE: - case LOWER: - case ABS: - case CEILING: - case DEGREES: - case EXP: - case FLOOR: - case LOG: - case LOG10: - case MOD: - case PI: - case POWER: - case RADIANS: - case RAND: - case ROUND: - case SQRT: - case TRUNCATE: - case ACOS: - case ASIN: - case ATAN: - case ATAN2: - case COS: - case COT: - case SIN: - case TAN: - case STRING_LITERAL: - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - op = ValueExpression(); - break; - } - default: - jj_la1[77] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - end = jj_consume_token(RIGHT_PAR); - funct = queryFactory.createSQLFunction((all != null) ? SQLFunctionType.COUNT_ALL : SQLFunctionType.COUNT, op, distinct != null && distinct.image.equalsIgnoreCase("distinct")); - funct.setPosition(new TextPosition(fct, end)); - break; - } - case AVG: - case MAX: - case MIN: - case SUM: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case AVG: { - fct = jj_consume_token(AVG); - break; - } - case MAX: { - fct = jj_consume_token(MAX); - break; - } - case MIN: { - fct = jj_consume_token(MIN); - break; - } - case SUM: { - fct = jj_consume_token(SUM); - break; - } - default: - jj_la1[78] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(LEFT_PAR); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case QUANTIFIER: { - distinct = jj_consume_token(QUANTIFIER); - break; - } - default: - jj_la1[79] = jj_gen; - ; - } - op = ValueExpression(); - end = jj_consume_token(RIGHT_PAR); - funct = queryFactory.createSQLFunction(SQLFunctionType.valueOf(fct.image.toUpperCase()), op, distinct != null && distinct.image.equalsIgnoreCase("distinct")); - funct.setPosition(new TextPosition(fct, end)); - break; - } - default: - jj_la1[80] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - { - if ("" != null) - return funct; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("SqlFunction"); - } - } - - /* ************** */ - /* ADQL FUNCTIONS */ - /* ************** */ - final public ADQLOperand[] Coordinates() throws ParseException { - trace_call("Coordinates"); - try { - ADQLOperand[] ops = new ADQLOperand[2]; - ops[0] = NumericExpression(); - jj_consume_token(COMMA); - ops[1] = NumericExpression(); - { - if ("" != null) - return ops; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("Coordinates"); - } - } - - final public GeometryFunction GeometryFunction() throws ParseException { - trace_call("GeometryFunction"); - try { - Token fct = null, end; - GeometryValue<GeometryFunction> gvf1, gvf2; - GeometryValue<PointFunction> gvp1, gvp2; - GeometryFunction gf = null; - PointFunction p1 = null, p2 = null; - ADQLColumn col1 = null, col2 = null; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case CONTAINS: - case INTERSECTS: { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case CONTAINS: { - fct = jj_consume_token(CONTAINS); - break; - } - case INTERSECTS: { - fct = jj_consume_token(INTERSECTS); - break; - } - default: - jj_la1[81] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(LEFT_PAR); - gvf1 = GeometryExpression(); - jj_consume_token(COMMA); - gvf2 = GeometryExpression(); - end = jj_consume_token(RIGHT_PAR); - if (fct.image.equalsIgnoreCase("contains")) - gf = queryFactory.createContains(gvf1, gvf2); - else - gf = queryFactory.createIntersects(gvf1, gvf2); - break; - } - case AREA: { - fct = jj_consume_token(AREA); - jj_consume_token(LEFT_PAR); - gvf1 = GeometryExpression(); - end = jj_consume_token(RIGHT_PAR); - gf = queryFactory.createArea(gvf1); - break; - } - case COORD1: { - fct = jj_consume_token(COORD1); - jj_consume_token(LEFT_PAR); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case POINT: { - p1 = Point(); - gf = queryFactory.createCoord1(p1); - break; - } - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - col1 = Column(); - col1.setExpectedType('G'); - gf = queryFactory.createCoord1(col1); - break; - } - default: - jj_la1[82] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - end = jj_consume_token(RIGHT_PAR); - break; - } - case COORD2: { - fct = jj_consume_token(COORD2); - jj_consume_token(LEFT_PAR); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case POINT: { - p1 = Point(); - gf = queryFactory.createCoord2(p1); - break; - } - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - col1 = Column(); - col1.setExpectedType('G'); - gf = queryFactory.createCoord2(col1); - break; - } - default: - jj_la1[83] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - end = jj_consume_token(RIGHT_PAR); - break; - } - case DISTANCE: { - fct = jj_consume_token(DISTANCE); - jj_consume_token(LEFT_PAR); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case POINT: { - p1 = Point(); - break; - } - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - col1 = Column(); - break; - } - default: - jj_la1[84] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - if (p1 != null) - gvp1 = new GeometryValue<PointFunction>(p1); - else { - col1.setExpectedType('G'); - gvp1 = new GeometryValue<PointFunction>(col1); - } - jj_consume_token(COMMA); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case POINT: { - p2 = Point(); - break; - } - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - col2 = Column(); - break; - } - default: - jj_la1[85] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - if (p2 != null) - gvp2 = new GeometryValue<PointFunction>(p2); - else { - col2.setExpectedType('G'); - gvp2 = new GeometryValue<PointFunction>(col2); - } - end = jj_consume_token(RIGHT_PAR); - gf = queryFactory.createDistance(gvp1, gvp2); - break; - } - default: - jj_la1[86] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - gf.setPosition(new TextPosition(fct, end)); - { - if ("" != null) - return gf; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("GeometryFunction"); - } - } - - final public ADQLOperand CoordinateSystem() throws ParseException { - trace_call("CoordinateSystem"); - try { - ADQLOperand coordSys = null; - coordSys = StringExpression(); - { - if ("" != null) - return coordSys; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("CoordinateSystem"); - } - } - - final public GeometryFunction GeometryValueFunction() throws ParseException { - trace_call("GeometryValueFunction"); - try { - Token fct = null, end = null; - ADQLOperand coordSys; - ADQLOperand width, height; - ADQLOperand[] coords, tmp; - Vector<ADQLOperand> vCoords; - ADQLOperand op = null; - GeometryValue<GeometryFunction> gvf = null; - GeometryFunction gf = null; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case BOX: { - fct = jj_consume_token(BOX); - jj_consume_token(LEFT_PAR); - coordSys = CoordinateSystem(); - jj_consume_token(COMMA); - coords = Coordinates(); - jj_consume_token(COMMA); - width = NumericExpression(); - jj_consume_token(COMMA); - height = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - gf = queryFactory.createBox(coordSys, coords[0], coords[1], width, height); - break; - } - case CENTROID: { - fct = jj_consume_token(CENTROID); - jj_consume_token(LEFT_PAR); - gvf = GeometryExpression(); - end = jj_consume_token(RIGHT_PAR); - gf = queryFactory.createCentroid(gvf); - break; - } - case CIRCLE: { - fct = jj_consume_token(CIRCLE); - jj_consume_token(LEFT_PAR); - coordSys = CoordinateSystem(); - jj_consume_token(COMMA); - coords = Coordinates(); - jj_consume_token(COMMA); - width = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - gf = queryFactory.createCircle(coordSys, coords[0], coords[1], width); - break; - } - case POINT: { - gf = Point(); - break; - } - case POLYGON: { - fct = jj_consume_token(POLYGON); - jj_consume_token(LEFT_PAR); - coordSys = CoordinateSystem(); - vCoords = new Vector<ADQLOperand>(); - jj_consume_token(COMMA); - tmp = Coordinates(); - vCoords.add(tmp[0]); - vCoords.add(tmp[1]); - jj_consume_token(COMMA); - tmp = Coordinates(); - vCoords.add(tmp[0]); - vCoords.add(tmp[1]); - jj_consume_token(COMMA); - tmp = Coordinates(); - vCoords.add(tmp[0]); - vCoords.add(tmp[1]); - label_12: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[87] = jj_gen; - break label_12; - } - jj_consume_token(COMMA); - tmp = Coordinates(); - vCoords.add(tmp[0]); - vCoords.add(tmp[1]); - } - end = jj_consume_token(RIGHT_PAR); - gf = queryFactory.createPolygon(coordSys, vCoords); - break; - } - default: - jj_la1[88] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - if (fct != null && end != null) // = !(gf instanceof Point) - gf.setPosition(new TextPosition(fct, end)); - { - if ("" != null) - return gf; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("GeometryValueFunction"); - } - } - - final public PointFunction Point() throws ParseException { - trace_call("Point"); - try { - Token start, end; - ADQLOperand coordSys; - ADQLOperand[] coords; - start = jj_consume_token(POINT); - jj_consume_token(LEFT_PAR); - coordSys = CoordinateSystem(); - jj_consume_token(COMMA); - coords = Coordinates(); - end = jj_consume_token(RIGHT_PAR); - try { - PointFunction pf = queryFactory.createPoint(coordSys, coords[0], coords[1]); - pf.setPosition(new TextPosition(start, end)); - { - if ("" != null) - return pf; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("Point"); - } - } - - final public GeometryFunction ExtractCoordSys() throws ParseException { - trace_call("ExtractCoordSys"); - try { - Token start, end; - GeometryValue<GeometryFunction> gvf; - start = jj_consume_token(COORDSYS); - jj_consume_token(LEFT_PAR); - gvf = GeometryExpression(); - end = jj_consume_token(RIGHT_PAR); - try { - GeometryFunction gf = queryFactory.createExtractCoordSys(gvf); - gf.setPosition(new TextPosition(start, end)); - { - if ("" != null) - return gf; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("ExtractCoordSys"); - } - } - - /* **************** */ - /* STRING FUNCTIONS */ - /* **************** */ - final public LowerFunction LowerFunction() throws ParseException { - trace_call("LowerFunction"); - try { - Token start, end; - ADQLOperand str; - start = jj_consume_token(LOWER); - jj_consume_token(LEFT_PAR); - str = StringExpression(); - end = jj_consume_token(RIGHT_PAR); - try { - LowerFunction lf = queryFactory.createLowerFunction(str); - lf.setPosition(new TextPosition(start, end)); - { - if ("" != null) - return lf; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("LowerFunction"); - } - } - - /* ***************** */ - /* NUMERIC FUNCTIONS */ - /* ***************** */ - final public ADQLFunction NumericFunction() throws ParseException { - trace_call("NumericFunction"); - try { - ADQLFunction fct; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ABS: - case CEILING: - case DEGREES: - case EXP: - case FLOOR: - case LOG: - case LOG10: - case MOD: - case PI: - case POWER: - case RADIANS: - case RAND: - case ROUND: - case SQRT: - case TRUNCATE: { - fct = MathFunction(); - break; - } - case ACOS: - case ASIN: - case ATAN: - case ATAN2: - case COS: - case COT: - case SIN: - case TAN: { - fct = TrigFunction(); - break; - } - case CONTAINS: - case INTERSECTS: - case AREA: - case COORD1: - case COORD2: - case DISTANCE: { - fct = GeometryFunction(); - break; - } - case REGULAR_IDENTIFIER_CANDIDATE: { - fct = UserDefinedFunction(); - ((UserDefinedFunction)fct).setExpectedType('N'); - break; - } - default: - jj_la1[89] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if ("" != null) - return fct; - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("NumericFunction"); - } - } - - final public MathFunction MathFunction() throws ParseException { - trace_call("MathFunction"); - try { - Token fct = null, end; - ADQLOperand param1 = null, param2 = null; - NumericConstant integerValue = null; - try { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ABS: { - fct = jj_consume_token(ABS); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case CEILING: { - fct = jj_consume_token(CEILING); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case DEGREES: { - fct = jj_consume_token(DEGREES); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case EXP: { - fct = jj_consume_token(EXP); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case FLOOR: { - fct = jj_consume_token(FLOOR); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case LOG: { - fct = jj_consume_token(LOG); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case LOG10: { - fct = jj_consume_token(LOG10); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case MOD: { - fct = jj_consume_token(MOD); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - jj_consume_token(COMMA); - param2 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case PI: { - fct = jj_consume_token(PI); - jj_consume_token(LEFT_PAR); - end = jj_consume_token(RIGHT_PAR); - break; - } - case POWER: { - fct = jj_consume_token(POWER); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - jj_consume_token(COMMA); - param2 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case RADIANS: { - fct = jj_consume_token(RADIANS); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case RAND: { - fct = jj_consume_token(RAND); - jj_consume_token(LEFT_PAR); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: - case PLUS: - case MINUS: - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: - case CONTAINS: - case INTERSECTS: - case AREA: - case COORD1: - case COORD2: - case DISTANCE: - case ABS: - case CEILING: - case DEGREES: - case EXP: - case FLOOR: - case LOG: - case LOG10: - case MOD: - case PI: - case POWER: - case RADIANS: - case RAND: - case ROUND: - case SQRT: - case TRUNCATE: - case ACOS: - case ASIN: - case ATAN: - case ATAN2: - case COS: - case COT: - case SIN: - case TAN: - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - param1 = NumericExpression(); - break; - } - default: - jj_la1[90] = jj_gen; - ; - } - end = jj_consume_token(RIGHT_PAR); - break; - } - case ROUND: { - fct = jj_consume_token(ROUND); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - jj_consume_token(COMMA); - param2 = SignedInteger(); - break; - } - default: - jj_la1[91] = jj_gen; - ; - } - end = jj_consume_token(RIGHT_PAR); - break; - } - case SQRT: { - fct = jj_consume_token(SQRT); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case TRUNCATE: { - fct = jj_consume_token(TRUNCATE); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - jj_consume_token(COMMA); - param2 = SignedInteger(); - break; - } - default: - jj_la1[92] = jj_gen; - ; - } - end = jj_consume_token(RIGHT_PAR); - break; - } - default: - jj_la1[93] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - MathFunction mf = queryFactory.createMathFunction(MathFunctionType.valueOf(fct.image.toUpperCase()), param1, param2); - mf.setPosition(new TextPosition(fct, end)); - { - if ("" != null) - return mf; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("MathFunction"); - } - } - - final public MathFunction TrigFunction() throws ParseException { - trace_call("TrigFunction"); - try { - Token fct = null, end; - ADQLOperand param1 = null, param2 = null; - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case ACOS: { - fct = jj_consume_token(ACOS); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case ASIN: { - fct = jj_consume_token(ASIN); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case ATAN: { - fct = jj_consume_token(ATAN); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case ATAN2: { - fct = jj_consume_token(ATAN2); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - jj_consume_token(COMMA); - param2 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case COS: { - fct = jj_consume_token(COS); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case COT: { - fct = jj_consume_token(COT); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case SIN: { - fct = jj_consume_token(SIN); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - case TAN: { - fct = jj_consume_token(TAN); - jj_consume_token(LEFT_PAR); - param1 = NumericExpression(); - end = jj_consume_token(RIGHT_PAR); - break; - } - default: - jj_la1[94] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - try { - MathFunction mf = queryFactory.createMathFunction(MathFunctionType.valueOf(fct.image.toUpperCase()), param1, param2); - mf.setPosition(new TextPosition(fct, end)); - { - if ("" != null) - return mf; - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("TrigFunction"); - } - } - - final public UserDefinedFunction UserDefinedFunction() throws ParseException { - trace_call("UserDefinedFunction"); - try { - Token fct, end; - Vector<ADQLOperand> params = new Vector<ADQLOperand>(); - ADQLOperand op; - fct = jj_consume_token(REGULAR_IDENTIFIER_CANDIDATE); - jj_consume_token(LEFT_PAR); - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case LEFT_PAR: - case PLUS: - case MINUS: - case AVG: - case MAX: - case MIN: - case SUM: - case COUNT: - case BOX: - case CENTROID: - case CIRCLE: - case POINT: - case POLYGON: - case CONTAINS: - case INTERSECTS: - case AREA: - case COORD1: - case COORD2: - case COORDSYS: - case DISTANCE: - case LOWER: - case ABS: - case CEILING: - case DEGREES: - case EXP: - case FLOOR: - case LOG: - case LOG10: - case MOD: - case PI: - case POWER: - case RADIANS: - case RAND: - case ROUND: - case SQRT: - case TRUNCATE: - case ACOS: - case ASIN: - case ATAN: - case ATAN2: - case COS: - case COT: - case SIN: - case TAN: - case STRING_LITERAL: - case SCIENTIFIC_NUMBER: - case UNSIGNED_FLOAT: - case UNSIGNED_INTEGER: - case DELIMITED_IDENTIFIER: - case REGULAR_IDENTIFIER_CANDIDATE: { - op = ValueExpression(); - params.add(op); - label_13: while(true) { - switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) { - case COMMA: { - ; - break; - } - default: - jj_la1[95] = jj_gen; - break label_13; - } - jj_consume_token(COMMA); - op = ValueExpression(); - params.add(op); - } - break; - } - default: - jj_la1[96] = jj_gen; - ; - } - end = jj_consume_token(RIGHT_PAR); - // Ensure the given function name is valid: - if (!isRegularIdentifier(fct.image)) { - if (true) - throw new ParseException("Invalid (User Defined) Function name: \u005c"" + fct.image + "\u005c"!", new TextPosition(fct)); - } - - //System.out.println("INFO [ADQLParser201]: \""+fct.image+"\" (from line "+fct.beginLine+" and column "+fct.beginColumn+" to line "+token.endLine+" and column "+(token.endColumn+1)+") is considered as an user defined function !"); - - try { - // Build the parameters list: - ADQLOperand[] parameters = new ADQLOperand[params.size()]; - for(int i = 0; i < params.size(); i++) - parameters[i] = params.get(i); - - // Create the UDF function: - UserDefinedFunction udf = queryFactory.createUserDefinedFunction(fct.image, parameters); - udf.setPosition(new TextPosition(fct, end)); - { - if ("" != null) - return udf; - } - - } catch(UnsupportedOperationException uoe) { - /* This catch clause is just for backward compatibility: - * if the createUserDefinedFunction(...) is overridden and - * the function can not be identified a such exception may be thrown). */ - { - if (true) - throw new ParseException(uoe.getMessage(), new TextPosition(fct, token)); - } - } catch(Exception ex) { - { - if (true) - throw generateParseException(ex); - } - } - throw new Error("Missing return statement in function"); - } finally { - trace_return("UserDefinedFunction"); - } - } - - private boolean jj_2_1(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_1(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(0, xla); - } - } - - private boolean jj_2_2(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_2(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(1, xla); - } - } - - private boolean jj_2_3(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_3(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(2, xla); - } - } - - private boolean jj_2_4(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_4(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(3, xla); - } - } - - private boolean jj_2_5(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_5(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(4, xla); - } - } - - private boolean jj_2_6(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_6(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(5, xla); - } - } - - private boolean jj_2_7(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_7(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(6, xla); - } - } - - private boolean jj_2_8(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_8(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(7, xla); - } - } - - private boolean jj_2_9(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_9(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(8, xla); - } - } - - private boolean jj_2_10(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_10(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(9, xla); - } - } - - private boolean jj_2_11(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_11(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(10, xla); - } - } - - private boolean jj_2_12(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_12(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(11, xla); - } - } - - private boolean jj_2_13(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_13(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(12, xla); - } - } - - private boolean jj_2_14(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_14(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(13, xla); - } - } - - private boolean jj_2_15(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_15(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(14, xla); - } - } - - private boolean jj_2_16(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_16(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(15, xla); - } - } - - private boolean jj_2_17(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_17(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(16, xla); - } - } - - private boolean jj_2_18(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_18(); - } catch(LookaheadSuccess ls) { - return true; - } finally { - jj_save(17, xla); - } - } - - private boolean jj_3_2() { - if (jj_3R_16()) - return true; - return false; - } - - private boolean jj_3R_75() { - if (jj_3R_80()) - return true; - return false; - } - - private boolean jj_3R_27() { - if (jj_3R_50()) - return true; - return false; - } - - private boolean jj_3R_121() { - if (jj_3R_50()) - return true; - Token xsp; - while(true) { - xsp = jj_scanpos; - if (jj_3R_135()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_55() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_75()) { - jj_scanpos = xsp; - if (jj_3_2()) { - jj_scanpos = xsp; - if (jj_3R_76()) - return true; - } - } - return false; - } - - private boolean jj_3_14() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(42)) { - jj_scanpos = xsp; - if (jj_3R_27()) - return true; - } - return false; - } - - private boolean jj_3R_151() { - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_154()) - return true; - return false; - } - - private boolean jj_3R_150() { - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_154()) - return true; - return false; - } - - private boolean jj_3R_60() { - if (jj_scan_token(DOT)) - return true; - if (jj_3R_80()) - return true; - return false; - } - - private boolean jj_3R_22() { - if (jj_3R_42()) - return true; - return false; - } - - private boolean jj_3R_42() { - if (jj_3R_14()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_60()) - jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_128() { - if (jj_scan_token(DOT)) - return true; - if (jj_3R_14()) - return true; - return false; - } - - private boolean jj_3R_127() { - if (jj_scan_token(DOT)) - return true; - if (jj_3R_14()) - return true; - return false; - } - - private boolean jj_3R_26() { - if (jj_scan_token(REGULAR_IDENTIFIER_CANDIDATE)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_121()) - jj_scanpos = xsp; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_142() { - if (jj_3R_113()) - return true; - return false; - } - - private boolean jj_3R_80() { - if (jj_3R_14()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_127()) - jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_128()) - jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_107() { - if (jj_scan_token(TAN)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_134() { - if (jj_3R_21()) - return true; - return false; - } - - private boolean jj_3R_106() { - if (jj_scan_token(SIN)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_31() { - if (jj_scan_token(DELIMITED_IDENTIFIER)) - return true; - return false; - } - - private boolean jj_3R_105() { - if (jj_scan_token(COT)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_104() { - if (jj_scan_token(COS)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_103() { - if (jj_scan_token(ATAN2)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_102() { - if (jj_scan_token(ATAN)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_101() { - if (jj_scan_token(ASIN)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_30() { - if (jj_scan_token(REGULAR_IDENTIFIER_CANDIDATE)) - return true; - return false; - } - - private boolean jj_3R_100() { - if (jj_scan_token(ACOS)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_64() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_100()) { - jj_scanpos = xsp; - if (jj_3R_101()) { - jj_scanpos = xsp; - if (jj_3R_102()) { - jj_scanpos = xsp; - if (jj_3R_103()) { - jj_scanpos = xsp; - if (jj_3R_104()) { - jj_scanpos = xsp; - if (jj_3R_105()) { - jj_scanpos = xsp; - if (jj_3R_106()) { - jj_scanpos = xsp; - if (jj_3R_107()) - return true; - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_99() { - if (jj_scan_token(TRUNCATE)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_151()) - jj_scanpos = xsp; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_98() { - if (jj_scan_token(SQRT)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_97() { - if (jj_scan_token(ROUND)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_150()) - jj_scanpos = xsp; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_96() { - if (jj_scan_token(RAND)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_142()) - jj_scanpos = xsp; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_95() { - if (jj_scan_token(RADIANS)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_133() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3R_94() { - if (jj_scan_token(POWER)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_14() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_30()) { - jj_scanpos = xsp; - if (jj_3R_31()) - return true; - } - return false; - } - - private boolean jj_3R_120() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_133()) { - jj_scanpos = xsp; - if (jj_3R_134()) - return true; - } - return false; - } - - private boolean jj_3R_93() { - if (jj_scan_token(PI)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_92() { - if (jj_scan_token(MOD)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_91() { - if (jj_scan_token(LOG10)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_58() { - if (jj_3R_79()) - return true; - return false; - } - - private boolean jj_3R_90() { - if (jj_scan_token(LOG)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3_13() { - if (jj_3R_26()) - return true; - return false; - } - - private boolean jj_3R_89() { - if (jj_scan_token(FLOOR)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_57() { - if (jj_3R_78()) - return true; - return false; - } - - private boolean jj_3R_88() { - if (jj_scan_token(EXP)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_87() { - if (jj_scan_token(DEGREES)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_56() { - if (jj_3R_77()) - return true; - return false; - } - - private boolean jj_3R_86() { - if (jj_scan_token(CEILING)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_36() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_56()) { - jj_scanpos = xsp; - if (jj_3R_57()) { - jj_scanpos = xsp; - if (jj_3_13()) { - jj_scanpos = xsp; - if (jj_3R_58()) - return true; - } - } - } - return false; - } - - private boolean jj_3R_85() { - if (jj_scan_token(ABS)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_45() { - if (jj_3R_62()) - return true; - return false; - } - - private boolean jj_3R_63() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_85()) { - jj_scanpos = xsp; - if (jj_3R_86()) { - jj_scanpos = xsp; - if (jj_3R_87()) { - jj_scanpos = xsp; - if (jj_3R_88()) { - jj_scanpos = xsp; - if (jj_3R_89()) { - jj_scanpos = xsp; - if (jj_3R_90()) { - jj_scanpos = xsp; - if (jj_3R_91()) { - jj_scanpos = xsp; - if (jj_3R_92()) { - jj_scanpos = xsp; - if (jj_3R_93()) { - jj_scanpos = xsp; - if (jj_3R_94()) { - jj_scanpos = xsp; - if (jj_3R_95()) { - jj_scanpos = xsp; - if (jj_3R_96()) { - jj_scanpos = xsp; - if (jj_3R_97()) { - jj_scanpos = xsp; - if (jj_3R_98()) { - jj_scanpos = xsp; - if (jj_3R_99()) - return true; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_49() { - if (jj_3R_26()) - return true; - return false; - } - - private boolean jj_3R_48() { - if (jj_3R_65()) - return true; - return false; - } - - private boolean jj_3R_47() { - if (jj_3R_64()) - return true; - return false; - } - - private boolean jj_3R_51() { - if (jj_scan_token(CONCAT)) - return true; - if (jj_3R_36()) - return true; - return false; - } - - private boolean jj_3R_46() { - if (jj_3R_63()) - return true; - return false; - } - - private boolean jj_3R_25() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_46()) { - jj_scanpos = xsp; - if (jj_3R_47()) { - jj_scanpos = xsp; - if (jj_3R_48()) { - jj_scanpos = xsp; - if (jj_3R_49()) - return true; - } - } - } - return false; - } - - private boolean jj_3R_29() { - if (jj_3R_36()) - return true; - Token xsp; - while(true) { - xsp = jj_scanpos; - if (jj_3R_51()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_61() { - if (jj_scan_token(MINUS)) - return true; - return false; - } - - private boolean jj_3R_78() { - if (jj_scan_token(LOWER)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_29()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3_12() { - if (jj_3R_25()) - return true; - return false; - } - - private boolean jj_3R_44() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(9)) { - jj_scanpos = xsp; - if (jj_3R_61()) - return true; - } - return false; - } - - private boolean jj_3R_32() { - if (jj_3R_14()) - return true; - if (jj_scan_token(DOT)) - return true; - return false; - } - - private boolean jj_3R_138() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(11)) { - jj_scanpos = xsp; - if (jj_scan_token(12)) - return true; - } - if (jj_3R_131()) - return true; - return false; - } - - private boolean jj_3R_24() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_44()) - jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3_12()) { - jj_scanpos = xsp; - if (jj_3R_45()) - return true; - } - return false; - } - - private boolean jj_3R_77() { - if (jj_scan_token(COORDSYS)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_120()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_15() { - if (jj_3R_14()) - return true; - if (jj_scan_token(DOT)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_32()) - jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_146() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3R_144() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3R_141() { - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_140()) - return true; - return false; - } - - private boolean jj_3R_132() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(9)) { - jj_scanpos = xsp; - if (jj_scan_token(10)) - return true; - } - if (jj_3R_113()) - return true; - return false; - } - - private boolean jj_3R_59() { - if (jj_scan_token(POINT)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_139()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_140()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_20() { - if (jj_3R_36()) - return true; - if (jj_scan_token(CONCAT)) - return true; - return false; - } - - private boolean jj_3R_131() { - if (jj_3R_24()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_138()) - jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_19() { - if (jj_3R_24()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(9)) { - jj_scanpos = xsp; - if (jj_scan_token(10)) { - jj_scanpos = xsp; - if (jj_scan_token(11)) { - jj_scanpos = xsp; - if (jj_scan_token(12)) - return true; - } - } - } - return false; - } - - private boolean jj_3_1() { - if (jj_3R_14()) - return true; - if (jj_scan_token(DOT)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_15()) - jj_scanpos = xsp; - if (jj_scan_token(ASTERISK)) - return true; - return false; - } - - private boolean jj_3R_41() { - if (jj_scan_token(POLYGON)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_139()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_140()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_140()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_140()) - return true; - Token xsp; - while(true) { - xsp = jj_scanpos; - if (jj_3R_141()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_40() { - if (jj_3R_59()) - return true; - return false; - } - - private boolean jj_3R_72() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3_10() { - if (jj_3R_23()) - return true; - return false; - } - - private boolean jj_3R_113() { - if (jj_3R_131()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_132()) - jj_scanpos = xsp; - return false; - } - - private boolean jj_3_9() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3_7() { - if (jj_scan_token(REGULAR_IDENTIFIER_CANDIDATE)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - return false; - } - - private boolean jj_3R_39() { - if (jj_scan_token(CIRCLE)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_139()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_140()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3_6() { - if (jj_scan_token(LEFT_PAR)) - return true; - return false; - } - - private boolean jj_3_5() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(65)) { - jj_scanpos = xsp; - if (jj_scan_token(67)) { - jj_scanpos = xsp; - if (jj_3R_20()) - return true; - } - } - return false; - } - - private boolean jj_3R_38() { - if (jj_scan_token(CENTROID)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_120()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3_4() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_18()) { - jj_scanpos = xsp; - if (jj_3R_19()) - return true; - } - return false; - } - - private boolean jj_3R_18() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(9)) { - jj_scanpos = xsp; - if (jj_scan_token(10)) - return true; - } - return false; - } - - private boolean jj_3_11() { - if (jj_3R_24()) - return true; - return false; - } - - private boolean jj_3R_71() { - if (jj_3R_36()) - return true; - return false; - } - - private boolean jj_3R_70() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3_8() { - if (jj_3R_21()) - return true; - return false; - } - - private boolean jj_3R_69() { - if (jj_3R_26()) - return true; - return false; - } - - private boolean jj_3R_37() { - if (jj_scan_token(BOX)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_139()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_140()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_68() { - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_50()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_67() { - if (jj_3R_29()) - return true; - return false; - } - - private boolean jj_3R_153() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3R_66() { - if (jj_3R_113()) - return true; - return false; - } - - private boolean jj_3R_145() { - if (jj_3R_59()) - return true; - return false; - } - - private boolean jj_3R_52() { - if (jj_scan_token(SELECT)) - return true; - return false; - } - - private boolean jj_3R_126() { - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_50()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_21() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_37()) { - jj_scanpos = xsp; - if (jj_3R_38()) { - jj_scanpos = xsp; - if (jj_3R_39()) { - jj_scanpos = xsp; - if (jj_3R_40()) { - jj_scanpos = xsp; - if (jj_3R_41()) - return true; - } - } - } - } - return false; - } - - private boolean jj_3R_149() { - if (jj_3R_50()) - return true; - return false; - } - - private boolean jj_3R_143() { - if (jj_3R_59()) - return true; - return false; - } - - private boolean jj_3R_125() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3R_148() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3R_50() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_66()) { - jj_scanpos = xsp; - if (jj_3R_67()) { - jj_scanpos = xsp; - if (jj_3R_68()) { - jj_scanpos = xsp; - if (jj_3R_69()) { - jj_scanpos = xsp; - if (jj_3_8()) { - jj_scanpos = xsp; - if (jj_3R_70()) { - jj_scanpos = xsp; - if (jj_3R_71()) { - jj_scanpos = xsp; - if (jj_3_11()) { - jj_scanpos = xsp; - if (jj_3R_72()) - return true; - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_152() { - if (jj_3R_59()) - return true; - return false; - } - - private boolean jj_3R_124() { - if (jj_3R_130()) - return true; - return false; - } - - private boolean jj_3R_139() { - if (jj_3R_29()) - return true; - return false; - } - - private boolean jj_3R_123() { - if (jj_3R_129()) - return true; - return false; - } - - private boolean jj_3R_16() { - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_33()) - return true; - return false; - } - - private boolean jj_3R_122() { - if (jj_3R_23()) - return true; - return false; - } - - private boolean jj_3R_116() { - if (jj_scan_token(FULL)) - return true; - return false; - } - - private boolean jj_3R_147() { - if (jj_3R_59()) - return true; - return false; - } - - private boolean jj_3R_84() { - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_83() { - if (jj_3R_130()) - return true; - return false; - } - - private boolean jj_3R_79() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_122()) { - jj_scanpos = xsp; - if (jj_3R_123()) { - jj_scanpos = xsp; - if (jj_3R_124()) { - jj_scanpos = xsp; - if (jj_3R_125()) { - jj_scanpos = xsp; - if (jj_3R_126()) - return true; - } - } - } - } - return false; - } - - private boolean jj_3R_82() { - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3R_81() { - if (jj_3R_129()) - return true; - return false; - } - - private boolean jj_3R_112() { - if (jj_scan_token(DISTANCE)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_147()) { - jj_scanpos = xsp; - if (jj_3R_148()) - return true; - } - if (jj_scan_token(COMMA)) - return true; - xsp = jj_scanpos; - if (jj_3R_152()) { - jj_scanpos = xsp; - if (jj_3R_153()) - return true; - } - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_111() { - if (jj_scan_token(COORD2)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_145()) { - jj_scanpos = xsp; - if (jj_3R_146()) - return true; - } - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_110() { - if (jj_scan_token(COORD1)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_143()) { - jj_scanpos = xsp; - if (jj_3R_144()) - return true; - } - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_109() { - if (jj_scan_token(AREA)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_120()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_119() { - if (jj_scan_token(FULL)) - return true; - return false; - } - - private boolean jj_3R_62() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_81()) { - jj_scanpos = xsp; - if (jj_3R_82()) { - jj_scanpos = xsp; - if (jj_3R_83()) { - jj_scanpos = xsp; - if (jj_3R_84()) - return true; - } - } - } - return false; - } - - private boolean jj_3R_108() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(60)) { - jj_scanpos = xsp; - if (jj_scan_token(61)) - return true; - } - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_120()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_120()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_33() { - if (jj_3R_52()) - return true; - return false; - } - - private boolean jj_3R_115() { - if (jj_scan_token(RIGHT)) - return true; - return false; - } - - private boolean jj_3R_155() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(9)) { - jj_scanpos = xsp; - if (jj_scan_token(10)) - return true; - } - return false; - } - - private boolean jj_3R_154() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_155()) - jj_scanpos = xsp; - if (jj_scan_token(UNSIGNED_INTEGER)) - return true; - return false; - } - - private boolean jj_3R_65() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_108()) { - jj_scanpos = xsp; - if (jj_3R_109()) { - jj_scanpos = xsp; - if (jj_3R_110()) { - jj_scanpos = xsp; - if (jj_3R_111()) { - jj_scanpos = xsp; - if (jj_3R_112()) - return true; - } - } - } - } - return false; - } - - private boolean jj_3R_140() { - if (jj_3R_113()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_113()) - return true; - return false; - } - - private boolean jj_3R_137() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(49)) { - jj_scanpos = xsp; - if (jj_scan_token(50)) { - jj_scanpos = xsp; - if (jj_scan_token(51)) { - jj_scanpos = xsp; - if (jj_scan_token(52)) - return true; - } - } - } - if (jj_scan_token(LEFT_PAR)) - return true; - xsp = jj_scanpos; - if (jj_scan_token(20)) - jj_scanpos = xsp; - if (jj_3R_50()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_136() { - if (jj_scan_token(COUNT)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(20)) - jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(11)) { - jj_scanpos = xsp; - if (jj_3R_149()) - return true; - } - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_118() { - if (jj_scan_token(RIGHT)) - return true; - return false; - } - - private boolean jj_3R_129() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(95)) { - jj_scanpos = xsp; - if (jj_scan_token(96)) { - jj_scanpos = xsp; - if (jj_scan_token(97)) - return true; - } - } - return false; - } - - private boolean jj_3R_130() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_136()) { - jj_scanpos = xsp; - if (jj_3R_137()) - return true; - } - return false; - } - - private boolean jj_3R_114() { - if (jj_scan_token(LEFT)) - return true; - return false; - } - - private boolean jj_3R_73() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_114()) { - jj_scanpos = xsp; - if (jj_3R_115()) { - jj_scanpos = xsp; - if (jj_3R_116()) - return true; - } - } - return false; - } - - private boolean jj_3R_53() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(25)) { - jj_scanpos = xsp; - if (jj_3R_73()) - return true; - } - return false; - } - - private boolean jj_3R_43() { - if (jj_scan_token(STRING_LITERAL)) - return true; - return false; - } - - private boolean jj_3R_23() { - Token xsp; - if (jj_3R_43()) - return true; - while(true) { - xsp = jj_scanpos; - if (jj_3R_43()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_117() { - if (jj_scan_token(LEFT)) - return true; - return false; - } - - private boolean jj_3R_74() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_117()) { - jj_scanpos = xsp; - if (jj_3R_118()) { - jj_scanpos = xsp; - if (jj_3R_119()) - return true; - } - } - xsp = jj_scanpos; - if (jj_scan_token(26)) - jj_scanpos = xsp; - return false; - } - - private boolean jj_3_18() { - if (jj_3R_16()) - return true; - return false; - } - - private boolean jj_3R_54() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(25)) { - jj_scanpos = xsp; - if (jj_3R_74()) - return true; - } - return false; - } - - private boolean jj_3R_35() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_54()) - jj_scanpos = xsp; - if (jj_scan_token(JOIN)) - return true; - if (jj_3R_55()) - return true; - return false; - } - - private boolean jj_3R_34() { - if (jj_scan_token(NATURAL)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_53()) - jj_scanpos = xsp; - if (jj_scan_token(JOIN)) - return true; - return false; - } - - private boolean jj_3R_28() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(36)) - jj_scanpos = xsp; - if (jj_scan_token(BETWEEN)) - return true; - if (jj_3R_50()) - return true; - return false; - } - - private boolean jj_3_15() { - if (jj_3R_28()) - return true; - return false; - } - - private boolean jj_3R_17() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_34()) { - jj_scanpos = xsp; - if (jj_3R_35()) - return true; - } - return false; - } - - private boolean jj_3_17() { - if (jj_3R_29()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(36)) - jj_scanpos = xsp; - if (jj_scan_token(LIKE)) - return true; - return false; - } - - private boolean jj_3R_135() { - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_50()) - return true; - return false; - } - - private boolean jj_3R_76() { - if (jj_scan_token(LEFT_PAR)) - return true; - return false; - } - - private boolean jj_3_3() { - if (jj_3R_17()) - return true; - return false; - } - - private boolean jj_3_16() { - if (jj_3R_22()) - return true; - if (jj_scan_token(IS)) - return true; - return false; - } - - /** Generated Token Manager. */ - public ADQLParser201TokenManager token_source; - SimpleCharStream jj_input_stream; - /** Current token. */ - public Token token; - /** Next token. */ - public Token jj_nt; - private int jj_ntk; - private Token jj_scanpos, jj_lastpos; - private int jj_la; - private int jj_gen; - final private int[] jj_la1 = new int[97]; - static private int[] jj_la1_0; - static private int[] jj_la1_1; - static private int[] jj_la1_2; - static private int[] jj_la1_3; - static { - jj_la1_init_0(); - jj_la1_init_1(); - jj_la1_init_2(); - jj_la1_init_3(); - } - - private static void jj_la1_init_0() { - jj_la1_0 = new int[]{ 0x81, 0x0, 0x0, 0x0, 0x0, 0x100000, 0x200000, 0x40, 0x0, 0x0, 0x800000, 0x800000, 0x800, 0x608, 0x40, 0x40, 0x40, 0x0, 0x20, 0x20, 0x20, 0x0, 0x0, 0x0, 0x800000, 0x800000, 0x800000, 0x0, 0x8, 0x7b000000, 0x38000000, 0x4000000, 0x3a000000, 0x3a000000, 0x38000000, 0x4000000, 0x3a000000, 0x3a000000, 0x40, 0x80000000, 0x7b000000, 0x0, 0x0, 0x0, 0x600, 0x600, 0x8, 0x8, 0x0, 0x600, 0x600, 0x1800, 0x1800, 0x600, 0x600, 0x8, 0x100, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x7e000, 0x0, 0x0, 0x608, 0x7e000, 0x0, 0x0, 0x40, 0x8, 0x100000, 0xe08, 0x0, 0x100000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x608, 0x40, 0x40, 0x0, 0x0, 0x40, 0x608, }; - } - - private static void jj_la1_init_1() { - jj_la1_1 = new int[]{ 0x0, 0x2, 0x1000, 0x2000, 0x4000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf7fe0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18000, 0x18000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3e0000, 0x3e0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3e0000, 0x0, 0x0, 0x3e0000, 0x7c00000, 0x10, 0xc, 0xc, 0x10, 0x0, 0x10, 0x10, 0x0, 0x210, 0x400, 0xf7fe0000, 0x0, 0x10, 0x10, 0x0, 0x0, 0x0, 0xf7fe0000, 0x1e0000, 0x0, 0x3e0000, 0x30000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0xf0000000, 0x0, 0x7c00000, 0xf0000000, 0xf03e0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf7fe0000, }; - } - - private static void jj_la1_init_2() { - jj_la1_2 = new int[]{ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc7ffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40000000, 0x80000000, 0x0, 0x0, 0x0, 0x80000000, 0xc0000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80000000, 0x0, 0xa, 0xc0000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc7ffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc7ffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0x0, 0x0, 0x7fffff5, 0x87fffff5, 0x0, 0x0, 0x7fff0, 0x7f80000, 0x0, 0xc7ffffff, }; - } - - private static void jj_la1_init_3() { - jj_la1_3 = new int[]{ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x60, 0x60, 0x0, 0x60, 0x0, 0x63, 0x0, 0x0, 0x0, 0x60, 0x0, 0x0, 0x0, 0x62, 0x0, 0x0, 0x0, 0x60, 0x0, 0x60, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x3, 0x0, 0x0, 0x63, 0x63, 0x60, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x63, 0x0, 0x0, 0x63, 0x60, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x63, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x63, 0x0, 0x0, 0x0, 0x0, 0x60, 0x60, 0x60, 0x60, 0x0, 0x0, 0x0, 0x40, 0x63, 0x0, 0x0, 0x0, 0x0, 0x0, 0x63, }; - } - - final private JJCalls[] jj_2_rtns = new JJCalls[18]; - private boolean jj_rescan = false; - private int jj_gc = 0; - - /** Constructor with InputStream. */ - public ADQLParser201(java.io.InputStream stream) { - this(stream, (String)null); - } - - /** Constructor with InputStream and supplied encoding */ - public ADQLParser201(java.io.InputStream stream, String encoding) { - try { - jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); - } catch(java.io.UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - token_source = new ADQLParser201TokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for(int i = 0; i < 97; i++) - jj_la1[i] = -1; - for(int i = 0; i < jj_2_rtns.length; i++) - jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - @Override - public void ReInit(java.io.InputStream stream) { - ReInit(stream, null); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream stream, String encoding) { - try { - jj_input_stream.ReInit(stream, encoding, 1, 1); - } catch(java.io.UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for(int i = 0; i < 97; i++) - jj_la1[i] = -1; - for(int i = 0; i < jj_2_rtns.length; i++) - jj_2_rtns[i] = new JJCalls(); - } - - /** Constructor. */ - public ADQLParser201(java.io.Reader stream) { - jj_input_stream = new SimpleCharStream(stream, 1, 1); - token_source = new ADQLParser201TokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for(int i = 0; i < 97; i++) - jj_la1[i] = -1; - for(int i = 0; i < jj_2_rtns.length; i++) - jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - @Override - public void ReInit(java.io.Reader stream) { - jj_input_stream.ReInit(stream, 1, 1); - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for(int i = 0; i < 97; i++) - jj_la1[i] = -1; - for(int i = 0; i < jj_2_rtns.length; i++) - jj_2_rtns[i] = new JJCalls(); - } - - /** Constructor with generated Token Manager. */ - public ADQLParser201(ADQLParser201TokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for(int i = 0; i < 97; i++) - jj_la1[i] = -1; - for(int i = 0; i < jj_2_rtns.length; i++) - jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - public void ReInit(ADQLParser201TokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for(int i = 0; i < 97; i++) - jj_la1[i] = -1; - for(int i = 0; i < jj_2_rtns.length; i++) - jj_2_rtns[i] = new JJCalls(); - } - - private Token jj_consume_token(int kind) throws ParseException { - Token oldToken; - if ((oldToken = token).next != null) - token = token.next; - else - token = token.next = token_source.getNextToken(); - jj_ntk = -1; - if (token.kind == kind) { - jj_gen++; - if (++jj_gc > 100) { - jj_gc = 0; - for(int i = 0; i < jj_2_rtns.length; i++) { - JJCalls c = jj_2_rtns[i]; - while(c != null) { - if (c.gen < jj_gen) - c.first = null; - c = c.next; - } - } - } - trace_token(token, ""); - return token; - } - token = oldToken; - jj_kind = kind; - throw generateParseException(); - } - - @SuppressWarnings("serial") - static private final class LookaheadSuccess extends java.lang.Error { - } - - final private LookaheadSuccess jj_ls = new LookaheadSuccess(); - - private boolean jj_scan_token(int kind) { - if (jj_scanpos == jj_lastpos) { - jj_la--; - if (jj_scanpos.next == null) { - jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); - } else { - jj_lastpos = jj_scanpos = jj_scanpos.next; - } - } else { - jj_scanpos = jj_scanpos.next; - } - if (jj_rescan) { - int i = 0; - Token tok = token; - while(tok != null && tok != jj_scanpos) { - i++; - tok = tok.next; - } - if (tok != null) - jj_add_error_token(kind, i); - } - if (jj_scanpos.kind != kind) - return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) - throw jj_ls; - return false; - } - - /** Get the next Token. */ - final public Token getNextToken() { - if (token.next != null) - token = token.next; - else - token = token.next = token_source.getNextToken(); - jj_ntk = -1; - jj_gen++; - trace_token(token, " (in getNextToken)"); - return token; - } - - /** Get the specific Token. */ - final public Token getToken(int index) { - Token t = token; - for(int i = 0; i < index; i++) { - if (t.next != null) - t = t.next; - else - t = t.next = token_source.getNextToken(); - } - return t; - } - - private int jj_ntk_f() { - if ((jj_nt = token.next) == null) - return (jj_ntk = (token.next = token_source.getNextToken()).kind); - else - return (jj_ntk = jj_nt.kind); - } - - private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>(); - private int[] jj_expentry; - private int jj_kind = -1; - private int[] jj_lasttokens = new int[100]; - private int jj_endpos; - - private void jj_add_error_token(int kind, int pos) { - if (pos >= 100) - return; - if (pos == jj_endpos + 1) { - jj_lasttokens[jj_endpos++] = kind; - } else if (jj_endpos != 0) { - jj_expentry = new int[jj_endpos]; - for(int i = 0; i < jj_endpos; i++) { - jj_expentry[i] = jj_lasttokens[i]; - } - jj_entries_loop: for(java.util.Iterator<?> it = jj_expentries.iterator(); it.hasNext();) { - int[] oldentry = (int[])(it.next()); - if (oldentry.length == jj_expentry.length) { - for(int i = 0; i < jj_expentry.length; i++) { - if (oldentry[i] != jj_expentry[i]) { - continue jj_entries_loop; - } - } - jj_expentries.add(jj_expentry); - break jj_entries_loop; - } - } - if (pos != 0) - jj_lasttokens[(jj_endpos = pos) - 1] = kind; - } - } - - /** Generate ParseException. */ - public ParseException generateParseException() { - jj_expentries.clear(); - boolean[] la1tokens = new boolean[104]; - if (jj_kind >= 0) { - la1tokens[jj_kind] = true; - jj_kind = -1; - } - for(int i = 0; i < 97; i++) { - if (jj_la1[i] == jj_gen) { - for(int j = 0; j < 32; j++) { - if ((jj_la1_0[i] & (1 << j)) != 0) { - la1tokens[j] = true; - } - if ((jj_la1_1[i] & (1 << j)) != 0) { - la1tokens[32 + j] = true; - } - if ((jj_la1_2[i] & (1 << j)) != 0) { - la1tokens[64 + j] = true; - } - if ((jj_la1_3[i] & (1 << j)) != 0) { - la1tokens[96 + j] = true; - } - } - } - } - for(int i = 0; i < 104; i++) { - if (la1tokens[i]) { - jj_expentry = new int[1]; - jj_expentry[0] = i; - jj_expentries.add(jj_expentry); - } - } - jj_endpos = 0; - jj_rescan_token(); - jj_add_error_token(0, 0); - int[][] exptokseq = new int[jj_expentries.size()][]; - for(int i = 0; i < jj_expentries.size(); i++) { - exptokseq[i] = jj_expentries.get(i); - } - return new ParseException(token, exptokseq, tokenImage); - } - - private int trace_indent = 0; - private boolean trace_enabled = true; - - /** Enable tracing. */ - final public void enable_tracing() { - trace_enabled = true; - } - - /** Disable tracing. */ - final public void disable_tracing() { - trace_enabled = false; - } - - private void trace_call(String s) { - if (trace_enabled) { - for(int i = 0; i < trace_indent; i++) { - System.out.print(" "); - } - System.out.println("Call: " + s); - } - trace_indent = trace_indent + 2; - } - - private void trace_return(String s) { - trace_indent = trace_indent - 2; - if (trace_enabled) { - for(int i = 0; i < trace_indent; i++) { - System.out.print(" "); - } - System.out.println("Return: " + s); - } - } - - private void trace_token(Token t, String where) { - if (trace_enabled) { - for(int i = 0; i < trace_indent; i++) { - System.out.print(" "); - } - System.out.print("Consumed token: <" + tokenImage[t.kind]); - if (t.kind != 0 && !tokenImage[t.kind].equals("\"" + t.image + "\"")) { - System.out.print(": \"" + t.image + "\""); - } - System.out.println(" at line " + t.beginLine + " column " + t.beginColumn + ">" + where); - } - } - - private void trace_scan(Token t1, int t2) { - if (trace_enabled) { - for(int i = 0; i < trace_indent; i++) { - System.out.print(" "); - } - System.out.print("Visited token: <" + tokenImage[t1.kind]); - if (t1.kind != 0 && !tokenImage[t1.kind].equals("\"" + t1.image + "\"")) { - System.out.print(": \"" + t1.image + "\""); - } - System.out.println(" at line " + t1.beginLine + " column " + t1.beginColumn + ">; Expected token: <" + tokenImage[t2] + ">"); - } - } - - private void jj_rescan_token() { - jj_rescan = true; - for(int i = 0; i < 18; i++) { - try { - JJCalls p = jj_2_rtns[i]; - do { - if (p.gen > jj_gen) { - jj_la = p.arg; - jj_lastpos = jj_scanpos = p.first; - switch(i) { - case 0: - jj_3_1(); - break; - case 1: - jj_3_2(); - break; - case 2: - jj_3_3(); - break; - case 3: - jj_3_4(); - break; - case 4: - jj_3_5(); - break; - case 5: - jj_3_6(); - break; - case 6: - jj_3_7(); - break; - case 7: - jj_3_8(); - break; - case 8: - jj_3_9(); - break; - case 9: - jj_3_10(); - break; - case 10: - jj_3_11(); - break; - case 11: - jj_3_12(); - break; - case 12: - jj_3_13(); - break; - case 13: - jj_3_14(); - break; - case 14: - jj_3_15(); - break; - case 15: - jj_3_16(); - break; - case 16: - jj_3_17(); - break; - case 17: - jj_3_18(); - break; - } - } - p = p.next; - } while(p != null); - } catch(LookaheadSuccess ls) { - } - } - jj_rescan = false; - } - - private void jj_save(int index, int xla) { - JJCalls p = jj_2_rtns[index]; - while(p.gen > jj_gen) { - if (p.next == null) { - p = p.next = new JJCalls(); - break; - } - p = p.next; - } - p.gen = jj_gen + xla - jj_la; - p.first = token; - p.arg = xla; - } - - static final class JJCalls { - int gen; - Token first; - int arg; - JJCalls next; - } - -} diff --git a/src/adql/parser/ADQLParser201Constants.java b/src/adql/parser/ADQLParser201Constants.java deleted file mode 100644 index 4a67dbb8732044da618d4921b89d1d5380c0fc76..0000000000000000000000000000000000000000 --- a/src/adql/parser/ADQLParser201Constants.java +++ /dev/null @@ -1,323 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. ADQLParser201Constants.java */ -package adql.parser; - - -/** - * Token literal values and constants. - * Generated by org.javacc.parser.OtherFilesGen#start() - */ -public interface ADQLParser201Constants { - - /** End of File. */ - int EOF = 0; - /** RegularExpression Id. */ - int SQL_RESERVED_WORD = 2; - /** RegularExpression Id. */ - int LEFT_PAR = 3; - /** RegularExpression Id. */ - int RIGHT_PAR = 4; - /** RegularExpression Id. */ - int DOT = 5; - /** RegularExpression Id. */ - int COMMA = 6; - /** RegularExpression Id. */ - int EOQ = 7; - /** RegularExpression Id. */ - int CONCAT = 8; - /** RegularExpression Id. */ - int PLUS = 9; - /** RegularExpression Id. */ - int MINUS = 10; - /** RegularExpression Id. */ - int ASTERISK = 11; - /** RegularExpression Id. */ - int DIVIDE = 12; - /** RegularExpression Id. */ - int EQUAL = 13; - /** RegularExpression Id. */ - int NOT_EQUAL = 14; - /** RegularExpression Id. */ - int LESS_THAN = 15; - /** RegularExpression Id. */ - int LESS_EQUAL_THAN = 16; - /** RegularExpression Id. */ - int GREATER_THAN = 17; - /** RegularExpression Id. */ - int GREATER_EQUAL_THAN = 18; - /** RegularExpression Id. */ - int SELECT = 19; - /** RegularExpression Id. */ - int QUANTIFIER = 20; - /** RegularExpression Id. */ - int TOP = 21; - /** RegularExpression Id. */ - int FROM = 22; - /** RegularExpression Id. */ - int AS = 23; - /** RegularExpression Id. */ - int NATURAL = 24; - /** RegularExpression Id. */ - int INNER = 25; - /** RegularExpression Id. */ - int OUTER = 26; - /** RegularExpression Id. */ - int RIGHT = 27; - /** RegularExpression Id. */ - int LEFT = 28; - /** RegularExpression Id. */ - int FULL = 29; - /** RegularExpression Id. */ - int JOIN = 30; - /** RegularExpression Id. */ - int ON = 31; - /** RegularExpression Id. */ - int USING = 32; - /** RegularExpression Id. */ - int WHERE = 33; - /** RegularExpression Id. */ - int AND = 34; - /** RegularExpression Id. */ - int OR = 35; - /** RegularExpression Id. */ - int NOT = 36; - /** RegularExpression Id. */ - int IS = 37; - /** RegularExpression Id. */ - int NULL = 38; - /** RegularExpression Id. */ - int BETWEEN = 39; - /** RegularExpression Id. */ - int LIKE = 40; - /** RegularExpression Id. */ - int IN = 41; - /** RegularExpression Id. */ - int EXISTS = 42; - /** RegularExpression Id. */ - int BY = 43; - /** RegularExpression Id. */ - int GROUP = 44; - /** RegularExpression Id. */ - int HAVING = 45; - /** RegularExpression Id. */ - int ORDER = 46; - /** RegularExpression Id. */ - int ASC = 47; - /** RegularExpression Id. */ - int DESC = 48; - /** RegularExpression Id. */ - int AVG = 49; - /** RegularExpression Id. */ - int MAX = 50; - /** RegularExpression Id. */ - int MIN = 51; - /** RegularExpression Id. */ - int SUM = 52; - /** RegularExpression Id. */ - int COUNT = 53; - /** RegularExpression Id. */ - int BOX = 54; - /** RegularExpression Id. */ - int CENTROID = 55; - /** RegularExpression Id. */ - int CIRCLE = 56; - /** RegularExpression Id. */ - int POINT = 57; - /** RegularExpression Id. */ - int POLYGON = 58; - /** RegularExpression Id. */ - int REGION = 59; - /** RegularExpression Id. */ - int CONTAINS = 60; - /** RegularExpression Id. */ - int INTERSECTS = 61; - /** RegularExpression Id. */ - int AREA = 62; - /** RegularExpression Id. */ - int COORD1 = 63; - /** RegularExpression Id. */ - int COORD2 = 64; - /** RegularExpression Id. */ - int COORDSYS = 65; - /** RegularExpression Id. */ - int DISTANCE = 66; - /** RegularExpression Id. */ - int LOWER = 67; - /** RegularExpression Id. */ - int ABS = 68; - /** RegularExpression Id. */ - int CEILING = 69; - /** RegularExpression Id. */ - int DEGREES = 70; - /** RegularExpression Id. */ - int EXP = 71; - /** RegularExpression Id. */ - int FLOOR = 72; - /** RegularExpression Id. */ - int LOG = 73; - /** RegularExpression Id. */ - int LOG10 = 74; - /** RegularExpression Id. */ - int MOD = 75; - /** RegularExpression Id. */ - int PI = 76; - /** RegularExpression Id. */ - int POWER = 77; - /** RegularExpression Id. */ - int RADIANS = 78; - /** RegularExpression Id. */ - int RAND = 79; - /** RegularExpression Id. */ - int ROUND = 80; - /** RegularExpression Id. */ - int SQRT = 81; - /** RegularExpression Id. */ - int TRUNCATE = 82; - /** RegularExpression Id. */ - int ACOS = 83; - /** RegularExpression Id. */ - int ASIN = 84; - /** RegularExpression Id. */ - int ATAN = 85; - /** RegularExpression Id. */ - int ATAN2 = 86; - /** RegularExpression Id. */ - int COS = 87; - /** RegularExpression Id. */ - int COT = 88; - /** RegularExpression Id. */ - int SIN = 89; - /** RegularExpression Id. */ - int TAN = 90; - /** RegularExpression Id. */ - int STRING_LITERAL = 94; - /** RegularExpression Id. */ - int SCIENTIFIC_NUMBER = 95; - /** RegularExpression Id. */ - int UNSIGNED_FLOAT = 96; - /** RegularExpression Id. */ - int UNSIGNED_INTEGER = 97; - /** RegularExpression Id. */ - int DIGIT = 98; - /** RegularExpression Id. */ - int DELIMITED_IDENTIFIER = 101; - /** RegularExpression Id. */ - int REGULAR_IDENTIFIER_CANDIDATE = 102; - /** RegularExpression Id. */ - int Letter = 103; - - /** Lexical state. */ - int DEFAULT = 0; - /** Lexical state. */ - int WithinString = 1; - /** Lexical state. */ - int WithinDelimitedId = 2; - - /** Literal token values. */ - String[] tokenImage = { - "<EOF>", - "<token of kind 1>", - "<SQL_RESERVED_WORD>", - "\"(\"", - "\")\"", - "\".\"", - "\",\"", - "\";\"", - "\"||\"", - "\"+\"", - "\"-\"", - "\"*\"", - "\"/\"", - "\"=\"", - "<NOT_EQUAL>", - "\"<\"", - "\"<=\"", - "\">\"", - "\">=\"", - "\"SELECT\"", - "<QUANTIFIER>", - "\"TOP\"", - "\"FROM\"", - "\"AS\"", - "\"NATURAL\"", - "\"INNER\"", - "\"OUTER\"", - "\"RIGHT\"", - "\"LEFT\"", - "\"FULL\"", - "\"JOIN\"", - "\"ON\"", - "\"USING\"", - "\"WHERE\"", - "\"AND\"", - "\"OR\"", - "\"NOT\"", - "\"IS\"", - "\"NULL\"", - "\"BETWEEN\"", - "\"LIKE\"", - "\"IN\"", - "\"EXISTS\"", - "\"BY\"", - "\"GROUP\"", - "\"HAVING\"", - "\"ORDER\"", - "\"ASC\"", - "\"DESC\"", - "\"AVG\"", - "\"MAX\"", - "\"MIN\"", - "\"SUM\"", - "\"COUNT\"", - "\"BOX\"", - "\"CENTROID\"", - "\"CIRCLE\"", - "\"POINT\"", - "\"POLYGON\"", - "\"REGION\"", - "\"CONTAINS\"", - "\"INTERSECTS\"", - "\"AREA\"", - "\"COORD1\"", - "\"COORD2\"", - "\"COORDSYS\"", - "\"DISTANCE\"", - "\"LOWER\"", - "\"ABS\"", - "\"CEILING\"", - "\"DEGREES\"", - "\"EXP\"", - "\"FLOOR\"", - "\"LOG\"", - "\"LOG10\"", - "\"MOD\"", - "\"PI\"", - "\"POWER\"", - "\"RADIANS\"", - "\"RAND\"", - "\"ROUND\"", - "\"SQRT\"", - "\"TRUNCATE\"", - "\"ACOS\"", - "\"ASIN\"", - "\"ATAN\"", - "\"ATAN2\"", - "\"COS\"", - "\"COT\"", - "\"SIN\"", - "\"TAN\"", - "<token of kind 91>", - "\"\\\'\"", - "<token of kind 93>", - "\"\\\'\"", - "<SCIENTIFIC_NUMBER>", - "<UNSIGNED_FLOAT>", - "<UNSIGNED_INTEGER>", - "<DIGIT>", - "\"\\\"\"", - "<token of kind 100>", - "\"\\\"\"", - "<REGULAR_IDENTIFIER_CANDIDATE>", - "<Letter>", - }; - -} diff --git a/src/adql/parser/ADQLParser201TokenManager.java b/src/adql/parser/ADQLParser201TokenManager.java deleted file mode 100644 index 6e239720d001b901c074a1159e828c0c95d08103..0000000000000000000000000000000000000000 --- a/src/adql/parser/ADQLParser201TokenManager.java +++ /dev/null @@ -1,8470 +0,0 @@ -/* ADQLParser201TokenManager.java */ -/* Generated By:JavaCC: Do not edit this line. ADQLParser201TokenManager.java */ -package adql.parser; -/* - * This file is part of ADQLLibrary. - * - * ADQLLibrary is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * ADQLLibrary is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2019 - UDS/Centre de Données astronomiques de Strasbourg (CDS) - */ - -import java.util.Stack; -import java.util.Vector; -import java.util.ArrayList; -import java.util.Collection; -import java.io.FileReader; -import java.io.IOException; -import adql.db.exception.UnsupportedFeatureException; -import adql.db.exception.UnresolvedIdentifiersException; -import adql.parser.ADQLParserFactory.ADQLVersion; -import adql.parser.IdentifierItems.IdentifierItem; -import adql.parser.ADQLQueryFactory.JoinType; -import adql.parser.feature.FeatureSet; -import adql.parser.feature.LanguageFeature; -import adql.query.*; -import adql.query.from.*; -import adql.query.constraint.*; -import adql.query.operand.*; -import adql.query.operand.function.*; -import adql.query.operand.function.string.*; -import adql.query.operand.function.geometry.*; -import adql.query.operand.function.geometry.GeometryFunction.GeometryValue; -import adql.search.SearchOptionalFeaturesHandler; -import adql.translator.PostgreSQLTranslator; -import adql.translator.TranslationException; - -/** Token Manager. */ -@SuppressWarnings("unused")public class ADQLParser201TokenManager implements ADQLParser201Constants { - protected void CommonTokenAction(final Token t) { - t.adqlVersion = ADQLParserFactory.ADQLVersion.V2_1; - } - - /** Debug output. */ - public java.io.PrintStream debugStream = System.out; - /** Set debug output. */ - public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } -private final int jjStopStringLiteralDfa_2(int pos, long active0, long active1){ - switch (pos) - { - default : - return -1; - } -} -private final int jjStartNfa_2(int pos, long active0, long active1){ - return jjMoveNfa_2(jjStopStringLiteralDfa_2(pos, active0, active1), pos + 1); -} -private int jjStopAtPos(int pos, int kind) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - return pos + 1; -} -private int jjMoveStringLiteralDfa0_2(){ - switch(curChar) - { - case 34: - return jjStartNfaWithStates_2(0, 101, 1); - default : - return jjMoveNfa_2(0, 0); - } -} -private int jjStartNfaWithStates_2(int pos, int kind, int state) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return pos + 1; } - return jjMoveNfa_2(state, pos + 1); -} -static final long[] jjbitVec0 = { - 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL -}; -private int jjMoveNfa_2(int startState, int curPos) -{ - int startsAt = 0; - jjnewStateCnt = 3; - int i = 1; - jjstateSet[0] = startState; - int kind = 0x7fffffff; - for (;;) - { - if (++jjround == 0x7fffffff) - ReInitRounds(); - if (curChar < 64) - { - long l = 1L << curChar; - do - { - switch(jjstateSet[--i]) - { - case 0: - if ((0xfffffffbffffffffL & l) != 0L) - { - if (kind > 100) - kind = 100; - } - else if (curChar == 34) - jjstateSet[jjnewStateCnt++] = 1; - break; - case 1: - if (curChar == 34 && kind > 100) - kind = 100; - break; - case 2: - if (curChar == 34) - jjstateSet[jjnewStateCnt++] = 1; - break; - default : break; - } - } while(i != startsAt); - } - else if (curChar < 128) - { - long l = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 0: - kind = 100; - break; - default : break; - } - } while(i != startsAt); - } - else - { - int i2 = (curChar & 0xff) >> 6; - long l2 = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 0: - if ((jjbitVec0[i2] & l2) != 0L && kind > 100) - kind = 100; - break; - default : break; - } - } while(i != startsAt); - } - if (kind != 0x7fffffff) - { - jjmatchedKind = kind; - jjmatchedPos = curPos; - kind = 0x7fffffff; - } - ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt))) - return curPos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return curPos; } - } -} -private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1){ - switch (pos) - { - case 0: - if ((active0 & 0x200000000000L) != 0L) - { - jjmatchedKind = 102; - return 5; - } - if ((active0 & 0x200000000L) != 0L) - { - jjmatchedKind = 102; - return 794; - } - if ((active0 & 0x40000000000L) != 0L || (active1 & 0x80L) != 0L) - { - jjmatchedKind = 102; - return 249; - } - if ((active0 & 0x40088000000000L) != 0L) - { - jjmatchedKind = 102; - return 33; - } - if ((active0 & 0x10000000080000L) != 0L || (active1 & 0x2020000L) != 0L) - { - jjmatchedKind = 102; - return 587; - } - if ((active0 & 0x100000000L) != 0L) - { - jjmatchedKind = 102; - return 749; - } - if ((active0 & 0x20L) != 0L) - return 962; - if ((active0 & 0x91a0000000000000L) != 0L || (active1 & 0x1800023L) != 0L) - { - jjmatchedKind = 102; - return 52; - } - if ((active0 & 0x600000000000000L) != 0L || (active1 & 0x3000L) != 0L) - { - jjmatchedKind = 102; - return 488; - } - if ((active0 & 0x18000L) != 0L) - return 17; - if ((active0 & 0x4002800400800000L) != 0L || (active1 & 0x780010L) != 0L) - { - jjmatchedKind = 102; - return 907; - } - if ((active0 & 0x10010000000L) != 0L || (active1 & 0x608L) != 0L) - { - jjmatchedKind = 102; - return 404; - } - if ((active0 & 0x400L) != 0L) - return 22; - if ((active0 & 0x2000022002000000L) != 0L) - { - jjmatchedKind = 102; - return 332; - } - if ((active0 & 0x1000000000000L) != 0L || (active1 & 0x44L) != 0L) - { - jjmatchedKind = 102; - return 810; - } - if ((active0 & 0x40000000L) != 0L) - { - jjmatchedKind = 102; - return 963; - } - if ((active0 & 0x200000L) != 0L || (active1 & 0x4040000L) != 0L) - { - jjmatchedKind = 102; - return 667; - } - if ((active0 & 0xc000000000000L) != 0L || (active1 & 0x800L) != 0L) - { - jjmatchedKind = 102; - return 421; - } - if ((active0 & 0x5001000000L) != 0L) - { - jjmatchedKind = 102; - return 436; - } - if ((active0 & 0x20400000L) != 0L || (active1 & 0x100L) != 0L) - { - jjmatchedKind = 102; - return 295; - } - if ((active0 & 0x400884000000L) != 0L) - { - jjmatchedKind = 102; - return 468; - } - if ((active0 & 0x800000008000000L) != 0L || (active1 & 0x1c000L) != 0L) - { - jjmatchedKind = 102; - return 547; - } - if ((active0 & 0x100000000000L) != 0L) - { - jjmatchedKind = 102; - return 315; - } - return -1; - case 1: - if ((active0 & 0x800000000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 546; - } - if ((active0 & 0x2000020002000000L) != 0L) - return 345; - if ((active1 & 0x40000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 714; - } - if ((active1 & 0x80000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 910; - } - if ((active0 & 0x400000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 964; - } - if ((active1 & 0x4000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 666; - } - if ((active0 & 0x182210068400000L) != 0L || (active1 & 0xc020L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 963; - } - if ((active0 & 0x800000800000L) != 0L || (active1 & 0x100000L) != 0L) - return 929; - if ((active1 & 0x2000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 617; - } - if ((active0 & 0x1000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 435; - } - if ((active0 & 0x40000000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 45; - } - if ((active1 & 0x4L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 874; - } - if ((active1 & 0x800L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 428; - } - if ((active1 & 0x608L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 416; - } - if ((active0 & 0x10000000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 653; - } - if ((active0 & 0x100000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 767; - } - if ((active0 & 0x8000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 32; - } - if ((active0 & 0x9020000000000000L) != 0L || (active1 & 0x1800003L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 113; - } - if ((active0 & 0x600000000000000L) != 0L || (active1 & 0x2000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 498; - } - if ((active0 & 0x2000000000L) != 0L) - return 396; - if ((active0 & 0x1000000000000L) != 0L || (active1 & 0x40L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 818; - } - if ((active0 & 0x80000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 594; - } - if ((active0 & 0x200000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 793; - } - if ((active1 & 0x10000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 578; - } - if ((active1 & 0x10L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 906; - } - if ((active0 & 0x8000000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 424; - } - if ((active1 & 0x20000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 634; - } - if ((active0 & 0x4000000000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 965; - } - if ((active0 & 0x4000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 479; - } - if ((active0 & 0x40000000000L) != 0L || (active1 & 0x80L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 264; - } - if ((active0 & 0x4000000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 420; - } - if ((active0 & 0x480800000000L) != 0L || (active1 & 0x1000L) != 0L) - return 963; - if ((active1 & 0x100L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 303; - } - if ((active0 & 0x4000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 451; - } - if ((active0 & 0x1000200000L) != 0L || (active1 & 0x600000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 2; - jjmatchedPos = 1; - } - return 963; - } - if ((active0 & 0x100000000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 324; - } - if ((active0 & 0x80000000L) != 0L) - return 469; - if ((active0 & 0x10000000L) != 0L) - { - if (jjmatchedPos != 1) - { - jjmatchedKind = 102; - jjmatchedPos = 1; - } - return 410; - } - return -1; - case 2: - if ((active0 & 0x8000000000000L) != 0L) - return 423; - if ((active1 & 0x10L) != 0L) - return 905; - if ((active1 & 0x4L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 102; - jjmatchedPos = 2; - } - return 881; - } - if ((active0 & 0x56801400200000L) != 0L || (active1 & 0x7800680L) != 0L) - return 963; - if ((active0 & 0x1000000000000000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 102; - jjmatchedPos = 2; - } - return 137; - } - if ((active0 & 0x2000000000000000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 2; - jjmatchedPos = 2; - } - return 373; - } - if ((active0 & 0x4000000000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 102; - jjmatchedPos = 2; - } - return 450; - } - if ((active0 & 0x1000000000000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 102; - jjmatchedPos = 2; - } - return 856; - } - if ((active1 & 0x100L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 102; - jjmatchedPos = 2; - } - return 302; - } - if ((active0 & 0x4000000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 102; - jjmatchedPos = 2; - } - return 478; - } - if ((active1 & 0x40000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 102; - jjmatchedPos = 2; - } - return 965; - } - if ((active1 & 0x800L) != 0L) - return 427; - if ((active0 & 0x200000000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 102; - jjmatchedPos = 2; - } - return 798; - } - if ((active0 & 0x4000000000000000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 2; - jjmatchedPos = 2; - } - return 963; - } - if ((active0 & 0x1000000L) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 102; - jjmatchedPos = 2; - } - return 440; - } - if ((active0 & 0x8fa075817a480000L) != 0L || (active1 & 0x7be06bL) != 0L) - { - if (jjmatchedPos != 2) - { - jjmatchedKind = 102; - jjmatchedPos = 2; - } - return 963; - } - return -1; - case 3: - if ((active1 & 0x4L) != 0L) - { - if (jjmatchedPos != 3) - { - jjmatchedKind = 102; - jjmatchedPos = 3; - } - return 897; - } - if ((active0 & 0x1000000000000000L) != 0L) - { - if (jjmatchedPos != 3) - { - jjmatchedKind = 102; - jjmatchedPos = 3; - } - return 168; - } - if ((active0 & 0x8fa074830f080000L) != 0L || (active1 & 0x5616bL) != 0L) - { - if (jjmatchedPos != 3) - { - jjmatchedKind = 102; - jjmatchedPos = 3; - } - return 963; - } - if ((active0 & 0x2000000000000000L) != 0L) - { - if (jjmatchedPos != 3) - { - jjmatchedKind = 102; - jjmatchedPos = 3; - } - return 372; - } - if ((active0 & 0x4000000000L) != 0L) - return 449; - if ((active0 & 0x4000010070400000L) != 0L || (active1 & 0x7a8000L) != 0L) - return 963; - if ((active0 & 0x1000000000000L) != 0L) - return 855; - if ((active1 & 0x400L) != 0L) - { - if (jjmatchedPos != 3) - { - jjmatchedKind = 102; - jjmatchedPos = 3; - } - return 28; - } - return -1; - case 4: - if ((active0 & 0x2000000000000000L) != 0L) - { - jjmatchedKind = 102; - jjmatchedPos = 4; - return 378; - } - if ((active0 & 0x9d80248001080000L) != 0L || (active1 & 0x44067L) != 0L) - { - jjmatchedKind = 102; - jjmatchedPos = 4; - return 963; - } - if ((active1 & 0x400400L) != 0L) - return 28; - if ((active0 & 0x22050030e000000L) != 0L || (active1 & 0x12108L) != 0L) - return 963; - return -1; - case 5: - if ((active0 & 0x2000000000000000L) != 0L) - { - jjmatchedKind = 102; - jjmatchedPos = 5; - return 377; - } - if ((active0 & 0x8000000000000000L) != 0L || (active1 & 0x1L) != 0L) - return 28; - if ((active0 & 0x900240000080000L) != 0L) - return 963; - if ((active0 & 0x1480008001000000L) != 0L || (active1 & 0x44066L) != 0L) - { - jjmatchedKind = 102; - jjmatchedPos = 5; - return 963; - } - return -1; - case 6: - if ((active0 & 0x2000000000000000L) != 0L) - { - jjmatchedKind = 102; - jjmatchedPos = 6; - return 376; - } - if ((active0 & 0x1080000000000000L) != 0L || (active1 & 0x40006L) != 0L) - { - jjmatchedKind = 102; - jjmatchedPos = 6; - return 963; - } - if ((active0 & 0x400008001000000L) != 0L || (active1 & 0x4060L) != 0L) - return 963; - return -1; - case 7: - if ((active0 & 0x2000000000000000L) != 0L) - { - jjmatchedKind = 102; - jjmatchedPos = 7; - return 966; - } - if ((active0 & 0x1080000000000000L) != 0L || (active1 & 0x40006L) != 0L) - return 963; - return -1; - case 8: - if ((active0 & 0x2000000000000000L) != 0L) - { - jjmatchedKind = 2; - jjmatchedPos = 8; - return 963; - } - return -1; - default : - return -1; - } -} -private final int jjStartNfa_0(int pos, long active0, long active1){ - return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1); -} -private int jjMoveStringLiteralDfa0_0(){ - switch(curChar) - { - case 34: - return jjStopAtPos(0, 99); - case 39: - return jjStopAtPos(0, 92); - case 40: - return jjStopAtPos(0, 3); - case 41: - return jjStopAtPos(0, 4); - case 42: - return jjStopAtPos(0, 11); - case 43: - return jjStopAtPos(0, 9); - case 44: - return jjStopAtPos(0, 6); - case 45: - return jjStartNfaWithStates_0(0, 10, 22); - case 46: - return jjStartNfaWithStates_0(0, 5, 962); - case 47: - return jjStopAtPos(0, 12); - case 59: - return jjStopAtPos(0, 7); - case 60: - jjmatchedKind = 15; - return jjMoveStringLiteralDfa1_0(0x10000L, 0x0L); - case 61: - return jjStopAtPos(0, 13); - case 62: - jjmatchedKind = 17; - return jjMoveStringLiteralDfa1_0(0x40000L, 0x0L); - case 65: - case 97: - return jjMoveStringLiteralDfa1_0(0x4002800400800000L, 0x780010L); - case 66: - case 98: - return jjMoveStringLiteralDfa1_0(0x40088000000000L, 0x0L); - case 67: - case 99: - return jjMoveStringLiteralDfa1_0(0x91a0000000000000L, 0x1800023L); - case 68: - case 100: - return jjMoveStringLiteralDfa1_0(0x1000000000000L, 0x44L); - case 69: - case 101: - return jjMoveStringLiteralDfa1_0(0x40000000000L, 0x80L); - case 70: - case 102: - return jjMoveStringLiteralDfa1_0(0x20400000L, 0x100L); - case 71: - case 103: - return jjMoveStringLiteralDfa1_0(0x100000000000L, 0x0L); - case 72: - case 104: - return jjMoveStringLiteralDfa1_0(0x200000000000L, 0x0L); - case 73: - case 105: - return jjMoveStringLiteralDfa1_0(0x2000022002000000L, 0x0L); - case 74: - case 106: - return jjMoveStringLiteralDfa1_0(0x40000000L, 0x0L); - case 76: - case 108: - return jjMoveStringLiteralDfa1_0(0x10010000000L, 0x608L); - case 77: - case 109: - return jjMoveStringLiteralDfa1_0(0xc000000000000L, 0x800L); - case 78: - case 110: - return jjMoveStringLiteralDfa1_0(0x5001000000L, 0x0L); - case 79: - case 111: - return jjMoveStringLiteralDfa1_0(0x400884000000L, 0x0L); - case 80: - case 112: - return jjMoveStringLiteralDfa1_0(0x600000000000000L, 0x3000L); - case 82: - case 114: - return jjMoveStringLiteralDfa1_0(0x800000008000000L, 0x1c000L); - case 83: - case 115: - return jjMoveStringLiteralDfa1_0(0x10000000080000L, 0x2020000L); - case 84: - case 116: - return jjMoveStringLiteralDfa1_0(0x200000L, 0x4040000L); - case 85: - case 117: - return jjMoveStringLiteralDfa1_0(0x100000000L, 0x0L); - case 87: - case 119: - return jjMoveStringLiteralDfa1_0(0x200000000L, 0x0L); - case 124: - return jjMoveStringLiteralDfa1_0(0x100L, 0x0L); - default : - return jjMoveNfa_0(0, 0); - } -} -private int jjMoveStringLiteralDfa1_0(long active0, long active1){ - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(0, active0, active1); - return 1; - } - switch(curChar) - { - case 61: - if ((active0 & 0x10000L) != 0L) - return jjStopAtPos(1, 16); - else if ((active0 & 0x40000L) != 0L) - return jjStopAtPos(1, 18); - break; - case 65: - case 97: - return jjMoveStringLiteralDfa2_0(active0, 0x4200001000000L, active1, 0x400c000L); - case 66: - case 98: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x10L); - case 67: - case 99: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x80000L); - case 69: - case 101: - return jjMoveStringLiteralDfa2_0(active0, 0x881008010080000L, active1, 0x60L); - case 72: - case 104: - return jjMoveStringLiteralDfa2_0(active0, 0x200000000L, active1, 0L); - case 73: - case 105: - if ((active1 & 0x1000L) != 0L) - return jjStartNfaWithStates_0(1, 76, 963); - return jjMoveStringLiteralDfa2_0(active0, 0x108010008000000L, active1, 0x2000004L); - case 76: - case 108: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x100L); - case 78: - case 110: - if ((active0 & 0x80000000L) != 0L) - return jjStartNfaWithStates_0(1, 31, 469); - else if ((active0 & 0x20000000000L) != 0L) - { - jjmatchedKind = 41; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0x2000000402000000L, active1, 0L); - case 79: - case 111: - return jjMoveStringLiteralDfa2_0(active0, 0x9660001040200000L, active1, 0x1812e0bL); - case 81: - case 113: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x20000L); - case 82: - case 114: - if ((active0 & 0x800000000L) != 0L) - { - jjmatchedKind = 35; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0x4000500000400000L, active1, 0x40000L); - case 83: - case 115: - if ((active0 & 0x800000L) != 0L) - { - jjmatchedKind = 23; - jjmatchedPos = 1; - } - else if ((active0 & 0x2000000000L) != 0L) - return jjStartNfaWithStates_0(1, 37, 396); - return jjMoveStringLiteralDfa2_0(active0, 0x800100000000L, active1, 0x100000L); - case 84: - case 116: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x600000L); - case 85: - case 117: - return jjMoveStringLiteralDfa2_0(active0, 0x10004024000000L, active1, 0L); - case 86: - case 118: - return jjMoveStringLiteralDfa2_0(active0, 0x2000000000000L, active1, 0L); - case 88: - case 120: - return jjMoveStringLiteralDfa2_0(active0, 0x40000000000L, active1, 0x80L); - case 89: - case 121: - if ((active0 & 0x80000000000L) != 0L) - return jjStartNfaWithStates_0(1, 43, 963); - break; - case 124: - if ((active0 & 0x100L) != 0L) - return jjStopAtPos(1, 8); - break; - default : - break; - } - return jjStartNfa_0(0, active0, active1); -} -private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1){ - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(0, old0, old1); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(1, active0, active1); - return 2; - } - switch(curChar) - { - case 65: - case 97: - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x600000L); - case 67: - case 99: - if ((active0 & 0x800000000000L) != 0L) - return jjStartNfaWithStates_0(2, 47, 963); - break; - case 68: - case 100: - if ((active0 & 0x400000000L) != 0L) - return jjStartNfaWithStates_0(2, 34, 963); - else if ((active1 & 0x800L) != 0L) - return jjStartNfaWithStates_0(2, 75, 427); - return jjMoveStringLiteralDfa3_0(active0, 0x400000000000L, active1, 0x4000L); - case 69: - case 101: - return jjMoveStringLiteralDfa3_0(active0, 0x4000000200000000L, active1, 0L); - case 70: - case 102: - return jjMoveStringLiteralDfa3_0(active0, 0x10000000L, active1, 0L); - case 71: - case 103: - if ((active0 & 0x2000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 49, 963); - else if ((active1 & 0x200L) != 0L) - { - jjmatchedKind = 73; - jjmatchedPos = 2; - } - return jjMoveStringLiteralDfa3_0(active0, 0x800000008000000L, active1, 0x440L); - case 73: - case 105: - return jjMoveStringLiteralDfa3_0(active0, 0x200040140000000L, active1, 0x100020L); - case 75: - case 107: - return jjMoveStringLiteralDfa3_0(active0, 0x10000000000L, active1, 0L); - case 76: - case 108: - return jjMoveStringLiteralDfa3_0(active0, 0x400004020080000L, active1, 0L); - case 77: - case 109: - if ((active0 & 0x10000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 52, 963); - break; - case 78: - case 110: - if ((active0 & 0x8000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 51, 423); - else if ((active1 & 0x2000000L) != 0L) - return jjStartNfaWithStates_0(2, 89, 963); - else if ((active1 & 0x4000000L) != 0L) - return jjStartNfaWithStates_0(2, 90, 963); - return jjMoveStringLiteralDfa3_0(active0, 0x1080000002000000L, active1, 0x8000L); - case 79: - case 111: - return jjMoveStringLiteralDfa3_0(active0, 0x8000100000400000L, active1, 0x80103L); - case 80: - case 112: - if ((active0 & 0x200000L) != 0L) - return jjStartNfaWithStates_0(2, 21, 963); - else if ((active1 & 0x80L) != 0L) - return jjStartNfaWithStates_0(2, 71, 963); - break; - case 82: - case 114: - return jjMoveStringLiteralDfa3_0(active0, 0x100000000000000L, active1, 0x20000L); - case 83: - case 115: - if ((active1 & 0x10L) != 0L) - return jjStartNfaWithStates_0(2, 68, 905); - else if ((active1 & 0x800000L) != 0L) - return jjStartNfaWithStates_0(2, 87, 963); - return jjMoveStringLiteralDfa3_0(active0, 0x1000000000000L, active1, 0x4L); - case 84: - case 116: - if ((active0 & 0x1000000000L) != 0L) - return jjStartNfaWithStates_0(2, 36, 963); - else if ((active1 & 0x1000000L) != 0L) - return jjStartNfaWithStates_0(2, 88, 963); - return jjMoveStringLiteralDfa3_0(active0, 0x2000008005000000L, active1, 0L); - case 85: - case 117: - return jjMoveStringLiteralDfa3_0(active0, 0x20000000000000L, active1, 0x50000L); - case 86: - case 118: - return jjMoveStringLiteralDfa3_0(active0, 0x200000000000L, active1, 0L); - case 87: - case 119: - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x2008L); - case 88: - case 120: - if ((active0 & 0x4000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 50, 963); - else if ((active0 & 0x40000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 54, 963); - break; - default : - break; - } - return jjStartNfa_0(1, active0, active1); -} -private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1){ - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(1, old0, old1); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(2, active0, active1); - return 3; - } - switch(curChar) - { - case 49: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x400L); - case 65: - case 97: - if ((active0 & 0x4000000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 62, 963); - break; - case 67: - case 99: - if ((active0 & 0x1000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 48, 855); - return jjMoveStringLiteralDfa4_0(active0, 0x100000000000000L, active1, 0L); - case 68: - case 100: - if ((active1 & 0x8000L) != 0L) - return jjStartNfaWithStates_0(3, 79, 963); - break; - case 69: - case 101: - if ((active0 & 0x10000000000L) != 0L) - return jjStartNfaWithStates_0(3, 40, 963); - return jjMoveStringLiteralDfa4_0(active0, 0x2000400006080000L, active1, 0x2008L); - case 72: - case 104: - return jjMoveStringLiteralDfa4_0(active0, 0x8000000L, active1, 0L); - case 73: - case 105: - return jjMoveStringLiteralDfa4_0(active0, 0x800200000000000L, active1, 0x4000L); - case 76: - case 108: - if ((active0 & 0x20000000L) != 0L) - return jjStartNfaWithStates_0(3, 29, 963); - else if ((active0 & 0x4000000000L) != 0L) - return jjStartNfaWithStates_0(3, 38, 449); - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x20L); - case 77: - case 109: - if ((active0 & 0x400000L) != 0L) - return jjStartNfaWithStates_0(3, 22, 963); - break; - case 78: - case 110: - if ((active0 & 0x40000000L) != 0L) - return jjStartNfaWithStates_0(3, 30, 963); - else if ((active1 & 0x100000L) != 0L) - return jjStartNfaWithStates_0(3, 84, 963); - else if ((active1 & 0x200000L) != 0L) - { - jjmatchedKind = 85; - jjmatchedPos = 3; - } - return jjMoveStringLiteralDfa4_0(active0, 0x220000100000000L, active1, 0x450000L); - case 79: - case 111: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x100L); - case 82: - case 114: - return jjMoveStringLiteralDfa4_0(active0, 0x8000000200000000L, active1, 0x43L); - case 83: - case 115: - if ((active1 & 0x80000L) != 0L) - return jjStartNfaWithStates_0(3, 83, 963); - return jjMoveStringLiteralDfa4_0(active0, 0x40000000000L, active1, 0L); - case 84: - case 116: - if ((active0 & 0x10000000L) != 0L) - return jjStartNfaWithStates_0(3, 28, 963); - else if ((active1 & 0x20000L) != 0L) - return jjStartNfaWithStates_0(3, 81, 963); - return jjMoveStringLiteralDfa4_0(active0, 0x1080000000000000L, active1, 0x4L); - case 85: - case 117: - return jjMoveStringLiteralDfa4_0(active0, 0x100001000000L, active1, 0L); - case 87: - case 119: - return jjMoveStringLiteralDfa4_0(active0, 0x8000000000L, active1, 0L); - case 89: - case 121: - return jjMoveStringLiteralDfa4_0(active0, 0x400000000000000L, active1, 0L); - default : - break; - } - return jjStartNfa_0(2, active0, active1); -} -private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1){ - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(2, old0, old1); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(3, active0, active1); - return 4; - } - switch(curChar) - { - case 48: - if ((active1 & 0x400L) != 0L) - return jjStartNfaWithStates_0(4, 74, 28); - break; - case 50: - if ((active1 & 0x400000L) != 0L) - return jjStartNfaWithStates_0(4, 86, 28); - break; - case 65: - case 97: - return jjMoveStringLiteralDfa5_0(active0, 0x1000000000000000L, active1, 0x4004L); - case 67: - case 99: - return jjMoveStringLiteralDfa5_0(active0, 0x80000L, active1, 0x40000L); - case 68: - case 100: - if ((active1 & 0x10000L) != 0L) - return jjStartNfaWithStates_0(4, 80, 963); - return jjMoveStringLiteralDfa5_0(active0, 0x8000000000000000L, active1, 0x3L); - case 69: - case 101: - if ((active0 & 0x200000000L) != 0L) - return jjStartNfaWithStates_0(4, 33, 963); - return jjMoveStringLiteralDfa5_0(active0, 0x8000000000L, active1, 0x40L); - case 71: - case 103: - if ((active0 & 0x100000000L) != 0L) - return jjStartNfaWithStates_0(4, 32, 963); - return jjMoveStringLiteralDfa5_0(active0, 0x400000000000000L, active1, 0L); - case 73: - case 105: - return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x20L); - case 76: - case 108: - return jjMoveStringLiteralDfa5_0(active0, 0x100000000000000L, active1, 0L); - case 78: - case 110: - return jjMoveStringLiteralDfa5_0(active0, 0x200000000000L, active1, 0L); - case 79: - case 111: - return jjMoveStringLiteralDfa5_0(active0, 0x800000000000000L, active1, 0L); - case 80: - case 112: - if ((active0 & 0x100000000000L) != 0L) - return jjStartNfaWithStates_0(4, 44, 963); - break; - case 82: - case 114: - if ((active0 & 0x2000000L) != 0L) - return jjStartNfaWithStates_0(4, 25, 963); - else if ((active0 & 0x4000000L) != 0L) - return jjStartNfaWithStates_0(4, 26, 963); - else if ((active0 & 0x400000000000L) != 0L) - return jjStartNfaWithStates_0(4, 46, 963); - else if ((active1 & 0x8L) != 0L) - return jjStartNfaWithStates_0(4, 67, 963); - else if ((active1 & 0x100L) != 0L) - return jjStartNfaWithStates_0(4, 72, 963); - else if ((active1 & 0x2000L) != 0L) - return jjStartNfaWithStates_0(4, 77, 963); - return jjMoveStringLiteralDfa5_0(active0, 0x2080000001000000L, active1, 0L); - case 84: - case 116: - if ((active0 & 0x8000000L) != 0L) - return jjStartNfaWithStates_0(4, 27, 963); - else if ((active0 & 0x20000000000000L) != 0L) - return jjStartNfaWithStates_0(4, 53, 963); - else if ((active0 & 0x200000000000000L) != 0L) - return jjStartNfaWithStates_0(4, 57, 963); - return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L, active1, 0L); - default : - break; - } - return jjStartNfa_0(3, active0, active1); -} -private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1){ - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(3, old0, old1); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(4, active0, active1); - return 5; - } - switch(curChar) - { - case 49: - if ((active0 & 0x8000000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 63, 28); - break; - case 50: - if ((active1 & 0x1L) != 0L) - return jjStartNfaWithStates_0(5, 64, 28); - break; - case 65: - case 97: - return jjMoveStringLiteralDfa6_0(active0, 0x1000000L, active1, 0x40000L); - case 69: - case 101: - if ((active0 & 0x100000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 56, 963); - return jjMoveStringLiteralDfa6_0(active0, 0x8000000000L, active1, 0x40L); - case 71: - case 103: - if ((active0 & 0x200000000000L) != 0L) - return jjStartNfaWithStates_0(5, 45, 963); - break; - case 73: - case 105: - return jjMoveStringLiteralDfa6_0(active0, 0x1000000000000000L, active1, 0L); - case 78: - case 110: - if ((active0 & 0x800000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 59, 963); - return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x4024L); - case 79: - case 111: - return jjMoveStringLiteralDfa6_0(active0, 0x480000000000000L, active1, 0L); - case 83: - case 115: - if ((active0 & 0x40000000000L) != 0L) - return jjStartNfaWithStates_0(5, 42, 963); - return jjMoveStringLiteralDfa6_0(active0, 0x2000000000000000L, active1, 0x2L); - case 84: - case 116: - if ((active0 & 0x80000L) != 0L) - return jjStartNfaWithStates_0(5, 19, 963); - break; - default : - break; - } - return jjStartNfa_0(4, active0, active1); -} -private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long active1){ - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(4, old0, old1); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(5, active0, active1); - return 6; - } - switch(curChar) - { - case 67: - case 99: - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x4L); - case 69: - case 101: - return jjMoveStringLiteralDfa7_0(active0, 0x2000000000000000L, active1, 0L); - case 71: - case 103: - if ((active1 & 0x20L) != 0L) - return jjStartNfaWithStates_0(6, 69, 963); - break; - case 73: - case 105: - return jjMoveStringLiteralDfa7_0(active0, 0x80000000000000L, active1, 0L); - case 76: - case 108: - if ((active0 & 0x1000000L) != 0L) - return jjStartNfaWithStates_0(6, 24, 963); - break; - case 78: - case 110: - if ((active0 & 0x8000000000L) != 0L) - return jjStartNfaWithStates_0(6, 39, 963); - else if ((active0 & 0x400000000000000L) != 0L) - return jjStartNfaWithStates_0(6, 58, 963); - return jjMoveStringLiteralDfa7_0(active0, 0x1000000000000000L, active1, 0L); - case 83: - case 115: - if ((active1 & 0x40L) != 0L) - return jjStartNfaWithStates_0(6, 70, 963); - else if ((active1 & 0x4000L) != 0L) - return jjStartNfaWithStates_0(6, 78, 963); - break; - case 84: - case 116: - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x40000L); - case 89: - case 121: - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x2L); - default : - break; - } - return jjStartNfa_0(5, active0, active1); -} -private int jjMoveStringLiteralDfa7_0(long old0, long active0, long old1, long active1){ - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(5, old0, old1); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(6, active0, active1); - return 7; - } - switch(curChar) - { - case 67: - case 99: - return jjMoveStringLiteralDfa8_0(active0, 0x2000000000000000L, active1, 0L); - case 68: - case 100: - if ((active0 & 0x80000000000000L) != 0L) - return jjStartNfaWithStates_0(7, 55, 963); - break; - case 69: - case 101: - if ((active1 & 0x4L) != 0L) - return jjStartNfaWithStates_0(7, 66, 963); - else if ((active1 & 0x40000L) != 0L) - return jjStartNfaWithStates_0(7, 82, 963); - break; - case 83: - case 115: - if ((active0 & 0x1000000000000000L) != 0L) - return jjStartNfaWithStates_0(7, 60, 963); - else if ((active1 & 0x2L) != 0L) - return jjStartNfaWithStates_0(7, 65, 963); - break; - default : - break; - } - return jjStartNfa_0(6, active0, active1); -} -private int jjMoveStringLiteralDfa8_0(long old0, long active0, long old1, long active1){ - if (((active0 &= old0) | (active1 &= old1)) == 0L) - return jjStartNfa_0(6, old0, old1); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(7, active0, 0L); - return 8; - } - switch(curChar) - { - case 84: - case 116: - return jjMoveStringLiteralDfa9_0(active0, 0x2000000000000000L); - default : - break; - } - return jjStartNfa_0(7, active0, 0L); -} -private int jjMoveStringLiteralDfa9_0(long old0, long active0){ - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(7, old0, 0L); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(8, active0, 0L); - return 9; - } - switch(curChar) - { - case 83: - case 115: - if ((active0 & 0x2000000000000000L) != 0L) - return jjStartNfaWithStates_0(9, 61, 963); - break; - default : - break; - } - return jjStartNfa_0(8, active0, 0L); -} -private int jjStartNfaWithStates_0(int pos, int kind, int state) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return pos + 1; } - return jjMoveNfa_0(state, pos + 1); -} -private int jjMoveNfa_0(int startState, int curPos) -{ - int startsAt = 0; - jjnewStateCnt = 962; - int i = 1; - jjstateSet[0] = startState; - int kind = 0x7fffffff; - for (;;) - { - if (++jjround == 0x7fffffff) - ReInitRounds(); - if (curChar < 64) - { - long l = 1L << curChar; - do - { - switch(jjstateSet[--i]) - { - case 714: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 962: - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 96) - kind = 96; - { jjCheckNAdd(949); } - } - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddTwoStates(945, 946); } - break; - case 373: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 810: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 469: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 420: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 376: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 303: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 5: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 578: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 168: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 428: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 617: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 137: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 818: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 907: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 498: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 767: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 324: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 435: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 855: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 295: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 421: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 33: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 793: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 423: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 249: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 594: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 965: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 404: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 874: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 749: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 449: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 0: - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 97) - kind = 97; - { jjCheckNAddStates(0, 8); } - } - else if ((0x100002600L & l) != 0L) - { - if (kind > 1) - kind = 1; - } - else if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - else if (curChar == 46) - { jjCheckNAddTwoStates(945, 949); } - else if (curChar == 45) - jjstateSet[jjnewStateCnt++] = 22; - else if (curChar == 60) - jjstateSet[jjnewStateCnt++] = 17; - if (curChar == 33) - jjstateSet[jjnewStateCnt++] = 19; - else if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 1; - break; - case 410: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 929: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 372: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 468: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 634: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 881: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 966: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 315: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 450: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 478: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 906: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 32: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 52: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 332: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 377: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 587: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 794: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 45: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 547: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 345: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 424: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 416: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 440: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 378: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 667: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 302: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 856: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 798: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 910: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 396: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 897: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 436: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 666: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 653: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 479: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 546: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 963: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 488: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 905: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 427: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 264: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 451: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 964: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 113: - if ((0x83ff001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x8000001a00000000L & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 1: - if (curChar == 10 && kind > 1) - kind = 1; - break; - case 2: - if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 1; - break; - case 17: - if (curChar == 62 && kind > 14) - kind = 14; - break; - case 18: - if (curChar == 60) - jjstateSet[jjnewStateCnt++] = 17; - break; - case 19: - if (curChar == 61 && kind > 14) - kind = 14; - break; - case 20: - if (curChar == 33) - jjstateSet[jjnewStateCnt++] = 19; - break; - case 21: - if (curChar == 45) - jjstateSet[jjnewStateCnt++] = 22; - break; - case 22: - if (curChar != 45) - break; - if (kind > 91) - kind = 91; - { jjCheckNAddStates(9, 11); } - break; - case 23: - if ((0xffffffffffffdbffL & l) == 0L) - break; - if (kind > 91) - kind = 91; - { jjCheckNAddStates(9, 11); } - break; - case 24: - if ((0x2400L & l) != 0L && kind > 91) - kind = 91; - break; - case 25: - if (curChar == 10 && kind > 91) - kind = 91; - break; - case 26: - if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 25; - break; - case 27: - if ((0x8000001a00000000L & l) == 0L) - break; - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - break; - case 28: - if ((0x83ff001a00000000L & l) == 0L) - break; - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - break; - case 255: - if (curChar == 45) - jjstateSet[jjnewStateCnt++] = 254; - break; - case 944: - if (curChar == 46) - { jjCheckNAddTwoStates(945, 949); } - break; - case 945: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddTwoStates(945, 946); } - break; - case 947: - if ((0x280000000000L & l) != 0L) - { jjCheckNAdd(948); } - break; - case 948: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 95) - kind = 95; - { jjCheckNAdd(948); } - break; - case 949: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { jjCheckNAdd(949); } - break; - case 950: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 97) - kind = 97; - { jjCheckNAddStates(0, 8); } - break; - case 951: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddTwoStates(951, 946); } - break; - case 952: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddTwoStates(952, 953); } - break; - case 953: - if (curChar == 46) - { jjCheckNAddTwoStates(954, 946); } - break; - case 954: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddTwoStates(954, 946); } - break; - case 955: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddTwoStates(955, 956); } - break; - case 956: - if (curChar != 46) - break; - if (kind > 96) - kind = 96; - { jjCheckNAdd(957); } - break; - case 957: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 96) - kind = 96; - { jjCheckNAdd(957); } - break; - case 958: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 97) - kind = 97; - { jjCheckNAdd(958); } - break; - case 959: - if ((0x3ff000000000000L & l) != 0L) - { jjCheckNAddTwoStates(959, 960); } - break; - case 960: - if ((0x8000001a00000000L & l) == 0L) - break; - if (kind > 102) - kind = 102; - { jjCheckNAdd(961); } - break; - case 961: - if ((0x83ff001a00000000L & l) == 0L) - break; - if (kind > 102) - kind = 102; - { jjCheckNAdd(961); } - break; - default : break; - } - } while(i != startsAt); - } - else if (curChar < 128) - { - long l = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 714: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x20000000200000L & l) != 0L) - { jjCheckNAdd(13); } - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 741; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 738; - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 729; - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 722; - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 713; - break; - case 373: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x800000008000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 385; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 379; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 372; - break; - case 810: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 899; - else if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 892; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 890; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 865; - else if ((0x200000002L & l) != 0L) - { jjCheckNAdd(7); } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 886; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 882; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 857; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 809; - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 874; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 851; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 847; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 841; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 833; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 828; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 823; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 818; - break; - case 469: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x100000001000L & l) != 0L) - { jjCheckNAdd(7); } - break; - case 420: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 419; - break; - case 376: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x800000008L & l) != 0L) - { jjCheckNAdd(34); } - break; - case 303: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 302; - break; - case 5: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 4; - break; - case 578: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x80000000800000L & l) != 0L) - { jjCheckNAdd(156); } - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 577; - break; - case 168: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 167; - break; - case 428: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 430; - else if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 427; - break; - case 617: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x400000004000000L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 137: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 173; - else if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 168; - else if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 162; - else if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 144; - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 152; - else if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 136; - break; - case 818: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 864; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 850; - else if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 846; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 827; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 817; - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 856; - else if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 840; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 822; - if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 832; - break; - case 907: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 942; - else if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 940; - else if ((0x10000000100000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - else if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 929; - else if ((0x4000000040000L & l) != 0L) - { jjCheckNAdd(13); } - else if ((0x400000004000L & l) != 0L) - { jjCheckNAdd(7); } - else if ((0x1000000010L & l) != 0L) - { jjCheckNAdd(53); } - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 910; - else if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 906; - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 920; - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 917; - break; - case 498: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 497; - break; - case 767: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x2000000020L & l) != 0L) - { jjCheckNAdd(3); } - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 766; - break; - case 324: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 323; - break; - case 435: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 440; - else if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 434; - break; - case 855: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 862; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 854; - break; - case 295: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 312; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 303; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 300; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 297; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 294; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 309; - if ((0x800000008000L & l) != 0L) - { jjCheckNAdd(3); } - break; - case 421: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 431; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 424; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 420; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 428; - break; - case 33: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 45; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 43; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 32; - if ((0x20000000200L & l) != 0L) - { jjCheckNAdd(34); } - break; - case 793: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 798; - if ((0x2000000020L & l) != 0L) - { jjCheckNAdd(30); } - break; - case 423: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 422; - break; - case 249: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 290; - else if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 260; - else if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 256; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 248; - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 285; - else if ((0x400000004000L & l) != 0L) - { jjCheckNAdd(53); } - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 278; - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 273; - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 271; - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 264; - break; - case 594: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x10000000100000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - else if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 613; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 598; - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 603; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 593; - break; - case 965: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x2000000020L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - break; - case 404: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 416; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 413; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 405; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 410; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 403; - break; - case 874: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 898; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 873; - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 881; - break; - case 749: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 769; - else if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 764; - else if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 757; - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 767; - else if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 761; - else if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 752; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 748; - break; - case 449: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x20000000200L & l) != 0L) - { jjCheckNAdd(448); } - break; - case 0: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x200000002L & l) != 0L) - { jjCheckNAddStates(12, 22); } - else if ((0x1000000010L & l) != 0L) - { jjAddStates(23, 39); } - else if ((0x80000000800000L & l) != 0L) - { jjAddStates(40, 44); } - else if ((0x40000000400000L & l) != 0L) - { jjAddStates(45, 49); } - else if ((0x20000000200000L & l) != 0L) - { jjAddStates(50, 56); } - else if ((0x10000000100000L & l) != 0L) - { jjCheckNAddStates(57, 70); } - else if ((0x8000000080000L & l) != 0L) - { jjAddStates(71, 87); } - else if ((0x4000000040000L & l) != 0L) - { jjAddStates(88, 95); } - else if ((0x1000000010000L & l) != 0L) - { jjAddStates(96, 106); } - else if ((0x800000008000L & l) != 0L) - { jjCheckNAddStates(107, 113); } - else if ((0x400000004000L & l) != 0L) - { jjCheckNAddStates(114, 120); } - else if ((0x200000002000L & l) != 0L) - { jjAddStates(121, 124); } - else if ((0x100000001000L & l) != 0L) - { jjAddStates(125, 129); } - else if ((0x20000000200L & l) != 0L) - { jjAddStates(130, 142); } - else if ((0x8000000080L & l) != 0L) - { jjCheckNAddStates(143, 147); } - else if ((0x4000000040L & l) != 0L) - { jjAddStates(148, 154); } - else if ((0x2000000020L & l) != 0L) - { jjAddStates(155, 164); } - else if ((0x800000008L & l) != 0L) - { jjAddStates(165, 194); } - else if ((0x400000004L & l) != 0L) - { jjAddStates(195, 198); } - else if ((0x400000004000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 15; - else if ((0x200000002000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 11; - else if ((0x80000000800L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 8; - else if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 5; - break; - case 410: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 412; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 409; - break; - case 929: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 928; - break; - case 372: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 384; - else if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 371; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 378; - break; - case 468: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 485; - else if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 479; - else if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 475; - else if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 469; - else if ((0x4000000040L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 467; - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 471; - break; - case 634: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 645; - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 639; - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 633; - if ((0x100000001000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - break; - case 881: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 897; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 880; - break; - case 966: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x10000000100000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - break; - case 315: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 324; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 321; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 318; - else if ((0x2000000020L & l) != 0L) - { jjCheckNAdd(34); } - if ((0x800000008000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - break; - case 450: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 449; - break; - case 478: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 477; - break; - case 906: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 905; - break; - case 32: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 31; - break; - case 52: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 245; - else if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 190; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 186; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 107; - else if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 104; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 68; - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 241; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 175; - else if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 100; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 62; - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 231; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 170; - else if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 86; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 60; - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 215; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 164; - else if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 77; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 58; - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 205; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 154; - else if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 70; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 51; - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 195; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 146; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 138; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 133; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 129; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 125; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 118; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 113; - break; - case 332: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 396; - else if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 389; - else if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 338; - else if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 331; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 387; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 381; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 374; - if ((0x400000004000L & l) != 0L) - { jjCheckNAdd(34); } - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 368; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 364; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 355; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 352; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 345; - break; - case 377: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 376; - break; - case 587: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x200000002000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 662; - else if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 653; - else if ((0x2000000020000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 646; - else if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 628; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 625; - else if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 623; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 617; - else if ((0x2000000020L & l) != 0L) - { jjCheckNAdd(34); } - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 590; - if ((0x2000000020000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 640; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 614; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 586; - if ((0x2000000020000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 634; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 604; - if ((0x2000000020000L & l) != 0L) - { jjCheckNAdd(280); } - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 599; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 594; - break; - case 794: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 806; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 803; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 801; - else if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 799; - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 793; - break; - case 45: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x10000000100000L & l) != 0L) - { jjCheckNAdd(36); } - break; - case 547: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 580; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 572; - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 578; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 568; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 562; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 556; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 548; - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 546; - break; - case 345: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x10000000100000L & l) != 0L) - { jjCheckNAdd(320); } - else if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 367; - else if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 354; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 351; - else if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 344; - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 386; - else if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 363; - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 380; - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 373; - if ((0x10000000100000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - break; - case 424: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 423; - break; - case 416: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 415; - break; - case 440: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 439; - break; - case 378: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 383; - else if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 377; - break; - case 667: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 744; - else if ((0x800000008000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 708; - else if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 675; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 673; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 666; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 742; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 695; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 739; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 684; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 730; - else if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 677; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 723; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 714; - break; - case 302: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x200000002L & l) != 0L) - { jjCheckNAdd(34); } - break; - case 856: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 863; - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 855; - break; - case 798: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 797; - if ((0x400000004000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - break; - case 910: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 909; - break; - case 396: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 395; - break; - case 897: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 896; - break; - case 436: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 456; - else if ((0x800000008000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 446; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 444; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 441; - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 451; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 435; - break; - case 666: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 665; - break; - case 653: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 652; - break; - case 479: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 478; - break; - case 546: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 571; - else if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 567; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 561; - else if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 555; - else if ((0x200000002L & l) != 0L) - { jjCheckNAdd(280); } - if ((0x200000002L & l) != 0L) - { jjCheckNAdd(53); } - break; - case 963: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - break; - case 488: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 543; - else if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 539; - else if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 498; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 492; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 532; - else if ((0x200000002L & l) != 0L) - { jjCheckNAdd(53); } - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 524; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 521; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 516; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 510; - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 505; - break; - case 905: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 904; - break; - case 427: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 426; - break; - case 264: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 289; - else if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 277; - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 270; - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 284; - else if ((0x2000000020L & l) != 0L) - { jjCheckNAdd(251); } - else if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 263; - break; - case 451: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 455; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 450; - break; - case 964: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x200000002000000L & l) != 0L) - { - if (kind > 2) - kind = 2; - } - break; - case 113: - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - } - if ((0x6fffffffefffffffL & l) != 0L) - { - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - } - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 185; - else if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 174; - else if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 132; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 128; - else if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 112; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 169; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 124; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 163; - else if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 117; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 153; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 145; - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 137; - break; - case 3: - if ((0x4000000040000L & l) != 0L && kind > 2) - kind = 2; - break; - case 4: - case 686: - if ((0x20000000200000L & l) != 0L) - { jjCheckNAdd(3); } - break; - case 6: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 5; - break; - case 7: - if ((0x200000002000000L & l) != 0L && kind > 2) - kind = 2; - break; - case 8: - if ((0x2000000020L & l) != 0L) - { jjCheckNAdd(7); } - break; - case 9: - if ((0x80000000800L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 8; - break; - case 10: - case 70: - case 443: - case 779: - if ((0x200000002L & l) != 0L) - { jjCheckNAdd(3); } - break; - case 11: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 10; - break; - case 12: - if ((0x200000002000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 11; - break; - case 13: - if ((0x2000000020L & l) != 0L && kind > 2) - kind = 2; - break; - case 14: - if ((0x400000004000L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 15: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 14; - break; - case 16: - if ((0x400000004000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 15; - break; - case 23: - if (kind > 91) - kind = 91; - { jjAddStates(9, 11); } - break; - case 27: - if ((0x6fffffffefffffffL & l) == 0L) - break; - if (kind > 102) - kind = 102; - { jjCheckNAddTwoStates(27, 28); } - break; - case 28: - if ((0x6fffffffefffffffL & l) == 0L) - break; - if (kind > 102) - kind = 102; - { jjCheckNAdd(28); } - break; - case 29: - if ((0x400000004L & l) != 0L) - { jjAddStates(195, 198); } - break; - case 30: - if ((0x400000004000L & l) != 0L && kind > 2) - kind = 2; - break; - case 31: - case 884: - if ((0x20000000200L & l) != 0L) - { jjCheckNAdd(30); } - break; - case 34: - if ((0x10000000100000L & l) != 0L && kind > 2) - kind = 2; - break; - case 35: - case 131: - if ((0x20000000200L & l) != 0L) - { jjCheckNAdd(34); } - break; - case 36: - if ((0x10000000100L & l) != 0L && kind > 2) - kind = 2; - break; - case 37: - case 79: - case 88: - case 430: - case 459: - case 801: - if ((0x10000000100000L & l) != 0L) - { jjCheckNAdd(36); } - break; - case 38: - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 37; - break; - case 39: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 38; - break; - case 40: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 39; - break; - case 41: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 40; - break; - case 42: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 41; - break; - case 43: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 42; - break; - case 44: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 43; - break; - case 46: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 45; - break; - case 47: - if ((0x800000008L & l) != 0L) - { jjAddStates(165, 194); } - break; - case 48: - case 631: - if ((0x1000000010L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 49: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 48; - break; - case 50: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 49; - break; - case 51: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 50; - break; - case 53: - if ((0x1000000010L & l) != 0L && kind > 2) - kind = 2; - break; - case 54: - case 843: - if ((0x2000000020L & l) != 0L) - { jjCheckNAdd(53); } - break; - case 55: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 54; - break; - case 56: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 55; - break; - case 57: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 56; - break; - case 58: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 57; - break; - case 59: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 58; - break; - case 60: - case 106: - case 248: - case 293: - if ((0x8000000080000L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 61: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 60; - break; - case 62: - case 299: - case 405: - if ((0x8000000080000L & l) != 0L) - { jjCheckNAdd(34); } - break; - case 63: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 62; - break; - case 64: - if ((0x8000000080L & l) != 0L && kind > 2) - kind = 2; - break; - case 65: - if ((0x800000008000L & l) != 0L) - { jjCheckNAdd(64); } - break; - case 66: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 65; - break; - case 67: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 66; - break; - case 68: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 67; - break; - case 69: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 68; - break; - case 71: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 70; - break; - case 72: - case 233: - case 371: - case 606: - case 655: - case 763: - case 795: - case 919: - if ((0x2000000020L & l) != 0L) - { jjCheckNAdd(3); } - break; - case 73: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 72; - break; - case 74: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 73; - break; - case 75: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 74; - break; - case 76: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 75; - break; - case 77: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 76; - break; - case 78: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 77; - break; - case 80: - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 79; - break; - case 81: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 80; - break; - case 82: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 81; - break; - case 83: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 82; - break; - case 84: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 83; - break; - case 85: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 84; - break; - case 86: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 85; - break; - case 87: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 86; - break; - case 89: - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 88; - break; - case 90: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 89; - break; - case 91: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 90; - break; - case 92: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 91; - break; - case 93: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 92; - break; - case 94: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 93; - break; - case 95: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 94; - break; - case 96: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 95; - break; - case 97: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 96; - break; - case 98: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 97; - break; - case 99: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 98; - break; - case 100: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 99; - break; - case 101: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 100; - break; - case 102: - if ((0x80000000800L & l) != 0L && kind > 2) - kind = 2; - break; - case 103: - case 574: - if ((0x800000008L & l) != 0L) - { jjCheckNAdd(102); } - break; - case 104: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 103; - break; - case 105: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 104; - break; - case 107: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 106; - break; - case 108: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 107; - break; - case 109: - case 627: - if ((0x800000008L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 110: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 109; - break; - case 111: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 110; - break; - case 112: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 111; - break; - case 114: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 113; - break; - case 115: - case 188: - case 197: - case 275: - case 333: - case 422: - case 642: - case 697: - case 725: - case 759: - case 805: - case 809: - case 812: - case 849: - case 902: - case 913: - if ((0x10000000100000L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 116: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 115; - break; - case 117: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 116; - break; - case 118: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 117; - break; - case 119: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 118; - break; - case 120: - case 140: - case 266: - case 391: - case 473: - case 494: - case 500: - case 596: - case 601: - case 716: - case 732: - case 747: - case 908: - case 924: - case 931: - if ((0x800000008000L & l) != 0L) - { jjCheckNAdd(30); } - break; - case 121: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 120; - break; - case 122: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 121; - break; - case 123: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 122; - break; - case 124: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 123; - break; - case 125: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 124; - break; - case 126: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 125; - break; - case 127: - if ((0x200000002000L & l) != 0L) - { jjCheckNAdd(30); } - break; - case 128: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 127; - break; - case 129: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 128; - break; - case 130: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 129; - break; - case 132: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 131; - break; - case 133: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 132; - break; - case 134: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 133; - break; - case 135: - case 287: - case 564: - case 876: - if ((0x800000008L & l) != 0L) - { jjCheckNAdd(34); } - break; - case 136: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 135; - break; - case 138: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 137; - break; - case 139: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 138; - break; - case 141: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 140; - break; - case 142: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 141; - break; - case 143: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 142; - break; - case 144: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 143; - break; - case 145: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 144; - break; - case 146: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 145; - break; - case 147: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 146; - break; - case 148: - case 192: - case 323: - case 619: - if ((0x400000004000L & l) != 0L) - { jjCheckNAdd(34); } - break; - case 149: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 148; - break; - case 150: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 149; - break; - case 151: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 150; - break; - case 152: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 151; - break; - case 153: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 152; - break; - case 154: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 153; - break; - case 155: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 154; - break; - case 156: - if ((0x8000000080000L & l) != 0L && kind > 2) - kind = 2; - break; - case 157: - if ((0x10000000100000L & l) != 0L) - { jjCheckNAdd(156); } - break; - case 158: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 157; - break; - case 159: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 158; - break; - case 160: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 159; - break; - case 161: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 160; - break; - case 162: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 161; - break; - case 163: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 162; - break; - case 164: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 163; - break; - case 165: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 164; - break; - case 166: - case 750: - case 772: - if ((0x20000000200000L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 167: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 166; - break; - case 169: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 168; - break; - case 170: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 169; - break; - case 171: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 170; - break; - case 172: - case 366: - if ((0x4000000040000L & l) != 0L) - { jjCheckNAdd(34); } - break; - case 173: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 172; - break; - case 174: - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 173; - break; - case 175: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 174; - break; - case 176: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 175; - break; - case 177: - case 407: - case 648: - case 710: - case 784: - if ((0x400000004000L & l) != 0L) - { jjCheckNAdd(64); } - break; - case 178: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 177; - break; - case 179: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 178; - break; - case 180: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 179; - break; - case 181: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 180; - break; - case 182: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 181; - break; - case 183: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 182; - break; - case 184: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 183; - break; - case 185: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 184; - break; - case 186: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 185; - break; - case 187: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 186; - break; - case 189: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 188; - break; - case 190: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 189; - break; - case 191: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 190; - break; - case 193: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 192; - break; - case 194: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 193; - break; - case 195: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 194; - break; - case 196: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 195; - break; - case 198: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 197; - break; - case 199: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 198; - break; - case 200: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 199; - break; - case 201: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 200; - break; - case 202: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 201; - break; - case 203: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 202; - break; - case 204: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 203; - break; - case 205: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 204; - break; - case 206: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 205; - break; - case 207: - case 625: - case 677: - if ((0x200000002000L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 208: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 207; - break; - case 209: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 208; - break; - case 210: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 209; - break; - case 211: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 210; - break; - case 212: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 211; - break; - case 213: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 212; - break; - case 214: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 213; - break; - case 215: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 214; - break; - case 216: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 215; - break; - case 217: - if ((0x1000000010000L & l) != 0L && kind > 2) - kind = 2; - break; - case 218: - case 679: - if ((0x200000002000L & l) != 0L) - { jjCheckNAdd(217); } - break; - case 219: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 218; - break; - case 220: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 219; - break; - case 221: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 220; - break; - case 222: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 221; - break; - case 223: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 222; - break; - case 224: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 223; - break; - case 225: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 224; - break; - case 226: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 225; - break; - case 227: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 226; - break; - case 228: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 227; - break; - case 229: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 228; - break; - case 230: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 229; - break; - case 231: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 230; - break; - case 232: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 231; - break; - case 234: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 233; - break; - case 235: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 234; - break; - case 236: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 235; - break; - case 237: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 236; - break; - case 238: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 237; - break; - case 239: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 238; - break; - case 240: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 239; - break; - case 241: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 240; - break; - case 242: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 241; - break; - case 243: - case 340: - case 523: - case 636: - case 859: - if ((0x800000008000L & l) != 0L) - { jjCheckNAdd(3); } - break; - case 244: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 243; - break; - case 245: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 244; - break; - case 246: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 245; - break; - case 247: - if ((0x2000000020L & l) != 0L) - { jjAddStates(155, 164); } - break; - case 250: - case 311: - case 592: - if ((0x400000004000L & l) != 0L) - { jjCheckNAdd(53); } - break; - case 251: - if ((0x800000008L & l) != 0L && kind > 2) - kind = 2; - break; - case 252: - if ((0x2000000020L & l) != 0L) - { jjCheckNAdd(251); } - break; - case 253: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 252; - break; - case 254: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 253; - break; - case 256: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 255; - break; - case 257: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 256; - break; - case 258: - if ((0x1000000010000L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 259: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 258; - break; - case 260: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 259; - break; - case 261: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 260; - break; - case 262: - if ((0x1000000010000L & l) != 0L) - { jjCheckNAdd(34); } - break; - case 263: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 262; - break; - case 265: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 264; - break; - case 267: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 266; - break; - case 268: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 267; - break; - case 269: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 268; - break; - case 270: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 269; - break; - case 271: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 270; - break; - case 272: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 271; - break; - case 273: - if ((0x2000000020L & l) != 0L) - { jjCheckNAdd(251); } - break; - case 274: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 273; - break; - case 276: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 275; - break; - case 277: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 276; - break; - case 278: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 277; - break; - case 279: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 278; - break; - case 280: - if ((0x100000001000L & l) != 0L && kind > 2) - kind = 2; - break; - case 281: - case 316: - case 383: - case 415: - case 437: - case 489: - case 820: - if ((0x200000002L & l) != 0L) - { jjCheckNAdd(280); } - break; - case 282: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 281; - break; - case 283: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 282; - break; - case 284: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 283; - break; - case 285: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 284; - break; - case 286: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 285; - break; - case 288: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 287; - break; - case 289: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 288; - break; - case 290: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 289; - break; - case 291: - if ((0x100000001000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 290; - break; - case 292: - if ((0x4000000040L & l) != 0L) - { jjAddStates(148, 154); } - break; - case 294: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 293; - break; - case 296: - case 419: - if ((0x800000008L & l) != 0L) - { jjCheckNAdd(36); } - break; - case 297: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 296; - break; - case 298: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 297; - break; - case 300: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 299; - break; - case 301: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 300; - break; - case 304: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 303; - break; - case 305: - if ((0x800000008000L & l) != 0L) - { jjCheckNAdd(3); } - break; - case 306: - if ((0x8000000080L & l) != 0L) - { jjCheckNAdd(30); } - break; - case 307: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 306; - break; - case 308: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 307; - break; - case 309: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 308; - break; - case 310: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 309; - break; - case 312: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 311; - break; - case 313: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 312; - break; - case 314: - if ((0x8000000080L & l) != 0L) - { jjCheckNAddStates(143, 147); } - break; - case 317: - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 316; - break; - case 318: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 317; - break; - case 319: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 318; - break; - case 320: - if ((0x800000008000L & l) != 0L && kind > 2) - kind = 2; - break; - case 321: - if ((0x10000000100000L & l) != 0L) - { jjCheckNAdd(320); } - break; - case 322: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 321; - break; - case 325: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 324; - break; - case 326: - if ((0x20000000200L & l) != 0L) - { jjAddStates(130, 142); } - break; - case 327: - if ((0x10000000100000L & l) != 0L) - { jjCheckNAdd(7); } - break; - case 328: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 327; - break; - case 329: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 328; - break; - case 330: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 329; - break; - case 331: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 330; - break; - case 334: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 333; - break; - case 335: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 334; - break; - case 336: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 335; - break; - case 337: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 336; - break; - case 338: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 337; - break; - case 339: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 338; - break; - case 341: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 340; - break; - case 342: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 341; - break; - case 343: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 342; - break; - case 344: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 343; - break; - case 346: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 345; - break; - case 347: - if ((0x100000001000L & l) != 0L) - { jjCheckNAdd(7); } - break; - case 348: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 347; - break; - case 349: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 348; - break; - case 350: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 349; - break; - case 351: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 350; - break; - case 352: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 351; - break; - case 353: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 352; - break; - case 354: - case 477: - if ((0x20000000200000L & l) != 0L) - { jjCheckNAdd(34); } - break; - case 355: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 354; - break; - case 356: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 355; - break; - case 357: - case 512: - case 558: - if ((0x40000000400000L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 358: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 357; - break; - case 359: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 358; - break; - case 360: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 359; - break; - case 361: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 360; - break; - case 362: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 361; - break; - case 363: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 362; - break; - case 364: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 363; - break; - case 365: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 364; - break; - case 367: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 366; - break; - case 368: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 367; - break; - case 369: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 368; - break; - case 370: - if ((0x400000004000L & l) != 0L) - { jjCheckNAdd(34); } - break; - case 374: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 373; - break; - case 375: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 374; - break; - case 379: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 378; - break; - case 380: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 379; - break; - case 381: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 380; - break; - case 382: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 381; - break; - case 384: - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 383; - break; - case 385: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 384; - break; - case 386: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 385; - break; - case 387: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 386; - break; - case 388: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 387; - break; - case 389: - if ((0x10000000100000L & l) != 0L) - { jjCheckNAdd(320); } - break; - case 390: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 389; - break; - case 392: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 391; - break; - case 393: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 392; - break; - case 394: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 393; - break; - case 395: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 394; - break; - case 397: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 396; - break; - case 398: - if ((0x100000001000L & l) != 0L) - { jjAddStates(125, 129); } - break; - case 399: - case 766: - if ((0x8000000080L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 400: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 399; - break; - case 401: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 400; - break; - case 402: - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 401; - break; - case 403: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 402; - break; - case 406: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 405; - break; - case 408: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 407; - break; - case 409: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 408; - break; - case 411: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 410; - break; - case 412: - if ((0x2000000020L & l) != 0L) - { jjCheckNAdd(280); } - break; - case 413: - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 412; - break; - case 414: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 413; - break; - case 417: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 416; - break; - case 418: - if ((0x200000002000L & l) != 0L) - { jjAddStates(121, 124); } - break; - case 425: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 424; - break; - case 426: - case 665: - case 835: - case 888: - if ((0x100000001000L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 429: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 428; - break; - case 431: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 430; - break; - case 432: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 431; - break; - case 433: - if ((0x400000004000L & l) != 0L) - { jjCheckNAddStates(114, 120); } - break; - case 434: - case 526: - case 550: - case 775: - if ((0x2000000020L & l) != 0L) - { jjCheckNAdd(156); } - break; - case 438: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 437; - break; - case 439: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 438; - break; - case 441: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 440; - break; - case 442: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 441; - break; - case 444: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 443; - break; - case 445: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 444; - break; - case 446: - if ((0x100000001000000L & l) != 0L) - { jjCheckNAdd(34); } - break; - case 447: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 446; - break; - case 448: - if ((0x4000000040L & l) != 0L && kind > 2) - kind = 2; - break; - case 452: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 451; - break; - case 453: - case 541: - if ((0x20000000200L & l) != 0L) - { jjCheckNAdd(251); } - break; - case 454: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 453; - break; - case 455: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 454; - break; - case 456: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 455; - break; - case 457: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 456; - break; - case 458: - if ((0x800000008000L & l) != 0L) - { jjCheckNAddStates(107, 113); } - break; - case 460: - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 459; - break; - case 461: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 460; - break; - case 462: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 461; - break; - case 463: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 462; - break; - case 464: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 463; - break; - case 465: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 464; - break; - case 466: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 465; - break; - case 467: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 466; - break; - case 470: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 469; - break; - case 471: - case 675: - if ((0x2000000020L & l) != 0L) - { jjCheckNAdd(30); } - break; - case 472: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 471; - break; - case 474: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 473; - break; - case 475: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 474; - break; - case 476: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 475; - break; - case 480: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 479; - break; - case 481: - if ((0x1000000010000L & l) != 0L) - { jjCheckNAdd(156); } - break; - case 482: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 481; - break; - case 483: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 482; - break; - case 484: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 483; - break; - case 485: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 484; - break; - case 486: - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 485; - break; - case 487: - if ((0x1000000010000L & l) != 0L) - { jjAddStates(96, 106); } - break; - case 490: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 489; - break; - case 491: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 490; - break; - case 492: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 491; - break; - case 493: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 492; - break; - case 495: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 494; - break; - case 496: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 495; - break; - case 497: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 496; - break; - case 499: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 498; - break; - case 501: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 500; - break; - case 502: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 501; - break; - case 503: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 502; - break; - case 504: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 503; - break; - case 505: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 504; - break; - case 506: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 505; - break; - case 507: - case 534: - case 825: - if ((0x4000000040000L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 508: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 507; - break; - case 509: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 508; - break; - case 510: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 509; - break; - case 511: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 510; - break; - case 513: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 512; - break; - case 514: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 513; - break; - case 515: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 514; - break; - case 516: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 515; - break; - case 517: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 516; - break; - case 518: - case 668: - if ((0x4000000040000L & l) != 0L) - { jjCheckNAdd(7); } - break; - case 519: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 518; - break; - case 520: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 519; - break; - case 521: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 520; - break; - case 522: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 521; - break; - case 524: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 523; - break; - case 525: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 524; - break; - case 527: - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 526; - break; - case 528: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 527; - break; - case 529: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 528; - break; - case 530: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 529; - break; - case 531: - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 530; - break; - case 532: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 531; - break; - case 533: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 532; - break; - case 535: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 534; - break; - case 536: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 535; - break; - case 537: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 536; - break; - case 538: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 537; - break; - case 539: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 538; - break; - case 540: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 539; - break; - case 542: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 541; - break; - case 543: - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 542; - break; - case 544: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 543; - break; - case 545: - if ((0x4000000040000L & l) != 0L) - { jjAddStates(88, 95); } - break; - case 548: - if ((0x200000002L & l) != 0L) - { jjCheckNAdd(280); } - break; - case 549: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 548; - break; - case 551: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 550; - break; - case 552: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 551; - break; - case 553: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 552; - break; - case 554: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 553; - break; - case 555: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 554; - break; - case 556: - if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 555; - break; - case 557: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 556; - break; - case 559: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 558; - break; - case 560: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 559; - break; - case 561: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 560; - break; - case 562: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 561; - break; - case 563: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 562; - break; - case 565: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 564; - break; - case 566: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 565; - break; - case 567: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 566; - break; - case 568: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 567; - break; - case 569: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 568; - break; - case 570: - if ((0x80000000800L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 571: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 570; - break; - case 572: - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 571; - break; - case 573: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 572; - break; - case 575: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 574; - break; - case 576: - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 575; - break; - case 577: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 576; - break; - case 579: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 578; - break; - case 580: - if ((0x80000000800000L & l) != 0L) - { jjCheckNAdd(156); } - break; - case 581: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 580; - break; - case 582: - if ((0x8000000080000L & l) != 0L) - { jjAddStates(71, 87); } - break; - case 583: - if ((0x200000002L & l) != 0L && kind > 2) - kind = 2; - break; - case 584: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 583; - break; - case 585: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 584; - break; - case 586: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 585; - break; - case 588: - if ((0x100000001000L & l) != 0L) - { jjCheckNAdd(280); } - break; - case 589: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 588; - break; - case 590: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 589; - break; - case 591: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 590; - break; - case 593: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 592; - break; - case 595: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 594; - break; - case 597: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 596; - break; - case 598: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 597; - break; - case 599: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 598; - break; - case 600: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 599; - break; - case 602: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 601; - break; - case 603: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 602; - break; - case 604: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 603; - break; - case 605: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 604; - break; - case 607: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 606; - break; - case 608: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 607; - break; - case 609: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 608; - break; - case 610: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 609; - break; - case 611: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 610; - break; - case 612: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 611; - break; - case 613: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 612; - break; - case 614: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 613; - break; - case 615: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 614; - break; - case 616: - if ((0x2000000020L & l) != 0L) - { jjCheckNAdd(34); } - break; - case 618: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 617; - break; - case 620: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 619; - break; - case 621: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 620; - break; - case 622: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 621; - break; - case 623: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 622; - break; - case 624: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 623; - break; - case 626: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 625; - break; - case 628: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 627; - break; - case 629: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 628; - break; - case 630: - if ((0x2000000020000L & l) != 0L) - { jjCheckNAdd(280); } - break; - case 632: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 631; - break; - case 633: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 632; - break; - case 635: - if ((0x2000000020000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 634; - break; - case 637: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 636; - break; - case 638: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 637; - break; - case 639: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 638; - break; - case 640: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 639; - break; - case 641: - if ((0x2000000020000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 640; - break; - case 643: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 642; - break; - case 644: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 643; - break; - case 645: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 644; - break; - case 646: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 645; - break; - case 647: - if ((0x2000000020000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 646; - break; - case 649: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 648; - break; - case 650: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 649; - break; - case 651: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 650; - break; - case 652: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 651; - break; - case 654: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 653; - break; - case 656: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 655; - break; - case 657: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 656; - break; - case 658: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 657; - break; - case 659: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 658; - break; - case 660: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 659; - break; - case 661: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 660; - break; - case 662: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 661; - break; - case 663: - if ((0x200000002000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 662; - break; - case 664: - if ((0x10000000100000L & l) != 0L) - { jjCheckNAddStates(57, 70); } - break; - case 669: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 668; - break; - case 670: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 669; - break; - case 671: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 670; - break; - case 672: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 671; - break; - case 673: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 672; - break; - case 674: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 673; - break; - case 676: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 675; - break; - case 678: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 677; - break; - case 680: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 679; - break; - case 681: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 680; - break; - case 682: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 681; - break; - case 683: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 682; - break; - case 684: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 683; - break; - case 685: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 684; - break; - case 687: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 686; - break; - case 688: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 687; - break; - case 689: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 688; - break; - case 690: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 689; - break; - case 691: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 690; - break; - case 692: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 691; - break; - case 693: - if ((0x400000004000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 692; - break; - case 694: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 693; - break; - case 695: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 694; - break; - case 696: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 695; - break; - case 698: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 697; - break; - case 699: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 698; - break; - case 700: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 699; - break; - case 701: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 700; - break; - case 702: - if (curChar == 95) - jjstateSet[jjnewStateCnt++] = 701; - break; - case 703: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 702; - break; - case 704: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 703; - break; - case 705: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 704; - break; - case 706: - if ((0x400000004000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 705; - break; - case 707: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 706; - break; - case 708: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 707; - break; - case 709: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 708; - break; - case 711: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 710; - break; - case 712: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 711; - break; - case 713: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 712; - break; - case 715: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 714; - break; - case 717: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 716; - break; - case 718: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 717; - break; - case 719: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 718; - break; - case 720: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 719; - break; - case 721: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 720; - break; - case 722: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 721; - break; - case 723: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 722; - break; - case 724: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 723; - break; - case 726: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 725; - break; - case 727: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 726; - break; - case 728: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 727; - break; - case 729: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 728; - break; - case 730: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 729; - break; - case 731: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 730; - break; - case 733: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 732; - break; - case 734: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 733; - break; - case 735: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 734; - break; - case 736: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 735; - break; - case 737: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 736; - break; - case 738: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 737; - break; - case 739: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 738; - break; - case 740: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 739; - break; - case 741: - if ((0x200000002000L & l) != 0L && kind > 2) - kind = 2; - break; - case 742: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 741; - break; - case 743: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 742; - break; - case 744: - if ((0x20000000200000L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 745: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 744; - break; - case 746: - if ((0x20000000200000L & l) != 0L) - { jjAddStates(50, 56); } - break; - case 748: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 747; - break; - case 751: - if ((0x2000000020000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 750; - break; - case 752: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 751; - break; - case 753: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 752; - break; - case 754: - if ((0x80000000800000L & l) != 0L) - { jjCheckNAdd(30); } - break; - case 755: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 754; - break; - case 756: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 755; - break; - case 757: - if ((0x80000000800L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 756; - break; - case 758: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 757; - break; - case 760: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 759; - break; - case 761: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 760; - break; - case 762: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 761; - break; - case 764: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 763; - break; - case 765: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 764; - break; - case 768: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 767; - break; - case 769: - if ((0x2000000020L & l) != 0L) - { jjCheckNAdd(3); } - break; - case 770: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 769; - break; - case 771: - if ((0x40000000400000L & l) != 0L) - { jjAddStates(45, 49); } - break; - case 773: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 772; - break; - case 774: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 773; - break; - case 776: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 775; - break; - case 777: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 776; - break; - case 778: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 777; - break; - case 780: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 779; - break; - case 781: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 780; - break; - case 782: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 781; - break; - case 783: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 782; - break; - case 785: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 784; - break; - case 786: - if ((0x200000002000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 785; - break; - case 787: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 786; - break; - case 788: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 787; - break; - case 789: - if ((0x80000000800000L & l) != 0L && kind > 2) - kind = 2; - break; - case 790: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 789; - break; - case 791: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 790; - break; - case 792: - if ((0x80000000800000L & l) != 0L) - { jjAddStates(40, 44); } - break; - case 796: - if ((0x40000000400000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 795; - break; - case 797: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 796; - break; - case 799: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 798; - break; - case 800: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 799; - break; - case 802: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 801; - break; - case 803: - if ((0x4000000040000L & l) != 0L) - { jjCheckNAdd(102); } - break; - case 804: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 803; - break; - case 806: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 805; - break; - case 807: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 806; - break; - case 808: - if ((0x1000000010L & l) != 0L) - { jjAddStates(23, 39); } - break; - case 811: - if ((0x200000002L & l) != 0L) - { jjCheckNAdd(7); } - break; - case 813: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 812; - break; - case 814: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 813; - break; - case 815: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 814; - break; - case 816: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 815; - break; - case 817: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 816; - break; - case 819: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 818; - break; - case 821: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 820; - break; - case 822: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 821; - break; - case 823: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 822; - break; - case 824: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 823; - break; - case 826: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 825; - break; - case 827: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 826; - break; - case 828: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 827; - break; - case 829: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 828; - break; - case 830: - if ((0x100000001000L & l) != 0L) - { jjCheckNAdd(34); } - break; - case 831: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 830; - break; - case 832: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 831; - break; - case 833: - if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 832; - break; - case 834: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 833; - break; - case 836: - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 835; - break; - case 837: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 836; - break; - case 838: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 837; - break; - case 839: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 838; - break; - case 840: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 839; - break; - case 841: - if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 840; - break; - case 842: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 841; - break; - case 844: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 843; - break; - case 845: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 844; - break; - case 846: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 845; - break; - case 847: - if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 846; - break; - case 848: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 847; - break; - case 850: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 849; - break; - case 851: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 850; - break; - case 852: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 851; - break; - case 853: - if ((0x400000004L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 854: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 853; - break; - case 857: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 856; - break; - case 858: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 857; - break; - case 860: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 859; - break; - case 861: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 860; - break; - case 862: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 861; - break; - case 863: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 862; - break; - case 864: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 863; - break; - case 865: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 864; - break; - case 866: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 865; - break; - case 867: - if ((0x800000008L & l) != 0L) - { jjCheckNAdd(156); } - break; - case 868: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 867; - break; - case 869: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 868; - break; - case 870: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 869; - break; - case 871: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 870; - break; - case 872: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 871; - break; - case 873: - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 872; - break; - case 875: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 874; - break; - case 877: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 876; - break; - case 878: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 877; - break; - case 879: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 878; - break; - case 880: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 879; - break; - case 882: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 881; - break; - case 883: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 882; - break; - case 885: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 884; - break; - case 886: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 885; - break; - case 887: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 886; - break; - case 889: - if ((0x400000004L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 888; - break; - case 890: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 889; - break; - case 891: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 890; - break; - case 892: - if ((0x800000008000L & l) != 0L) - { jjCheckNAdd(217); } - break; - case 893: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 892; - break; - case 894: - if ((0x10000000100000L & l) != 0L && kind > 20) - kind = 20; - break; - case 895: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 894; - break; - case 896: - if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 895; - break; - case 898: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 897; - break; - case 899: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 898; - break; - case 900: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 899; - break; - case 901: - if ((0x200000002L & l) != 0L) - { jjCheckNAddStates(12, 22); } - break; - case 903: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 902; - break; - case 904: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 903; - break; - case 909: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 908; - break; - case 911: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 910; - break; - case 912: - if ((0x1000000010L & l) != 0L) - { jjCheckNAdd(53); } - break; - case 914: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 913; - break; - case 915: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 914; - break; - case 916: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 915; - break; - case 917: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 916; - break; - case 918: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 917; - break; - case 920: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 919; - break; - case 921: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 920; - break; - case 922: - if ((0x400000004000L & l) != 0L) - { jjCheckNAdd(7); } - break; - case 923: - if ((0x4000000040000L & l) != 0L) - { jjCheckNAdd(13); } - break; - case 925: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 924; - break; - case 926: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 925; - break; - case 927: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 926; - break; - case 928: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 927; - break; - case 930: - if ((0x8000000080000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 929; - break; - case 932: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 931; - break; - case 933: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 932; - break; - case 934: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 933; - break; - case 935: - if ((0x400000004000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 934; - break; - case 936: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 935; - break; - case 937: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 936; - break; - case 938: - if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 937; - break; - case 939: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 938; - break; - case 940: - if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 939; - break; - case 941: - if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 940; - break; - case 942: - if ((0x100000001000L & l) != 0L && kind > 20) - kind = 20; - break; - case 943: - if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 942; - break; - case 946: - if ((0x2000000020L & l) != 0L) - { jjAddStates(199, 200); } - break; - case 960: - case 961: - if ((0x6fffffffefffffffL & l) == 0L) - break; - if (kind > 102) - kind = 102; - { jjCheckNAdd(961); } - break; - default : break; - } - } while(i != startsAt); - } - else - { - int i2 = (curChar & 0xff) >> 6; - long l2 = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 23: - if ((jjbitVec0[i2] & l2) == 0L) - break; - if (kind > 91) - kind = 91; - { jjAddStates(9, 11); } - break; - default : break; - } - } while(i != startsAt); - } - if (kind != 0x7fffffff) - { - jjmatchedKind = kind; - jjmatchedPos = curPos; - kind = 0x7fffffff; - } - ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 962 - (jjnewStateCnt = startsAt))) - return curPos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return curPos; } - } -} -private final int jjStopStringLiteralDfa_1(int pos, long active0, long active1){ - switch (pos) - { - default : - return -1; - } -} -private final int jjStartNfa_1(int pos, long active0, long active1){ - return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0, active1), pos + 1); -} -private int jjMoveStringLiteralDfa0_1(){ - switch(curChar) - { - case 39: - return jjStartNfaWithStates_1(0, 94, 1); - default : - return jjMoveNfa_1(0, 0); - } -} -private int jjStartNfaWithStates_1(int pos, int kind, int state) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return pos + 1; } - return jjMoveNfa_1(state, pos + 1); -} -private int jjMoveNfa_1(int startState, int curPos) -{ - int startsAt = 0; - jjnewStateCnt = 3; - int i = 1; - jjstateSet[0] = startState; - int kind = 0x7fffffff; - for (;;) - { - if (++jjround == 0x7fffffff) - ReInitRounds(); - if (curChar < 64) - { - long l = 1L << curChar; - do - { - switch(jjstateSet[--i]) - { - case 0: - if ((0xffffff7fffffffffL & l) != 0L) - { - if (kind > 93) - kind = 93; - } - else if (curChar == 39) - jjstateSet[jjnewStateCnt++] = 1; - break; - case 1: - if (curChar == 39 && kind > 93) - kind = 93; - break; - case 2: - if (curChar == 39) - jjstateSet[jjnewStateCnt++] = 1; - break; - default : break; - } - } while(i != startsAt); - } - else if (curChar < 128) - { - long l = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 0: - kind = 93; - break; - default : break; - } - } while(i != startsAt); - } - else - { - int i2 = (curChar & 0xff) >> 6; - long l2 = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 0: - if ((jjbitVec0[i2] & l2) != 0L && kind > 93) - kind = 93; - break; - default : break; - } - } while(i != startsAt); - } - if (kind != 0x7fffffff) - { - jjmatchedKind = kind; - jjmatchedPos = curPos; - kind = 0x7fffffff; - } - ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt))) - return curPos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return curPos; } - } -} -static final int[] jjnextStates = { - 951, 952, 953, 946, 955, 956, 958, 959, 960, 23, 24, 26, 907, 911, 912, 918, - 921, 922, 923, 930, 34, 941, 943, 810, 811, 819, 824, 829, 834, 842, 848, 852, - 858, 866, 875, 883, 887, 891, 893, 900, 794, 800, 802, 804, 807, 774, 778, 783, - 788, 791, 749, 753, 758, 762, 765, 768, 770, 667, 674, 676, 678, 685, 696, 709, - 320, 715, 724, 731, 740, 743, 745, 587, 591, 595, 600, 605, 615, 616, 618, 624, - 626, 629, 630, 635, 641, 647, 654, 663, 547, 549, 557, 563, 569, 573, 579, 581, - 488, 493, 499, 506, 511, 517, 522, 525, 533, 540, 544, 468, 448, 470, 472, 476, - 480, 486, 436, 442, 445, 447, 320, 452, 457, 421, 425, 429, 432, 404, 406, 411, - 414, 417, 332, 339, 346, 353, 356, 365, 369, 370, 375, 382, 388, 390, 397, 315, - 319, 320, 322, 325, 295, 298, 301, 304, 305, 310, 313, 249, 250, 257, 261, 265, - 272, 274, 279, 286, 291, 52, 59, 61, 63, 69, 71, 78, 87, 101, 105, 108, - 114, 119, 126, 130, 134, 139, 147, 155, 165, 171, 176, 187, 191, 196, 206, 216, - 232, 242, 246, 33, 35, 44, 46, 947, 948, -}; - -/** Token literal values. */ -public static final String[] jjstrLiteralImages = { -"", null, null, "\50", "\51", "\56", "\54", "\73", "\174\174", "\53", "\55", -"\52", "\57", "\75", null, "\74", "\74\75", "\76", "\76\75", null, null, null, null, -null, null, null, null, null, null, null, null, null, null, null, null, null, null, -null, null, null, null, null, null, null, null, null, null, null, null, null, null, -null, null, null, null, null, null, null, null, null, null, null, null, null, null, -null, null, null, null, null, null, null, null, null, null, null, null, null, null, -null, null, null, null, null, null, null, null, null, null, null, null, null, null, -null, null, null, null, null, null, null, null, null, null, null, }; -protected Token jjFillToken() -{ - final Token t; - final String curTokenImage; - final int beginLine; - final int endLine; - final int beginColumn; - final int endColumn; - String im = jjstrLiteralImages[jjmatchedKind]; - curTokenImage = (im == null) ? input_stream.GetImage() : im; - beginLine = input_stream.getBeginLine(); - beginColumn = input_stream.getBeginColumn(); - endLine = input_stream.getEndLine(); - endColumn = input_stream.getEndColumn(); - t = Token.newToken(jjmatchedKind, curTokenImage); - - t.beginLine = beginLine; - t.endLine = endLine; - t.beginColumn = beginColumn; - t.endColumn = endColumn; - - return t; -} - -int curLexState = 0; -int defaultLexState = 0; -int jjnewStateCnt; -int jjround; -int jjmatchedPos; -int jjmatchedKind; - -/** Get the next Token. */ -public Token getNextToken() -{ - Token matchedToken; - int curPos = 0; - - EOFLoop : - for (;;) - { - try - { - curChar = input_stream.BeginToken(); - } - catch(java.io.IOException e) - { - jjmatchedKind = 0; - jjmatchedPos = -1; - matchedToken = jjFillToken(); - CommonTokenAction(matchedToken); - return matchedToken; - } - image = jjimage; - image.setLength(0); - jjimageLen = 0; - - for (;;) - { - switch(curLexState) - { - case 0: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_0(); - break; - case 1: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_1(); - break; - case 2: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_2(); - break; - } - if (jjmatchedKind != 0x7fffffff) - { - if (jjmatchedPos + 1 < curPos) - input_stream.backup(curPos - jjmatchedPos - 1); - if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) - { - matchedToken = jjFillToken(); - TokenLexicalActions(matchedToken); - if (jjnewLexState[jjmatchedKind] != -1) - curLexState = jjnewLexState[jjmatchedKind]; - CommonTokenAction(matchedToken); - return matchedToken; - } - else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) - { - if (jjnewLexState[jjmatchedKind] != -1) - curLexState = jjnewLexState[jjmatchedKind]; - continue EOFLoop; - } - jjimageLen += jjmatchedPos + 1; - if (jjnewLexState[jjmatchedKind] != -1) - curLexState = jjnewLexState[jjmatchedKind]; - curPos = 0; - jjmatchedKind = 0x7fffffff; - try { - curChar = input_stream.readChar(); - continue; - } - catch (java.io.IOException e1) { } - } - int error_line = input_stream.getEndLine(); - int error_column = input_stream.getEndColumn(); - String error_after = null; - boolean EOFSeen = false; - try { input_stream.readChar(); input_stream.backup(1); } - catch (java.io.IOException e1) { - EOFSeen = true; - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - if (curChar == '\n' || curChar == '\r') { - error_line++; - error_column = 0; - } - else - error_column++; - } - if (!EOFSeen) { - input_stream.backup(1); - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - } - throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); - } - } -} - -void TokenLexicalActions(Token matchedToken) -{ - switch(jjmatchedKind) - { - case 2 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.sqlReserved = true; - break; - case 19 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 20 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 21 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 22 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 23 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 24 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 25 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 26 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 27 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 28 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 29 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 30 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 31 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 32 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 33 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 34 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 35 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 36 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 37 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 38 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 39 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 40 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 41 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 42 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 43 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 44 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 45 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 46 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 47 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 48 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = true; - break; - case 49 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 50 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 51 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 52 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 53 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 54 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 55 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 56 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 57 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 58 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 59 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 60 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 61 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 62 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 63 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 64 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 65 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 66 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 67 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 68 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 69 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 70 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 71 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 72 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 73 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 74 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 75 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 76 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 77 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 78 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 79 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 80 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 81 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 82 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 83 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 84 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 85 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 86 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 87 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 88 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 89 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - case 90 : - image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); - matchedToken.adqlReserved = matchedToken.isFunctionName = true; - break; - default : - break; - } -} -private void jjCheckNAdd(int state) -{ - if (jjrounds[state] != jjround) - { - jjstateSet[jjnewStateCnt++] = state; - jjrounds[state] = jjround; - } -} -private void jjAddStates(int start, int end) -{ - do { - jjstateSet[jjnewStateCnt++] = jjnextStates[start]; - } while (start++ != end); -} -private void jjCheckNAddTwoStates(int state1, int state2) -{ - jjCheckNAdd(state1); - jjCheckNAdd(state2); -} - -private void jjCheckNAddStates(int start, int end) -{ - do { - jjCheckNAdd(jjnextStates[start]); - } while (start++ != end); -} - - /** Constructor. */ - public ADQLParser201TokenManager(SimpleCharStream stream){ - - if (SimpleCharStream.staticFlag) - throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); - - input_stream = stream; - } - - /** Constructor. */ - public ADQLParser201TokenManager (SimpleCharStream stream, int lexState){ - ReInit(stream); - SwitchTo(lexState); - } - - /** Reinitialise parser. */ - public void ReInit(SimpleCharStream stream) - { - jjmatchedPos = jjnewStateCnt = 0; - curLexState = defaultLexState; - input_stream = stream; - ReInitRounds(); - } - - private void ReInitRounds() - { - int i; - jjround = 0x80000001; - for (i = 962; i-- > 0;) - jjrounds[i] = 0x80000000; - } - - /** Reinitialise parser. */ - public void ReInit(SimpleCharStream stream, int lexState) - { - ReInit(stream); - SwitchTo(lexState); - } - - /** Switch to specified lex state. */ - public void SwitchTo(int lexState) - { - if (lexState >= 3 || lexState < 0) - throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); - else - curLexState = lexState; - } - -/** Lexer state names. */ -public static final String[] lexStateNames = { - "DEFAULT", - "WithinString", - "WithinDelimitedId", -}; - -/** Lex State array. */ -public static final int[] jjnewLexState = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 0, -1, -1, -1, -1, 2, - -1, 0, -1, -1, -}; -static final long[] jjtoToken = { - 0xfffffffffffffffdL, 0x63c7ffffffL, -}; -static final long[] jjtoSkip = { - 0x2L, 0x8000000L, -}; -static final long[] jjtoMore = { - 0x0L, 0x1830000000L, -}; - protected SimpleCharStream input_stream; - - private final int[] jjrounds = new int[962]; - private final int[] jjstateSet = new int[2 * 962]; - - private final StringBuilder jjimage = new StringBuilder(); - private StringBuilder image = jjimage; - private int jjimageLen; - private int lengthOfMatch; - - protected char curChar; -} diff --git a/src/adql/parser/ADQLParserFactory.java b/src/adql/parser/ADQLParserFactory.java deleted file mode 100644 index 735a370bf41fb127e71f8558a59f5cdacd51e403..0000000000000000000000000000000000000000 --- a/src/adql/parser/ADQLParserFactory.java +++ /dev/null @@ -1,370 +0,0 @@ -package adql.parser; - -import java.io.IOException; -import java.io.InputStream; - -import adql.db.exception.UnresolvedIdentifiersException; -import adql.query.ADQLQuery; -import adql.translator.PostgreSQLTranslator; -import adql.translator.TranslationException; - -/** - * Factory of ADQL parsers. - * - * <h3>ADQL versions</h3> - * - * <p> - * It is able to deal with all versions of the ADQL grammar supported by this - * library. All these versions are listed in the enumeration - * {@link ADQLVersion}. - * </p> - * - * <p> - * To create a such factory, an ADQL version must be provided. If none is - * given, the default one will be used (<i>see {@link #DEFAULT_VERSION}</i>). - * </p> - * - * <h3>Runnable class</h3> - * - * <p> - * This class includes a main function and thus, it can be executed directly. - * Its execution allows to parse an ADQL query. Then, in function of the passed - * parameters, it is possible to just check its syntax, translate it into SQL - * or try to fix the query. - * </p> - * <p><i> - * To get help about this program, just run it with the argument - * <code>-h</code> or <code>--help</code>. - * </i></p> - * - * @author Grégory Mantelet (CDS) - * @version 2.0 (04/2019) - * @since 2.0 - */ -public class ADQLParserFactory { - - /* ********************************************************************** - * VERSION MANAGEMENT - * ********************************************************************** */ - - /** - * Enumeration of all supported versions of the ADQL grammar. - * - * @author Grégory Mantelet (CDS) - * @version 2.0 (04/2019) - * @since 2.0 - */ - public static enum ADQLVersion { - /** Version REC-2.0 - <a href="http://www.ivoa.net/documents/cover/ADQL-20081030.html">http://www.ivoa.net/documents/cover/ADQL-20081030.html</a>. */ - V2_0, - /** Version PR-2.1 - <a href="http://www.ivoa.net/documents/ADQL/20180112/index.html">http://www.ivoa.net/documents/ADQL/20180112/index.html</a>. */ - V2_1; // TODO Move 2.1 as default when it becomes REC - - @Override - public String toString() { - return name().toLowerCase().replace('_', '.'); - } - - /** TODO JUnit for ADQLVersion.parse(String) - * Parse the given string as an ADQL version number. - * - * <p>This function should work with the following syntaxes:</p> - * <ul> - * <li><code>2.0</code></li> - * <li><code>2_0</code></li> - * <li><code>v2.0</code> or <code>V2.0</code></li> - * <li><code>v2_0</code> or <code>V2_0</code></li> - * </ul> - * - * @param str String to parse as an ADQL version specification. - * - * @return The identified ADQL version. - */ - public static ADQLVersion parse(String str) { - if (str == null) - return null; - - str = str.trim().toUpperCase(); - - if (str.isEmpty()) - return null; - - if (str.charAt(0) != 'V') - str = 'V' + str; - - try { - return ADQLVersion.valueOf(str.replaceAll("\\.", "_")); - } catch(IllegalArgumentException iae) { - return null; - } - } - } - - /** Version of the ADQL grammar to use when none is specified: - * {@link ADQLVersion#V2_0 2.0}. */ - public final static ADQLVersion DEFAULT_VERSION = ADQLVersion.V2_0; // TODO Move 2.1 as default when it becomes REC - - /** - * Get the list of all supported ADQL grammar versions. - * - * @return List of all supported ADQL versions. - * - * @see ADQLVersion#values() - */ - public static ADQLVersion[] getSupportedVersions() { - return ADQLVersion.values(); - } - - /** - * Build on the fly a human list of all supported ADQL grammar versions. - * - * <p><i><b>Example:</b> <code>v2.0</code>, <code>v2.1</code>.</i></p> - * - * @return List of all supported ADQL versions. - */ - public static String getSupportedVersionsAsString() { - StringBuilder buf = new StringBuilder(); - for(ADQLVersion v : ADQLVersion.values()) { - if (buf.length() > 0) - buf.append(", "); - buf.append(v.toString()); - if (v == DEFAULT_VERSION) - buf.append(" (default)"); - } - return buf.toString(); - } - - /* ********************************************************************** - * PARSER CREATION - * ********************************************************************** */ - - /** - * Builds a parser whose the query to parse will have to be given as a - * String in parameter of - * {@link ADQLParser#parseQuery(java.lang.String) parseQuery(String)}. - */ - public final ADQLParser createParser() { - return createParser(DEFAULT_VERSION); - } - - /** - * Builds a parser whose the query to parse will have to be given as a - * String in parameter of - * {@link ADQLParser#parseQuery(java.lang.String) parseQuery(String)}. - * - * @param version Version of the ADQL grammar that the parser must - * implement. - * <i>If NULL, the {@link #DEFAULT_VERSION} will be used.</i> - */ - public ADQLParser createParser(ADQLVersion version) { - // Prevent the NULL value by setting the default version if necessary: - if (version == null) - version = DEFAULT_VERSION; - - // Create the appropriate parser in function of the specified version: - switch(version) { - case V2_0: - return new ADQLParser200(); - case V2_1: - default: - return new ADQLParser201(); - } - } - - /* ********************************************************************** - * STATIC PARSER CREATION - * ********************************************************************** */ - - /** Factory to use only when a default parser is asked without any - * {@link ADQLParserFactory} instance. - * @see #createDefaultParser() */ - private static volatile ADQLParserFactory defaultFactory = null; - - /** - * Create an ADQL parser with the default ADQL grammar version (see - * {@link #DEFAULT_VERSION}). - * - * @return A new parser implementing the default version supported by this - * library. - */ - public final static ADQLParser createDefaultParser() { - // Create the default factory, if not already done: - if (defaultFactory == null) { - synchronized (ADQLParserFactory.class) { - if (defaultFactory == null) - defaultFactory = new ADQLParserFactory(); - } - } - - // Create a parser implementing the default version of the ADQL grammar: - return defaultFactory.createParser(DEFAULT_VERSION); - } - - /* ********************************************************************** - * MAIN FUNCTION - * ********************************************************************** */ - - /** - * Parses the given ADQL query. - * - * <p>The result of the parsing depends of the parameters:</p> - * - * <p> - * <b>ONLY the syntax is checked: the query is NOT EXECUTED !</b> - * </p> - */ - public static final void main(String[] args) throws Exception { - final String USAGE = "Usage:\n adqlParser.jar [-version=...] [-h] [-d] [-v] [-e] [-a|-s] [-f] [<FILE>|<URL>]\n\nNOTE: If no file or URL is given, the ADQL query is expected in the standard\n input. This query must end with a ';' or <Ctrl+D>!\n\nParameters:\n -version=... : Set the version of the ADQL grammar to follow.\n It must be one among: " + getSupportedVersionsAsString() + "\n -h or --help : Display this help.\n -v or --verbose : Print the main steps of the parsing\n -d or --debug : Print stack traces when a grave error occurs\n -e or --explain : Explain the ADQL parsing (or Expand the parsing tree)\n -a or --adql : Display the understood ADQL query\n -s or --sql : Ask the SQL translation of the given ADQL query\n (SQL compatible with PostgreSQL)\n -f or --try-fix : Try fixing the most common ADQL query issues before\n attempting to parse the query.\n\nReturn:\n By default: nothing if the query is correct. Otherwise a message explaining\n why the query is not correct is displayed.\n With the -s option, the SQL translation of the given ADQL query will be\n returned.\n With the -a option, the ADQL query is returned as it has been understood.\n\nExit status:\n 0 OK !\n 1 Parameter error (missing or incorrect parameter)\n 2 File error (incorrect file/url, reading error, ...)\n 3 Parsing error (syntactic or semantic error)\n 4 Translation error (a problem has occurred during the translation of the\n given ADQL query in SQL)."; - final String NEED_HELP_MSG = "Try -h or --help to get more help about the usage of this program."; - final String urlRegex = "^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"; - - ADQLParser parser; - - short mode = -1; - String file = null; - ADQLVersion version = DEFAULT_VERSION; - boolean verbose = false, debug = false, explain = false, tryFix = false; - - // Parameters reading: - for(int i = 0; i < args.length; i++) { - if (args[i].startsWith("-version=")) { - String[] parts = args[i].split("="); - if (parts.length <= 1) { - System.err.println("((!)) Missing ADQL version! It must be one among: " + getSupportedVersionsAsString() + ". ((!))\n" + NEED_HELP_MSG); - System.exit(1); - } - String strVersion = parts[1].replaceAll("\\.", "_"); - version = ADQLVersion.parse(strVersion); - if (version == null) { - System.err.println("((!)) Incorrect ADQL version: \"" + args[i].split("=")[1] + "\"! It must be one among: " + getSupportedVersionsAsString() + ". ((!))\n" + NEED_HELP_MSG); - System.exit(1); - } - } else if (args[i].equalsIgnoreCase("-d") || args[i].equalsIgnoreCase("--debug")) - debug = true; - else if (args[i].equalsIgnoreCase("-v") || args[i].equalsIgnoreCase("--verbose")) - verbose = true; - else if (args[i].equalsIgnoreCase("-e") || args[i].equalsIgnoreCase("--explain")) - explain = true; - else if (args[i].equalsIgnoreCase("-a") || args[i].equalsIgnoreCase("--adql")) { - if (mode != -1) { - System.err.println("((!)) Too much parameter: you must choose between -s, -c, -a or nothing ((!))\n" + NEED_HELP_MSG); - System.exit(1); - } else - mode = 1; - } else if (args[i].equalsIgnoreCase("-s") || args[i].equalsIgnoreCase("--sql")) { - if (mode != -1) { - System.err.println("((!)) Too much parameter: you must choose between -s, -c, -a or nothing ((!))\n" + NEED_HELP_MSG); - System.exit(1); - } else - mode = 2; - } else if (args[i].equalsIgnoreCase("-f") || args[i].equalsIgnoreCase("--try-fix")) - tryFix = true; - else if (args[i].equalsIgnoreCase("-h") || args[i].equalsIgnoreCase("--help")) { - System.out.println(USAGE); - System.exit(0); - } else if (args[i].startsWith("-")) { - System.err.println("((!)) Unknown parameter: \"" + args[i] + "\" ((!))\u005cn" + NEED_HELP_MSG); - System.exit(1); - } else - file = args[i].trim(); - } - - try { - - // Get the parser for the specified ADQL version: - parser = (new ADQLParserFactory()).createParser(version); - - // Try fixing the query, if asked: - InputStream in = null; - if (tryFix) { - if (verbose) - System.out.println("((i)) Trying to automatically fix the query..."); - - String query; - try { - // get the input stream... - if (file == null || file.length() == 0) - in = System.in; - else if (file.matches(urlRegex)) - in = (new java.net.URL(file)).openStream(); - else - in = new java.io.FileInputStream(file); - - // ...and try fixing the query: - query = parser.tryQuickFix(in); - } finally { - // close the stream (if opened): - if (in != null) - in.close(); - in = null; - } - - if (verbose) - System.out.println("((i)) SUGGESTED QUERY:\n" + query); - - // Initialise the parser with this fixed query: - in = new java.io.ByteArrayInputStream(query.getBytes()); - } - // Otherwise, take the query as provided: - else { - // Initialise the parser with the specified input: - if (file == null || file.length() == 0) - in = System.in; - else if (file.matches(urlRegex)) - in = (new java.net.URL(file)).openStream(); - else - in = new java.io.FileInputStream(file); - } - - // Enable/Disable the debugging in function of the parameters: - parser.setDebug(explain); - - // Query parsing: - try { - if (verbose) - System.out.print("((i)) Parsing ADQL query..."); - ADQLQuery q = parser.parseQuery(in); - if (verbose) - System.out.println("((i)) CORRECT ADQL QUERY ((i))"); - if (mode == 2) { - PostgreSQLTranslator translator = new PostgreSQLTranslator(); - if (verbose) - System.out.print("((i)) Translating in SQL..."); - String sql = translator.translate(q); - if (verbose) - System.out.println("ok"); - System.out.println(sql); - } else if (mode == 1) { - System.out.println(q.toADQL()); - } - } catch(UnresolvedIdentifiersException uie) { - System.err.println("((X)) " + uie.getNbErrors() + " unresolved identifiers:"); - for(ParseException pe : uie) - System.err.println("\t - at " + pe.getPosition() + ": " + uie.getMessage()); - if (debug) - uie.printStackTrace(System.err); - System.exit(3); - } catch(ParseException pe) { - System.err.println("((X)) Syntax error: " + pe.getMessage() + " ((X))"); - if (debug) - pe.printStackTrace(System.err); - System.exit(3); - } catch(TranslationException te) { - if (verbose) - System.out.println("error"); - System.err.println("((X)) Translation error: " + te.getMessage() + " ((X))"); - if (debug) - te.printStackTrace(System.err); - System.exit(4); - } - - } catch(IOException ioe) { - System.err.println("\n((X)) Error while reading the file \"" + file + "\": " + ioe.getMessage() + " ((X))"); - if (debug) - ioe.printStackTrace(System.err); - System.exit(2); - } - - } - -} diff --git a/src/adql/parser/ADQLQueryFactory.java b/src/adql/parser/ADQLQueryFactory.java index a75c3c493958eb8eba8f2fa8240f2e247df747de..936dff3802e1004d2946594085bf2c51aa0544c6 100644 --- a/src/adql/parser/ADQLQueryFactory.java +++ b/src/adql/parser/ADQLQueryFactory.java @@ -23,7 +23,7 @@ package adql.parser; import java.util.Collection; import adql.db.FunctionDef; -import adql.parser.ADQLParserFactory.ADQLVersion; +import adql.parser.ADQLParser.ADQLVersion; import adql.parser.IdentifierItems.IdentifierItem; import adql.query.ADQLOrder; import adql.query.ADQLQuery; diff --git a/src/adql/parser/IdentifierItems.java b/src/adql/parser/IdentifierItems.java index 2cd0ae1baca90109fed14062417e8b05df26a527..fd71c214503473651b96c2329ea044771629b147 100644 --- a/src/adql/parser/IdentifierItems.java +++ b/src/adql/parser/IdentifierItems.java @@ -20,6 +20,9 @@ package adql.parser; * Astronomisches Rechen Institut (ARI) */ + +import adql.parser.grammar.Token; + import adql.query.IdentifierField; import adql.query.TextPosition; diff --git a/src/adql/parser/QueryChecker.java b/src/adql/parser/QueryChecker.java index dec0c618926f409650ecc98124a786813b052f9a..2ee116ff7b422058b415906c150e6eb4b282ebe2 100644 --- a/src/adql/parser/QueryChecker.java +++ b/src/adql/parser/QueryChecker.java @@ -21,6 +21,7 @@ package adql.parser; */ import adql.db.DBChecker; +import adql.parser.grammar.ParseException; import adql.query.ADQLQuery; /** diff --git a/src/adql/parser/QueryFixer.java b/src/adql/parser/QueryFixer.java new file mode 100644 index 0000000000000000000000000000000000000000..d6a887e663ce77da14b92678692fc08891607ebd --- /dev/null +++ b/src/adql/parser/QueryFixer.java @@ -0,0 +1,258 @@ +package adql.parser; + +/* + * This file is part of ADQLLibrary. + * + * ADQLLibrary is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ADQLLibrary is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright 2019 - UDS/Centre de Données astronomiques de Strasbourg (CDS) + */ + +import java.util.HashMap; +import java.util.Map; + +import adql.parser.grammar.ADQLGrammar; +import adql.parser.grammar.ADQLGrammar.Tokenizer; +import adql.parser.grammar.ParseException; +import adql.parser.grammar.Token; +import adql.parser.grammar.TokenMgrError; + +/** + * Tool able to fix some common errors in ADQL queries. + * + * <p><i>See {@link #fix(String)} for more details.</i></p> + * + * @author Grégory Mantelet (CDS) + * @version 2.0 (08/2019) + * + * @since 2.0 + * + * @see ADQLParser + */ +public class QueryFixer { + + /** The used internal ADQL grammar parser. */ + protected final ADQLGrammar grammarParser; + + /** + * All of the most common Unicode confusable characters and their + * ASCII/UTF-8 alternative. + * + * <p> + * Keys of this map represent the ASCII character while the values are the + * regular expression for all possible Unicode alternatives. + * </p> + * + * <p><i><b>Note:</b> + * All of them have been listed using + * <a href="https://unicode.org/cldr/utility/confusables.jsp">Unicode Utilities: Confusables</a>. + * </i></p> + */ + protected final Map<String, String> mapRegexUnicodeConfusable; + + /** Regular expression matching all Unicode alternatives for <code>-</code>. */ + protected final String REGEX_DASH = "[-\u02d7\u06d4\u2010\u2011\u2012\u2013\u2043\u2212\u2796\u2cba\ufe58\u2014\u2015\u207b\u208b\u0096\u058a\ufe63\uff0d]"; + /** Regular expression matching all Unicode alternatives for <code>_</code>. */ + protected final String REGEX_UNDERSCORE = "[_\u07fa\ufe4d\ufe4e\ufe4f]"; + /** Regular expression matching all Unicode alternatives for <code>'</code>. */ + protected final String REGEX_QUOTE = "['`\u00b4\u02b9\u02bb\u02bc\u02bd\u02be\u02c8\u02ca\u02cb\u02f4\u0374\u0384\u055a\u055d\u05d9\u05f3\u07f4\u07f5\u144a\u16cc\u1fbd\u1fbf\u1fef\u1ffd\u1ffe\u2018\u2019\u201b\u2032\u2035\ua78c\uff07\uff40]"; + /** Regular expression matching all Unicode alternatives for <code>"</code>. */ + protected final String REGEX_DOUBLE_QUOTE = "[\u02ba\u02dd\u02ee\u02f6\u05f2\u05f4\u1cd3\u201c\u201d\u201f\u2033\u2036\u3003\uff02]"; + /** Regular expression matching all Unicode alternatives for <code>.</code>. */ + protected final String REGEX_STOP = "[.\u0660\u06f0\u0701\u0702\u2024\ua4f8\ua60e]"; + /** Regular expression matching all Unicode alternatives for <code>+</code>. */ + protected final String REGEX_PLUS = "[+\u16ed\u2795]"; + /** Regular expression matching all Unicode alternatives for <code> </code>. */ + protected final String REGEX_SPACE = "[ \u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f]"; + /** Regular expression matching all Unicode alternatives for <code><</code>. */ + protected final String REGEX_LESS_THAN = "[<\u02c2\u1438\u16b2\u2039\u276e]"; + /** Regular expression matching all Unicode alternatives for <code>></code>. */ + protected final String REGEX_GREATER_THAN = "[>\u02c3\u1433\u203a\u276f]"; + /** Regular expression matching all Unicode alternatives for <code>=</code>. */ + protected final String REGEX_EQUAL = "[=\u1400\u2e40\u30a0\ua4ff]"; + + public QueryFixer(final ADQLGrammar grammar) throws NullPointerException { + if (grammar == null) + throw new NullPointerException("Missing ADQL grammar parser!"); + grammarParser = grammar; + + mapRegexUnicodeConfusable = new HashMap<String, String>(10); + mapRegexUnicodeConfusable.put("-", REGEX_DASH); + mapRegexUnicodeConfusable.put("_", REGEX_UNDERSCORE); + mapRegexUnicodeConfusable.put("'", REGEX_QUOTE); + mapRegexUnicodeConfusable.put("\u005c"", REGEX_DOUBLE_QUOTE); + mapRegexUnicodeConfusable.put(".", REGEX_STOP); + mapRegexUnicodeConfusable.put("+", REGEX_PLUS); + mapRegexUnicodeConfusable.put(" ", REGEX_SPACE); + mapRegexUnicodeConfusable.put("<", REGEX_LESS_THAN); + mapRegexUnicodeConfusable.put(">", REGEX_GREATER_THAN); + mapRegexUnicodeConfusable.put("=", REGEX_EQUAL); + } + + /** + * Try fixing tokens/terms of the given ADQL query. + * + * <p> + * <b>This function does not try to fix syntactical or semantical errors.</b> + * It just try to fix the most common issues in ADQL queries, such as: + * </p> + * <ul> + * <li>some Unicode characters confusable with ASCII characters (like a + * space, a dash, ...) ; this function replace them by their ASCII + * alternative,</li> + * <li>any of the following are double quoted: + * <ul> + * <li>non regular ADQL identifiers + * (e.g. <code>_RAJ2000</code>),</li> + * <li>ADQL function names used as identifiers + * (e.g. <code>distance</code>)</li> + * <li>and SQL reserved keywords + * (e.g. <code>public</code>).</li> + * </ul> + * </li> + * </ul> + * + * <p><i><b>Note:</b> + * This function does not use any instance variable of this parser + * (especially the InputStream or Reader provided at initialisation or + * ReInit). + * </i></p> + * + * @param adqlQuery The input ADQL query to fix. + * + * @return The suggested correction of the given ADQL query. + * + * @throws ParseException If any unrecognised character is encountered, + * or if anything else prevented the tokenization + * of some characters/words/terms. + */ + public String fix(String adqlQuery) throws ParseException { + StringBuffer suggestedQuery = new StringBuffer(); + + // 1. Replace all Unicode confusable characters: + adqlQuery = replaceUnicodeConfusables(adqlQuery); + + /* 1.bis. Normalise new lines and tabulations + * (to simplify the column counting): */ + adqlQuery = adqlQuery.replaceAll("(\u005cr\u005cn|\u005cr|\u005cn)", System.getProperty("line.separator")).replaceAll("\u005ct", " "); + + // 2. Analyse the query token by token: + Tokenizer tokenizer = grammarParser.getTokenizer(adqlQuery); + + final String[] lines = adqlQuery.split(System.getProperty("line.separator")); + + try { + String suggestedToken; + int lastLine = 1, lastCol = 1; + + Token token = null, nextToken = tokenizer.nextToken(); + // for all tokens until the EOF or EOQ: + do { + // get the next token: + token = nextToken; + nextToken = (grammarParser.isEnd(token) ? null : tokenizer.nextToken()); + + // 3. Double quote any suspect token: + if (mustEscape(token, nextToken)) { + suggestedToken = "\u005c"" + token.image + "\u005c""; + } else + suggestedToken = token.image; + + /* 4. Append all space characters (and comments) before the + * token: */ + /* same line, just get the space characters between the last + * token and the one to append: */ + if (lastLine == token.beginLine) { + if (grammarParser.isEOF(token)) + suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1)); + else + suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1, token.beginColumn - (grammarParser.isEnd(token) ? 0 : 1))); + lastCol = token.endColumn + 1; + } + // not the same line... + else { + /* append all remaining space characters until the position + * of the token to append: */ + do { + suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1)).append('\u005cn'); + lastLine++; + lastCol = 1; + } while(lastLine < token.beginLine); + /* if there are still space characters before the token, + * append them as well: */ + if (lastCol < token.beginColumn) + suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1, token.beginColumn - 1)); + // finally, set the correct column position: + lastCol = token.endColumn + 1; + } + + // 5. Append the suggested token: + suggestedQuery.append(suggestedToken); + + } while(!grammarParser.isEnd(token)); + + } catch(TokenMgrError err) { + // wrap such errors and propagate them: + throw new ParseException(err); + } + + return suggestedQuery.toString(); + } + + /** + * Replace all Unicode characters that can be confused with other ASCI/UTF-8 + * characters (e.g. different spaces, dashes, ...) in their ASCII version. + * + * @param adqlQuery The ADQL query string in which Unicode confusable + * characters must be replaced. + * + * @return The same query without the most common Unicode confusable + * characters. + */ + protected String replaceUnicodeConfusables(final String adqlQuery) { + String newAdqlQuery = adqlQuery; + for(java.util.Map.Entry<String, String> confusable : mapRegexUnicodeConfusable.entrySet()) + newAdqlQuery = newAdqlQuery.replaceAll(confusable.getValue(), confusable.getKey()); + return newAdqlQuery; + } + + /** + * Tell whether the given token must be double quoted. + * + * <p> + * This function considers all the following as terms to double quote: + * </p> + * <ul> + * <li>SQL reserved keywords</li>, + * <li>unrecognised regular identifiers (e.g. neither a delimited nor a + * valid ADQL regular identifier)</li> + * <li>and ADQL function name without a parameters list.</li> + * </ul> + * + * @param token The token to analyze. + * @param nextToken The following token. (useful to detect the start of a + * function's parameters list) + * + * @return <code>true</code> if the given token must be double quoted, + * <code>false</code> to keep it as provided. + */ + protected boolean mustEscape(final Token token, final Token nextToken) { + if (grammarParser.isSQLReservedWord(token)) + return true; + else if (grammarParser.isRegularIdentifierCandidate(token)) + return !grammarParser.isRegularIdentifier(token.image); + else + return token.isFunctionName && !grammarParser.isLeftPar(nextToken); + } +} diff --git a/src/adql/parser/grammar/ADQLGrammar.java b/src/adql/parser/grammar/ADQLGrammar.java new file mode 100644 index 0000000000000000000000000000000000000000..ff90da80553fd2a0e681f65f2ee995e2c1cff62d --- /dev/null +++ b/src/adql/parser/grammar/ADQLGrammar.java @@ -0,0 +1,438 @@ +package adql.parser.grammar; + +/* + * This file is part of ADQLLibrary. + * + * ADQLLibrary is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ADQLLibrary is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright 2019 - UDS/Centre de Données astronomiques de Strasbourg (CDS) + */ + +import java.io.InputStream; + +import adql.parser.ADQLParser; +import adql.parser.ADQLParser.ADQLVersion; +import adql.parser.ADQLQueryFactory; +import adql.query.ADQLQuery; +import adql.query.operand.ADQLOperand; +import adql.query.operand.StringConstant; + +/** + * API of a specific ADQL grammar's parser. + * + * <p> + * A concrete implementation of this interface lets parsing a full or partial + * ADQL query. It MUST follow ONLY ONE VERSION of an ADQL standard grammar. + * </p> + * + * <h3>Usage</h3> + * + * <p>Here is how to proceed in order to parse an ADQL expression:</p> + * <ol> + * <li>(Re-)Set the parser with the expression to parse,</li> + * <li>Call the appropriate parsing in function of what should be parsed + * (e.g. {@link #Query()} for a full ADQL query, {@link #Where()} for a + * WHERE clause),</li> + * <li>Get the result with {@link #getQuery()}.</li> + * </ol> + * + * <i> + * <p><b>Example 1:</b> Parse a full ADQL query</p> + * <pre> // 1. (Re-)Set the parser with the expression to parse: + * grammarParser.<b>reset(</b>new ByteArrayInputStream("SELECT foo FROM bar WHERE stuff = 1 ORDER BY 1 DESC LIMIT 10".getBytes())); + * + * // 2. Call the appropriate parsing: + * grammarParser.<b>Query()</b>; + * + * // 3. Get the result: + * System.out.println("RESULT: `" + <b>grammarParser.getQuery()</b>.toADQL() + "`")</pre> + * + * <p><b>Example 2:</b> Parse just a WHERE clause</p> + * <pre> // 1. (Re-)Set the parser with the expression to parse: + * grammarParser.<b>reset(</b>new ByteArrayInputStream("WHERE foo = 'bar' AND stuff = 1".getBytes())); + * + * // 2. Call the appropriate parsing: + * grammarParser.<b>Where()</b>; + * + * // 3. Get the result: + * System.out.println("RESULT: `" + <b>grammarParser.getQuery().getWhere()</b>.toADQL() + "`")</pre> + * </i> + * + * <h3>{@link ADQLGrammar} VS {@link ADQLParser}</h3> + * + * <p> + * Implementations of {@link ADQLGrammar} should not be used directly. These + * classes are generally generated by another tool from a grammar (e.g. JavaCC, + * PEG) which makes them quite difficult to use without knowledges on the used + * tool. Thus, this interface aims to simplify use of these grammar parsers. + * </p> + * + * <p> + * ADQL-Lib users should use {@link ADQLParser} instead of direct use of + * {@link ADQLGrammar} implementations. {@link ADQLParser} wraps the + * appropriate {@link ADQLGrammar} implementation in function of the specified + * ADQL Grammar version. It also includes additional tests (e.g. optional + * language features, UDFs, types) as well as some useful tool functions + * (e.g. tokenization, quick fix). + * </p> + * + * @see ADQLParser + * + * @author Grégory Mantelet (CDS) + * @version 2.0 (08/2019) + * @since 2.0 + */ +public interface ADQLGrammar { + + /* ********************************************************************** + * GETTERS/SETTERS * + ********************************************************************** */ + + /** + * Get the version of the ADQL Grammar implemented by this parser. + * + * @return Implemented ADQL Grammar version. <i>Never NULL</i> + */ + public ADQLVersion getVersion(); + + /** + * Get the result of the last ADQL query parsing. + * + * <p> + * This function returns something only if the ADQL expression parsing + * succeeded. Otherwise, NULL will be returned. + * </p> + * + * <p> + * Even if the parsed expression was not a full ADQL query, a full ADQL + * query tree is always returned as an instance of {@link ADQLQuery}. In + * case the parsed expression is an ADQL clause, the result will be set in + * the corresponding part of the ADQL tree. + * </p> + * + * <p><i><b>Example:</b> + * if {@link #Select()} has been successfully executed, an + * {@link ADQLQuery} with only the part corresponding to the + * <code>SELECT</code> will be filled ; this can then be got thanks to + * {@link ADQLQuery#getSelect()}. The same applies for all the individual + * parsing of the other ADQL clauses. + * </i></p> + * + * @return An ADQL query tree filled with the parsing result, + * or NULL if no ADQL query or clause has been parsed or if this + * parsing failed. + */ + public ADQLQuery getQuery(); + + /** + * Get the {@link ADQLQueryFactory} used by this Grammar Parser to create + * ADQL object representations (e.g. SELECT, column, string, constraint) + * while building the ADQL query tree + * + * @return The used {@link ADQLQueryFactory}. <i>Never NULL</i> + */ + public ADQLQueryFactory getQueryFactory(); + + /** + * Set the {@link ADQLQueryFactory} to use in order to create ADQL object + * representations (e.g. SELECT, column, string, constraint) while building + * the ADQL query tree. + * + * @param factory The {@link ADQLQueryFactory} to use. + * + * @throws NullPointerException If the given factory is NULL. + */ + public void setQueryFactory(final ADQLQueryFactory factory) throws NullPointerException; + + /* ********************************************************************** + * PARSER INITIALIZATION * + ********************************************************************** */ + + /** + * (Re-)Set the ADQL expression to parse. + * + * <p><i><b>Important note:</b> + * This function MUST always be called BEFORE calling any parsing function. + * </i></p> + * + * @param inputADQLExpression ADQL expression to parse. + * + * @throws NullPointerException If the given stream is NULL. + * @throws Exception If any error occurs while initializing the + * parser. + */ + public void reset(final InputStream inputADQLExpression) throws Exception; + + /* ********************************************************************** + * PARSING FUNCTIONS * + ********************************************************************** */ + + /** + * Parse the ADQL expression as a single full ADQL query. + * + * <p><i><b>Important note:</b> + * This function MUST always be called AFTER {@link #reset(InputStream)} + * with the ADQL expression to parse. + * </i></p> + * + * @return The corresponding ADQL tree. + * + * @throws ParseException If the parsing failed. + */ + public ADQLQuery Query() throws ParseException; + + /** + * Parse the ADQL expression as a single <code>SELECT</code> clause. + * + * <p>To get the result:</p> + * <pre>grammarParser.{@link #getQuery()}.{@link ADQLQuery#getSelect() getSelect()}</pre> + * + * <p><i><b>Important note:</b> + * This function MUST always be called AFTER {@link #reset(InputStream)} + * with the ADQL expression to parse. + * </i></p> + * + * @throws ParseException If the parsing failed. + */ + public void Select() throws ParseException; + + /** + * Parse the ADQL expression as a single <code>FROM</code> clause. + * + * <p>To get the result:</p> + * <pre>grammarParser.{@link #getQuery()}.{@link ADQLQuery#getFrom() getFrom()}</pre> + * + * <p><i><b>Important note:</b> + * This function MUST always be called AFTER {@link #reset(InputStream)} + * with the ADQL expression to parse. + * </i></p> + * + * @throws ParseException If the parsing failed. + */ + public void From() throws ParseException; + + /** + * Parse the ADQL expression as a single <code>WHERE</code> clause. + * + * <p>To get the result:</p> + * <pre>grammarParser.{@link #getQuery()}.{@link ADQLQuery#getWhere() getWhere()}</pre> + * + * <p><i><b>Important note:</b> + * This function MUST always be called AFTER {@link #reset(InputStream)} + * with the ADQL expression to parse. + * </i></p> + * + * @throws ParseException If the parsing failed. + */ + public void Where() throws ParseException; + + /** + * Parse the ADQL expression as a single <code>ORDER BY</code> clause. + * + * <p>To get the result:</p> + * <pre>grammarParser.{@link #getQuery()}.{@link ADQLQuery#getOrderBy() getOrderBy()}</pre> + * + * <p><i><b>Important note:</b> + * This function MUST always be called AFTER {@link #reset(InputStream)} + * with the ADQL expression to parse. + * </i></p> + * + * @throws ParseException If the parsing failed. + */ + public void OrderBy() throws ParseException; + + /** + * Parse the ADQL expression as a single <code>GROUP BY</code> clause. + * + * <p>To get the result:</p> + * <pre>grammarParser.{@link #getQuery()}.{@link ADQLQuery#getGroupBy() getGroupBy()}</pre> + * + * <p><i><b>Important note:</b> + * This function MUST always be called AFTER {@link #reset(InputStream)} + * with the ADQL expression to parse. + * </i></p> + * + * @throws ParseException If the parsing failed. + */ + public void GroupBy() throws ParseException; + + /** + * Parse the ADQL expression as a single string constant. + * + * <p><i><b>Important note:</b> + * This function MUST always be called AFTER {@link #reset(InputStream)} + * with the ADQL expression to parse. + * </i></p> + * + * <p><i><b>Implementation note:</b> + * This function is available here just for Unitary Test purpose. + * </i></p> + * + * @return The parsed {@link StringConstant}. + * + * @throws ParseException If the parsing failed. + */ + public ADQLOperand StringExpression() throws ParseException; + + /* ********************************************************************** + * TOKEN KIND TESTS * + ********************************************************************** */ + + public boolean isEOF(final Token token); + + public boolean isEOQ(final Token token); + + public boolean isRegularIdentifierCandidate(final Token token); + + public boolean isSQLReservedWord(final Token token); + + public boolean isLeftPar(final Token token); + + /** + * Tell whether the given token represents the end of an ADQL query. + * + * <p><i><b>Implementation note:</b> + * NULL is considered as a last token of a set. So, by extension it should + * also be considered as the end of an ADQL query. But this method should + * rely on the ADQL grammar. Consequently, at least the token for the + * semi-colon (;) and the token for the End-Of-File (EOF) should be + * considered as the correct one to use to indicate the end of an ADQL + * query. + * </i></p> + * + * @param token Token to analyze. <i>Might be NULL.</i> + * + * @return <code>true</code> if the given token represents a query end, + * <code>false</code> otherwise. + */ + public boolean isEnd(final Token token); + + /* ********************************************************************** + * TOKENIZATION HELPER * + ********************************************************************** */ + + /** + * Get an API giving access to the result of the tokenization of the given + * ADQL expression. + * + * @param expr The ADQL expression to tokenize. + * + * @return A {@link Tokenizer} object helping to iterate over the tokens of + * the given ADQL expression. + * + * @throws NullPointerException If the given ADQL expression is NULL. + */ + public Tokenizer getTokenizer(final String expr) throws NullPointerException; + + /** + * API helping to iterate over a set of {@link Token}s. + * + * @author Grégory Mantelet (CDS) + * @version 2.0 (08/2019) + * @since 2.0 + */ + public static interface Tokenizer { + /** + * Get the next available token. + * + * <p> + * The last available {@link Token} should + * + * @return The next token. + */ + public Token nextToken(); + } + + /* ********************************************************************** + * REGULAR IDENTIFIER TEST * + ********************************************************************** */ + + /** + * Tell whether the given string is a valid ADQL regular identifier. + * + * <p> + * According to the ADQL-2.0's BNF, a regular identifier (i.e. not + * delimited ; not between double quotes) must be a letter followed by a + * letter, digit or underscore. So, the following regular expression: + * </p> + * + * <pre>[a-zA-Z]+[a-zA-Z0-9_]*</pre> + * + * <p> + * This is what this function tests on the given string. + * </p> + * + * <p><i><b>Warning:</b> + * This function may return a different result for different versions of + * the ADQL grammar. + * </i></p> + * + * @param idCandidate The string to test. + * + * @return <code>true</code> if the given string is a valid regular + * identifier, + * <code>false</code> otherwise. + * + * @see #testRegularIdentifier(Token) + */ + public boolean isRegularIdentifier(final String idCandidate); + + /** + * Test the given token as an ADQL's regular identifier. + * + * <p><i><b>Implementation note:</b> + * This function uses {@link #isRegularIdentifier(String)} to test the + * given token's image. If the test fails, a {@link ParseException} is + * thrown. + * </i></p> + * + * @param token The token to test. + * + * @throws ParseException If the given token is not a valid ADQL regular + * identifier. + * + * @see #isRegularIdentifier(String) + */ + public void testRegularIdentifier(final Token token) throws ParseException; + + /* ********************************************************************** + * DEBUG & ERRORS MANAGEMENT * + ********************************************************************** */ + + /** + * Generate a {@link ParseException} instance representing the given + * {@link Exception}. + * + * <p><i><b>Implementation note:</b> + * If the given {@link Exception} is already a {@link ParseException} this + * function should do nothing else than returning it as such. + * </i></p> + * + * @param ex The exception to represent as a {@link ParseException}. + * + * @return The corresponding ParseException. + */ + public ParseException generateParseException(final Exception ex); + + /** + * Enable the deep tracing of the Grammar Parser. + */ + public void enable_tracing(); + + /** + * Disable the deep tracing of the Grammar Parser. + */ + public void disable_tracing(); + +} diff --git a/src/adql/parser/grammar/ADQLGrammarBase.java b/src/adql/parser/grammar/ADQLGrammarBase.java new file mode 100644 index 0000000000000000000000000000000000000000..7bf92eda4399bfe7ba6b4ae997b46643d609459c --- /dev/null +++ b/src/adql/parser/grammar/ADQLGrammarBase.java @@ -0,0 +1,135 @@ +package adql.parser.grammar; + +/* + * This file is part of ADQLLibrary. + * + * ADQLLibrary is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ADQLLibrary is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright 2019 - UDS/Centre de Données astronomiques de Strasbourg (CDS) + */ + +import java.io.InputStream; +import java.util.Stack; + +import adql.parser.ADQLQueryFactory; +import adql.query.ADQLQuery; +import adql.query.TextPosition; + +/** + * Common partial implementation of an {@link ADQLGrammar}. + * + * @author Grégory Mantelet (CDS) + * @version 2.0 (08/2019) + * @since 2.0 + */ +public abstract class ADQLGrammarBase implements ADQLGrammar { + + /** Tool to build the object representation of the ADQL query. */ + protected ADQLQueryFactory queryFactory = new ADQLQueryFactory(); + + /** The object representation of the ADQL query to parse. + * (ONLY USED DURING THE PARSING, otherwise it is always NULL). */ + protected ADQLQuery query = null; + + /** The stack of queries (in order to deal with sub-queries). */ + protected Stack<ADQLQuery> stackQuery = new Stack<ADQLQuery>(); + + /* ********************************************************************** + * GETTERS/SETTERS * + ********************************************************************** */ + + @Override + public final ADQLQuery getQuery() { + return query; + } + + @Override + public final ADQLQueryFactory getQueryFactory() { + return queryFactory; + } + + @Override + public final void setQueryFactory(final ADQLQueryFactory factory) throws NullPointerException { + if (factory == null) + throw new NullPointerException("Missing new ADQLQueryFactory! An ADQLGrammar can not work without a query factory."); + this.queryFactory = factory; + } + + /* ********************************************************************** + * PARSER INITIALIZATION * + ********************************************************************** */ + + @Override + public final void reset(final InputStream inputADQLExpression) throws Exception { + // Error if no input: + if (inputADQLExpression == null) + throw new NullPointerException("Missing ADQL expression to parse!"); + + // Empty the stack: + stackQuery.clear(); + + // Create a new and empty ADQL query tree: + query = queryFactory.createQuery(getVersion()); + + // Finally re-initialize the parser with the expression to parse: + ReInit(inputADQLExpression); + } + + /** + * Re-initialize the input of the ADQL grammar parser. + * + * @param stream The new input stream to parse. + */ + public abstract void ReInit(InputStream stream); + + /* ********************************************************************** + * REGULAR IDENTIFIER TEST * + ********************************************************************** */ + + @Override + public final boolean isRegularIdentifier(final String idCandidate) { + return idCandidate != null && idCandidate.matches("[a-zA-Z]+[a-zA-Z0-9_]*"); + } + + @Override + public final void testRegularIdentifier(final Token token) throws ParseException { + if (token == null) + throw new ParseException("Impossible to test whether NULL is a valid ADQL regular identifier!"); + else if (!isRegularIdentifier(token.image)) + throw new ParseException("Invalid ADQL regular identifier: \u005c"" + token.image + "\u005c"! If it aims to be a column/table name/alias, you should write it between double quotes.", new TextPosition(token)); + } + + /* ********************************************************************** + * TOKEN KIND TESTS * + ********************************************************************** */ + + @Override + public boolean isEnd(final Token token) { + return token == null || token.kind == ADQLGrammar200Constants.EOF || token.kind == ADQLGrammar200Constants.EOQ; + } + + /* ********************************************************************** + * DEBUG & ERRORS MANAGEMENT * + ********************************************************************** */ + + @Override + public final ParseException generateParseException(Exception ex) { + if (!(ex instanceof ParseException)) { + ParseException pex = new ParseException("[" + ex.getClass().getName() + "] " + ex.getMessage()); + pex.setStackTrace(ex.getStackTrace()); + return pex; + } else + return (ParseException)ex; + } +} diff --git a/src/adql/parser/ParseException.java b/src/adql/parser/grammar/ParseException.java similarity index 98% rename from src/adql/parser/ParseException.java rename to src/adql/parser/grammar/ParseException.java index 96370d8a6224fb0890e26af86e57d4f8e4f09230..87a63884d336f38f323c4bfee6517140052f55a3 100644 --- a/src/adql/parser/ParseException.java +++ b/src/adql/parser/grammar/ParseException.java @@ -25,12 +25,16 @@ * - change the way ADQL and SQL reserved keywords are identified for the * generation of the appropriate HINT in the error message * + * Modified by Grégory Mantelet (CDS), on Aug. 2019 + * Modifications: + * - change the package name + * * /!\ DO NOT RE-GENERATE THIS FILE /!\ * In case of re-generation, replace it by ParseException.java.backup (but maybe * after a diff in case of significant modifications have been done by a new * version of JavaCC). */ -package adql.parser; +package adql.parser.grammar; import adql.query.TextPosition; diff --git a/src/adql/parser/ParseException.java.backup b/src/adql/parser/grammar/ParseException.java.backup similarity index 98% rename from src/adql/parser/ParseException.java.backup rename to src/adql/parser/grammar/ParseException.java.backup index 96370d8a6224fb0890e26af86e57d4f8e4f09230..87a63884d336f38f323c4bfee6517140052f55a3 100644 --- a/src/adql/parser/ParseException.java.backup +++ b/src/adql/parser/grammar/ParseException.java.backup @@ -25,12 +25,16 @@ * - change the way ADQL and SQL reserved keywords are identified for the * generation of the appropriate HINT in the error message * + * Modified by Grégory Mantelet (CDS), on Aug. 2019 + * Modifications: + * - change the package name + * * /!\ DO NOT RE-GENERATE THIS FILE /!\ * In case of re-generation, replace it by ParseException.java.backup (but maybe * after a diff in case of significant modifications have been done by a new * version of JavaCC). */ -package adql.parser; +package adql.parser.grammar; import adql.query.TextPosition; diff --git a/src/adql/parser/SimpleCharStream.java b/src/adql/parser/grammar/SimpleCharStream.java similarity index 99% rename from src/adql/parser/SimpleCharStream.java rename to src/adql/parser/grammar/SimpleCharStream.java index 617d73edc85d9ffcdb9795666a3e944db25ca813..341e9b4a85e345cd392bdc59f48182faaf838a0f 100644 --- a/src/adql/parser/SimpleCharStream.java +++ b/src/adql/parser/grammar/SimpleCharStream.java @@ -1,6 +1,6 @@ /* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 6.0 */ /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ -package adql.parser; +package adql.parser.grammar; /** * An implementation of interface CharStream, where the stream is assumed to diff --git a/src/adql/parser/SimpleCharStream.java.backup b/src/adql/parser/grammar/SimpleCharStream.java.backup similarity index 99% rename from src/adql/parser/SimpleCharStream.java.backup rename to src/adql/parser/grammar/SimpleCharStream.java.backup index 617d73edc85d9ffcdb9795666a3e944db25ca813..341e9b4a85e345cd392bdc59f48182faaf838a0f 100644 --- a/src/adql/parser/SimpleCharStream.java.backup +++ b/src/adql/parser/grammar/SimpleCharStream.java.backup @@ -1,6 +1,6 @@ /* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 6.0 */ /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ -package adql.parser; +package adql.parser.grammar; /** * An implementation of interface CharStream, where the stream is assumed to diff --git a/src/adql/parser/Token.java b/src/adql/parser/grammar/Token.java similarity index 95% rename from src/adql/parser/Token.java rename to src/adql/parser/grammar/Token.java index afd727184904aba9fadc881227abaae31890b0fa..704d2fa1115f5f464d01a68a889187c0d3e87321 100644 --- a/src/adql/parser/Token.java +++ b/src/adql/parser/grammar/Token.java @@ -1,19 +1,20 @@ /* Generated By:JavaCC: Do not edit this line. Token.java Version 6.0 */ /* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true * - * Modified by Grégory Mantelet (CDS), on April 2019 + * Modified by Grégory Mantelet (CDS), on Aug. 2019 * Modifications: - * - addition of the attributes: `adqlReserved`, `sqlReserved`, + * - addition of the attributes: `adqlReserved`, `sqlReserved`, * `adqlVersion` and `isFunctionName` + * - change the package name * * /!\ DO NOT RE-GENERATE THIS FILE /!\ * In case of re-generation, replace it by Token.java.backup (but maybe * after a diff in case of significant modifications have been done by a new * version of JavaCC). */ -package adql.parser; +package adql.parser.grammar; -import adql.parser.ADQLParserFactory.ADQLVersion; +import adql.parser.ADQLParser.ADQLVersion; /** * Describes the input token stream. diff --git a/src/adql/parser/Token.java.backup b/src/adql/parser/grammar/Token.java.backup similarity index 97% rename from src/adql/parser/Token.java.backup rename to src/adql/parser/grammar/Token.java.backup index afd727184904aba9fadc881227abaae31890b0fa..a48d5321a8a024dc7c3dd7983409618258b5183c 100644 --- a/src/adql/parser/Token.java.backup +++ b/src/adql/parser/grammar/Token.java.backup @@ -1,19 +1,20 @@ /* Generated By:JavaCC: Do not edit this line. Token.java Version 6.0 */ /* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true * - * Modified by Grégory Mantelet (CDS), on April 2019 + * Modified by Grégory Mantelet (CDS), on Aug. 2019 * Modifications: * - addition of the attributes: `adqlReserved`, `sqlReserved`, * `adqlVersion` and `isFunctionName` + * - change the package name * * /!\ DO NOT RE-GENERATE THIS FILE /!\ * In case of re-generation, replace it by Token.java.backup (but maybe * after a diff in case of significant modifications have been done by a new * version of JavaCC). */ -package adql.parser; +package adql.parser.grammar; -import adql.parser.ADQLParserFactory.ADQLVersion; +import adql.parser.ADQLParser.ADQLVersion; /** * Describes the input token stream. diff --git a/src/adql/parser/TokenMgrError.java b/src/adql/parser/grammar/TokenMgrError.java similarity index 89% rename from src/adql/parser/TokenMgrError.java rename to src/adql/parser/grammar/TokenMgrError.java index fa5d8aaa60363bea7b3f223dac1488421a804663..626068eb2647166af1cce5a1b53ed23dee976af5 100644 --- a/src/adql/parser/TokenMgrError.java +++ b/src/adql/parser/grammar/TokenMgrError.java @@ -7,13 +7,17 @@ * - adapt the error message so that being more explicit for humans * and display the incorrect character as a character instead of an * integer value - * + * + * Modified by Grégory Mantelet (CDS), on Aug. 2019 + * Modifications: + * - change the package name + * * /!\ DO NOT RE-GENERATE THIS FILE /!\ * In case of re-generation, replace it by TokenMgrError.java.backup (but maybe * after a diff in case of significant modifications have been done by a new * version of JavaCC). */ -package adql.parser; +package adql.parser.grammar; /** Token Manager Error. */ public class TokenMgrError extends Error { @@ -65,11 +69,11 @@ public class TokenMgrError extends Error { * Replaces unprintable characters by their escaped (or unicode escaped) * equivalents in the given string */ - protected static final String addEscapes(String str){ + protected static final String addEscapes(String str) { StringBuffer retval = new StringBuffer(); char ch; - for(int i = 0; i < str.length(); i++){ - switch(str.charAt(i)){ + for(int i = 0; i < str.length(); i++) { + switch(str.charAt(i)) { case 0: continue; case '\b': @@ -97,10 +101,10 @@ public class TokenMgrError extends Error { retval.append("\\\\"); continue; default: - if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e){ + if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); retval.append("\\u" + s.substring(s.length() - 4, s.length())); - }else{ + } else { retval.append(ch); } continue; @@ -121,7 +125,7 @@ public class TokenMgrError extends Error { * curchar : the offending character * Note: You can customize the lexical error message by modifying this method. */ - protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar){ + protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) { return ("Incorrect character encountered at l." + errorLine + ", c." + errorColumn + ": " + (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " ('" + curChar + "'), ") + "after : \"" + addEscapes(errorAfter) + "\""); } @@ -135,25 +139,25 @@ public class TokenMgrError extends Error { * from this method for such cases in the release version of your parser. */ @Override - public String getMessage(){ + public String getMessage() { return super.getMessage(); } /** * Gets the line at which this error occurs. - * + * * @return Error line or <code>-1</code> if unknown. */ - public final int getErrorLine(){ + public final int getErrorLine() { return errorLine; } /** * Gets the column at which this error occurs. - * + * * @return Error column or <code>-1</code> if unknown. */ - public final int getErrorColumn(){ + public final int getErrorColumn() { return errorColumn; } @@ -162,16 +166,17 @@ public class TokenMgrError extends Error { */ /** No arg constructor. */ - public TokenMgrError(){} + public TokenMgrError() { + } /** Constructor with message and reason. */ - public TokenMgrError(String message, int reason){ + public TokenMgrError(String message, int reason) { super(message); errorCode = reason; } /** Full Constructor. */ - public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason){ + public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) { this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); this.errorLine = errorLine; this.errorColumn = errorColumn; diff --git a/src/adql/parser/TokenMgrError.java.backup b/src/adql/parser/grammar/TokenMgrError.java.backup similarity index 96% rename from src/adql/parser/TokenMgrError.java.backup rename to src/adql/parser/grammar/TokenMgrError.java.backup index fa5d8aaa60363bea7b3f223dac1488421a804663..7934ce2ed23e7b8b734d8468516ef17a4b0e378c 100644 --- a/src/adql/parser/TokenMgrError.java.backup +++ b/src/adql/parser/grammar/TokenMgrError.java.backup @@ -8,12 +8,16 @@ * and display the incorrect character as a character instead of an * integer value * + * Modified by Grégory Mantelet (CDS), on Aug. 2019 + * Modifications: + * - change the package name + * * /!\ DO NOT RE-GENERATE THIS FILE /!\ * In case of re-generation, replace it by TokenMgrError.java.backup (but maybe * after a diff in case of significant modifications have been done by a new * version of JavaCC). */ -package adql.parser; +package adql.parser.grammar; /** Token Manager Error. */ public class TokenMgrError extends Error { @@ -162,7 +166,8 @@ public class TokenMgrError extends Error { */ /** No arg constructor. */ - public TokenMgrError(){} + public TokenMgrError() { + } /** Constructor with message and reason. */ public TokenMgrError(String message, int reason){ diff --git a/src/adql/parser/adqlGrammar200.jj b/src/adql/parser/grammar/adqlGrammar200.jj similarity index 60% rename from src/adql/parser/adqlGrammar200.jj rename to src/adql/parser/grammar/adqlGrammar200.jj index 360d0b8bda5ac9bc69c88cc0de63609c36d6b626..3a16e9b38d96d7a2cb3185743c0a08bc76e81025 100644 --- a/src/adql/parser/adqlGrammar200.jj +++ b/src/adql/parser/grammar/adqlGrammar200.jj @@ -25,9 +25,9 @@ * successfully tested with JavaCC 6.0. * * The generated parser checks the syntax of the given ADQL query and generates -* an object representation but no coherence with any database is done. -* If the syntax is not conform to the ADQL definition an error message is -* printed else it will be the message "Correct syntax". +* an object representation but no consistency with any database is checked. +* If the syntax is not conform to the ADQL definition a TokenMgrError or a +* ParseException is thrown. * * Author: Grégory Mantelet (CDS) * Version: 2.0 (10/2020) @@ -47,9 +47,9 @@ options { /* ########## */ /* # PARSER # */ /* ########## */ -PARSER_BEGIN(ADQLParser200) +PARSER_BEGIN(ADQLGrammar200) -package adql.parser; +package adql.parser.grammar; /* * This file is part of ADQLLibrary. @@ -67,29 +67,19 @@ package adql.parser; * You should have received a copy of the GNU Lesser General Public License * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * - * Copyright 2019 - UDS/Centre de Données astronomiques de Strasbourg (CDS) + * Copyright 2019-2020 - UDS/Centre de Données astronomiques de Strasbourg (CDS) */ -import java.util.Stack; import java.util.Vector; import java.util.ArrayList; -import java.util.Collection; - -import java.io.FileReader; -import java.io.IOException; - -import adql.db.exception.UnresolvedIdentifiersException; -import adql.db.exception.UnsupportedFeatureException; -import adql.parser.ADQLParserFactory.ADQLVersion; +import adql.parser.ADQLParser.ADQLVersion; +import adql.parser.IdentifierItems; import adql.parser.IdentifierItems.IdentifierItem; import adql.parser.ADQLQueryFactory.JoinType; -import adql.parser.feature.FeatureSet; -import adql.parser.feature.LanguageFeature; - import adql.query.*; import adql.query.from.*; import adql.query.constraint.*; @@ -101,895 +91,88 @@ import adql.query.operand.function.*; import adql.query.operand.function.geometry.*; import adql.query.operand.function.geometry.GeometryFunction.GeometryValue; -import adql.search.SearchOptionalFeaturesHandler; - -import adql.translator.PostgreSQLTranslator; -import adql.translator.TranslationException; - /** -* Parses an ADQL-2.0 query thanks to the {@link ADQLParser200#Query() Query()} function. + * Parser of ADQL expressions following the ADQL-2.0 grammar. * -* <p> -* This parser is able, thanks to a {@link QueryChecker} object, to check each -* {@link 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 {@link QueryChecker}. Thus -* you must extend {@link QueryChecker} to check semantically all generated -* ADQLQuery objects. -* </p> + * <p><i><b>Note:</b> + * It is strongly recommended to not use this class directly in order to parse + * an ADQL expression. Instead, you should use + * {@link adql.parser.ADQLParser ADQLParser}. It provides a more user-friendly + * interface and provides additional features. + * </i></p> * -* <p> -* To create an object representation of the given ADQL query, this parser uses -* a {@link 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 {@link ADQLQueryFactory} -* (ie. createContains(...)). -* </p> -* -* <p>Here are the key functions to use:</p> -* <ul> -* <li>{@link #parseQuery(java.lang.String)} (or any of its alternatives) -* to parse an input ADQL query String and get its corresponding ADQL tree -* </li> -* <li>{@link #tryQuickFix(java.lang.String)} to try fixing the most common -* issues with ADQL queries (e.g. Unicode confusable characters, -* unescaped ADQL identifiers, SQL reserved keywords, ...)</li> -* </ul> -* -* <p><b><u>WARNING:</u> -* To modify this class it's strongly encouraged to modify the .jj file in the -* section between <i>PARSER_BEGIN</i> and <i>PARSER_END</i> and to re-compile -* it with JavaCC. -* </b></p> -* -* @see QueryChecker -* @see ADQLQueryFactory + * @see ADQLParser * * @author Grégory Mantelet (CDS) * @version 2.0 (10/2020) * @since 2.0 */ -public class ADQLParser200 implements ADQLParser { - - /** Tools to build the object representation of the ADQL query. */ - private ADQLQueryFactory queryFactory = new ADQLQueryFactory(); +public class ADQLGrammar200 extends ADQLGrammarBase { - /** Default set of supported language features. - * <p><i><b>Note:</b> - * By default, all optional features are supported. - * </i></p> */ - private FeatureSet supportedFeatures = new FeatureSet(false, true); + /* ********************************************************************** + * GETTERS/SETTERS * + ********************************************************************** */ - /** The stack of queries (because there may be some sub-queries). */ - private Stack<ADQLQuery> stackQuery = new Stack<ADQLQuery>(); - - /** The object representation of the ADQL query to parse. - * (ONLY USED DURING THE PARSING, else it is always <i>null</i>). */ - private ADQLQuery query = null; - - /** Checks each {@link ADQLQuery} (sub-query or not) just after their - * generation. */ - private QueryChecker queryChecker = null; - - /** The first token of a table/column name. This token is extracted by - * {@link #Identifier()}. */ - private Token currentIdentifierToken = null; - - /** - * Builds an ADQL parser without a query to parse. - */ - public ADQLParser200(){ - this(new java.io.ByteArrayInputStream("".getBytes())); - supportedFeatures.supportAll(LanguageFeature.TYPE_ADQL_GEO); - setDebug(false); - } - - /** - * Builds an ADQL parser without a query to parse but with a - * {@link QueryChecker} and a {@link ADQLQueryFactory}. - * - * @param checker The object to use to check each {@link ADQLQuery}. - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser200(QueryChecker checker, ADQLQueryFactory factory) { - this(); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds an ADQL parser without a query to parse but with a - * {@link QueryChecker}. - * - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser200(QueryChecker checker) { - this(checker, null); - } - - /** - * Builds an ADQL parser without a query to parse but with a - * {@link ADQLQueryFactory}. - * - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser200(ADQLQueryFactory factory) { - this((QueryChecker)null, factory); - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param checker The object to use to check each {@link ADQLQuery}. - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser200(java.io.InputStream stream, QueryChecker checker, ADQLQueryFactory factory) { - this(stream); - - supportedFeatures.supportAll(LanguageFeature.TYPE_ADQL_GEO); - - setDebug(false); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser200(java.io.InputStream stream, QueryChecker checker) { - this(stream, checker, null); - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser200(java.io.InputStream stream, ADQLQueryFactory factory) { - this(stream, (QueryChecker)null, factory); - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param encoding The supplied encoding. - * @param checker The object to use to check each {@link ADQLQuery}. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser200(java.io.InputStream stream, String encoding, QueryChecker checker, ADQLQueryFactory factory) { - this(stream, encoding); - - supportedFeatures.supportAll(LanguageFeature.TYPE_ADQL_GEO); - - setDebug(false); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param encoding The supplied encoding. - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser200(java.io.InputStream stream, String encoding, QueryChecker checker) { - this(stream, encoding, checker, null); - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param encoding The supplied encoding. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser200(java.io.InputStream stream, String encoding, ADQLQueryFactory factory) { - this(stream, encoding, null, factory); - } - - /** - * Builds a parser with a reader containing the query to parse. - * - * @param reader The reader in which the ADQL query to parse is given. - * @param checker The object to use to check each {@link ADQLQuery}. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser200(java.io.Reader reader, QueryChecker checker, ADQLQueryFactory factory) { - this(reader); - - supportedFeatures.supportAll(LanguageFeature.TYPE_ADQL_GEO); - - setDebug(false); - - queryChecker = checker; + /** Implemented version of the ADQL Standard. */ + public final static ADQLVersion VERSION = ADQLVersion.V2_0; - if (factory != null) - queryFactory = factory; + public final ADQLVersion getVersion() { + return VERSION; } - - /** - * Builds a parser with a reader containing the query to parse. - * - * @param reader The reader in which the ADQL query to parse is given. - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser200(java.io.Reader reader, QueryChecker checker) { - this(reader, checker, null); - } - - /** - * Builds a parser with a reader containing the query to parse. - * - * @param reader The reader in which the ADQL query to parse is given. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser200(java.io.Reader reader, ADQLQueryFactory factory) { - this(reader, null, factory); - } - - /** - * Builds a parser with another token manager. - * - * @param tm The manager which associates a token to a numeric code. - * @param checker The object to use to check each {@link ADQLQuery }. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser200(ADQLParser200TokenManager tm, QueryChecker checker, ADQLQueryFactory factory) { - this(tm); - - supportedFeatures.supportAll(LanguageFeature.TYPE_ADQL_GEO); - - setDebug(false); - - queryChecker = checker; - if (factory != null) - queryFactory = factory; - } - - /** - * Builds a parser with another token manager. - * - * @param tm The manager which associates a token to a numeric code. - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser200(ADQLParser200TokenManager tm, QueryChecker checker) { - this(tm, checker, null); - } - - /** - * Builds a parser with another token manager. - * - * @param tm The manager which associates a token to a numeric code. - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser200(ADQLParser200TokenManager tm, ADQLQueryFactory factory) { - this(tm, null, factory); - } + /* ********************************************************************** + * TOKEN KIND TESTS * + ********************************************************************** */ - /* ADDITIONAL GETTERS & SETTERS */ - - public final ADQLVersion getADQLVersion() { - return ADQLVersion.V2_0; - } - - public final void setDebug(boolean debug){ - if (debug) enable_tracing(); - else disable_tracing(); - } - - public final QueryChecker getQueryChecker(){ - return queryChecker; - } - - public final void setQueryChecker(QueryChecker checker){ - queryChecker = checker; - } - - public final ADQLQueryFactory getQueryFactory(){ - return queryFactory; - } - - public final void setQueryFactory(ADQLQueryFactory factory){ - queryFactory = (factory!=null)?factory:(new ADQLQueryFactory()); + public final boolean isEOF(final Token token) { + return token != null && token.kind == ADQLGrammar200Constants.EOF; } - public final FeatureSet getSupportedFeatures() { - return supportedFeatures; + public final boolean isEOQ(final Token token) { + return token != null && token.kind == ADQLGrammar200Constants.EOQ; } - public void setSupportedFeatures(final FeatureSet features) { - if (features != null) - supportedFeatures = features; + public final boolean isRegularIdentifierCandidate(final Token token) { + return token != null && token.kind == ADQLGrammar200Constants.REGULAR_IDENTIFIER_CANDIDATE; } - /* EXCEPTION HELPER FUNCTION */ - - private final ParseException generateParseException(Exception ex){ - if (!(ex instanceof ParseException)){ - ParseException pex = new ParseException("["+ex.getClass().getName()+"] "+ex.getMessage()); - pex.setStackTrace(ex.getStackTrace()); - return pex; - }else - return (ParseException)ex; + public final boolean isSQLReservedWord(final Token token) { + return token != null && token.kind == ADQLGrammar200Constants.SQL_RESERVED_WORD; } - /* QUERY PARSING FUNCTIONS */ - - /** - * Tell whether the given string is a valid ADQL regular identifier. - * - * <p> - * According to the ADQL-2.0's BNF, a regular identifier (i.e. not delimited - * ; not between double quotes) must be a letter followed by a letter, digit - * or underscore. So, the following regular expression: - * </p> - * <pre>[a-zA-Z]+[a-zA-Z0-9_]*</pre> - * - * <p>This is what this function tests on the given string.</p> - * - * @param idCandidate The string to test. - * - * @return <code>true</code> if the given string is a valid regular - * identifier, - * <code>false</code> otherwise. - * - * @see #testRegularIdentifier(adql.parser.Token) - * - * @since 1.5 - */ - public final boolean isRegularIdentifier(final String idCandidate) { - return idCandidate.matches("[a-zA-Z]+[a-zA-Z0-9_]*"); + public final boolean isLeftPar(final Token token) { + return token != null && token.kind == ADQLGrammar200Constants.LEFT_PAR; } - /** - * Test the given token as an ADQL's regular identifier. - * - * <p> - * This function uses {@link #isRegularIdentifier(java.lang.String)} to - * test the given token's image. If the test fails, a - * {@link adql.parser.ParseException} is thrown. - * </p> - * - * @param token The token to test. - * - * @throws ParseException If the given token is not a valid ADQL regular - * identifier. - * - * @see #isRegularIdentifier(java.lang.String) - * - * @since 1.5 - */ - public final void testRegularIdentifier(final Token token) throws ParseException { - if (!isRegularIdentifier(token.image)) - throw new ParseException("Invalid ADQL regular identifier: \""+token.image+"\"! If it aims to be a column/table name/alias, you should write it between double quotes.", new TextPosition(token)); - } - - /** - * Parses the query given at the creation of this parser or in the - * <i>ReInit</i> functions. - * - * @return The object representation of the given ADQL query. - * - * @throws ParseException If there is at least one syntactic error. - * - * @see ADQLParser200#Query() - */ - public final ADQLQuery parseQuery() throws ParseException { - stackQuery.clear(); - query = null; - try { - return Query(); - }catch(TokenMgrError tme) { - throw new ParseException(tme); - } - } - - /** - * Parses the query given in parameter. - * - * @param q The ADQL query to parse. - * - * @return The object representation of the given ADQL query. - * - * @throws ParseException If there is at least one syntactic error. - * - * @see ADQLParser200#ReInit(java.io.InputStream) - * @see ADQLParser200#setDebug(boolean) - * @see ADQLParser200#Query() - */ - public final ADQLQuery parseQuery(String q) throws ParseException { - stackQuery.clear(); - query = null; - ReInit(new java.io.ByteArrayInputStream(q.getBytes())); - try { - return Query(); - }catch(TokenMgrError tme) { - throw new ParseException(tme); - } - } - - /** - * Parses the query contained in the stream given in parameter. - * - * @param stream The stream which contains the ADQL query to parse. - * - * @return The object representation of the given ADQL query. - * - * @throws ParseException If there is at least one syntactic error. - * - * @see ADQLParser200#ReInit(java.io.InputStream) - * @see ADQLParser200#setDebug(boolean) - * @see ADQLParser200#Query() - */ - public final ADQLQuery parseQuery(java.io.InputStream stream) throws ParseException { - stackQuery.clear(); - query = null; - ReInit(stream); - try { - return Query(); - }catch(TokenMgrError tme) { - throw new ParseException(tme); - } - } + /* ********************************************************************** + * TOKENIZATION HELPER * + ********************************************************************** */ - @Override - public final ClauseSelect parseSelect(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_0); + public final Tokenizer getTokenizer(final String expr) throws NullPointerException { + // Error if no expression to tokenize: + if (expr == null) + throw new NullPointerException("Missing ADQL expression to tokenize!"); - // Parse the string as a SELECT clause: - Select(); - - // Return what's just got parsed: - return query.getSelect(); - - }catch(TokenMgrError tme) { - throw new ParseException(tme); - }catch(Exception ex){ - throw generateParseException(ex); - } - } - - @Override - public final FromContent parseFrom(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_0); - - // Parse the string as a FROM clause: - From(); - - // Return what's just got parsed: - return query.getFrom(); - - }catch(TokenMgrError tme) { - throw new ParseException(tme); - }catch(Exception ex){ - throw generateParseException(ex); - } - } - - @Override - public final ClauseConstraints parseWhere(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_0); - - // Parse the string as a WHERE clause: - Where(); - - // Return what's just got parsed: - return query.getWhere(); - - }catch(TokenMgrError tme) { - throw new ParseException(tme); - }catch(Exception ex){ - throw generateParseException(ex); - } - } - - @Override - public final ClauseADQL<ADQLOrder> parseOrderBy(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_0); - - // Parse the string as a ORDER BY clause: - OrderBy(); - - // Return what's just got parsed: - return query.getOrderBy(); - - }catch(TokenMgrError tme) { - throw new ParseException(tme); - }catch(Exception ex){ - throw generateParseException(ex); - } - } - - @Override - public final ClauseADQL<ADQLColumn> parseGroupBy(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_0); - - // Parse the string as a GROUP BY clause: - GroupBy(); - - // Return what's just got parsed: - return query.getGroupBy(); - - }catch(TokenMgrError tme) { - throw new ParseException(tme); - }catch(Exception ex){ - throw generateParseException(ex); - } - } - - /* TOKENIZATION FUNCTION */ - - public Token[] tokenize(final String expr) throws ParseException { - ADQLParser200TokenManager parser = new ADQLParser200TokenManager(new SimpleCharStream(new java.io.ByteArrayInputStream(expr.getBytes()))); - try{ - ArrayList<Token> tokens = new ArrayList<Token>(); - Token token; - while(!isEnd((token=parser.getNextToken()))){ - tokens.add(token); - } - return tokens.toArray(new Token[tokens.size()]); - }catch(TokenMgrError err){ - // wrap such errors and propagate them: - throw new ParseException(err); - } - } - - /* CORRECTION SUGGESTION */ - - /** - * Try fixing tokens/terms of the input ADQL query. - * - * <p> - * <b>This function does not try to fix syntactical or semantical errors.</b> - * It just try to fix the most common issues in ADQL queries, such as: - * </p> - * <ul> - * <li>some Unicode characters confusable with ASCII characters (like a - * space, a dash, ...) ; this function replace them by their ASCII - * alternative,</li> - * <li>any of the following are double quoted: - * <ul> - * <li>non regular ADQL identifiers - * (e.g. <code>_RAJ2000</code>),</li> - * <li>ADQL function names used as identifiers - * (e.g. <code>distance</code>)</li> - * <li>and SQL reserved keywords - * (e.g. <code>public</code>).</li> - * </ul> - * </li> - * </ul> - * - * <p><i><b>Note 1:</b> - * The given stream is NOT closed by this function even if the EOF is - * reached. It is the responsibility of the caller to close it. - * </i></p> - * - * <p><i><b>Note 2:</b> - * This function does not use any instance variable of this parser - * (especially the InputStream or Reader provided at initialisation or - * ReInit). - * </i></p> - * - * @param input Stream containing the input ADQL query to fix. - * - * @return The suggested correction of the input ADQL query. - * - * @throws java.io.IOException If there is any error while reading from the - * given input stream. - * @throws ParseException If any unrecognised character is encountered, - * or if anything else prevented the tokenization - * of some characters/words/terms. - * - * @see #tryQuickFix(java.lang.String) - * - * @since 1.5 - */ - public final String tryQuickFix(final java.io.InputStream input) throws java.io.IOException, ParseException { - // Fetch everything into a single string: - StringBuffer buf = new StringBuffer(); - byte[] cBuf = new byte[1024]; - int nbChar; - while((nbChar = input.read(cBuf)) > -1){ - buf.append(new String(cBuf, 0, nbChar)); - } - - // Convert the buffer into a String and now try to fix it: - return tryQuickFix(buf.toString()); - } - - /** - * Try fixing tokens/terms of the given ADQL query. - * - * <p> - * <b>This function does not try to fix syntactical or semantical errors.</b> - * It just try to fix the most common issues in ADQL queries, such as: - * </p> - * <ul> - * <li>some Unicode characters confusable with ASCII characters (like a - * space, a dash, ...) ; this function replace them by their ASCII - * alternative,</li> - * <li>any of the following are double quoted: - * <ul> - * <li>non regular ADQL identifiers - * (e.g. <code>_RAJ2000</code>),</li> - * <li>ADQL function names used as identifiers - * (e.g. <code>distance</code>)</li> - * <li>and SQL reserved keywords - * (e.g. <code>public</code>).</li> - * </ul> - * </li> - * </ul> - * - * <p><i><b>Note:</b> - * This function does not use any instance variable of this parser - * (especially the InputStream or Reader provided at initialisation or - * ReInit). - * </i></p> - * - * @param adqlQuery The input ADQL query to fix. - * - * @return The suggested correction of the given ADQL query. - * - * @throws ParseException If any unrecognised character is encountered, - * or if anything else prevented the tokenization - * of some characters/words/terms. - * - * @since 1.5 - */ - public String tryQuickFix(String adqlQuery) throws ParseException { - StringBuffer suggestedQuery = new StringBuffer(); - - // 1. Replace all Unicode confusable characters: - adqlQuery = replaceUnicodeConfusables(adqlQuery); - - /* 1.bis. Normalise new lines and tabulations - * (to simplify the column counting): */ - adqlQuery = adqlQuery.replaceAll("(\r\n|\r|\n)", System.getProperty("line.separator")).replaceAll("\t", " "); - - // 2. Analyse the query token by token: - ADQLParser200TokenManager parser = new ADQLParser200TokenManager(new SimpleCharStream(new java.io.ByteArrayInputStream(adqlQuery.getBytes()))); - - final String[] lines = adqlQuery.split(System.getProperty("line.separator")); - - try{ - String suggestedToken; - int lastLine = 1, lastCol = 1; - - Token token = null, nextToken = parser.getNextToken(); - // for all tokens until the EOF or EOQ: - do{ - // get the next token: - token = nextToken; - nextToken = (isEnd(token) ? null : parser.getNextToken()); - - // 3. Double quote any suspect token: - if (mustEscape(token, nextToken)){ - suggestedToken = "\"" + token.image + "\""; - }else - suggestedToken = token.image; - - /* 4. Append all space characters (and comments) before the - * token: */ - /* same line, just get the space characters between the last - * token and the one to append: */ - if (lastLine == token.beginLine){ - if (token.kind == ADQLParser200Constants.EOF) - suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1)); - else - suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1, token.beginColumn - (isEnd(token) ? 0 : 1))); - lastCol = token.endColumn + 1; + // Return a Tokenizer: instance + return new Tokenizer() { + private final ADQLGrammar200TokenManager tokenManager = new ADQLGrammar200TokenManager(new SimpleCharStream(new java.io.ByteArrayInputStream(expr.getBytes()))); + private boolean eof = false; + @Override + public Token nextToken() { + if (eof) + return null; + else { + Token tok = tokenManager.getNextToken(); + eof = (tok.kind == ADQLGrammar200Constants.EOF); + return tok; } - // not the same line... - else{ - /* append all remaining space characters until the position - * of the token to append: */ - do{ - suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1)).append('\n'); - lastLine++; - lastCol = 1; - }while(lastLine < token.beginLine); - /* if there are still space characters before the token, - * append them as well: */ - if (lastCol < token.beginColumn) - suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1, token.beginColumn - 1)); - // finally, set the correct column position: - lastCol = token.endColumn + 1; - } - - // 5. Append the suggested token: - suggestedQuery.append(suggestedToken); - - }while(!isEnd(token)); - - }catch(TokenMgrError err){ - // wrap such errors and propagate them: - throw new ParseException(err); - } - - return suggestedQuery.toString(); - } - - /** - * All of the most common Unicode confusable characters and their - * ASCII/UTF-8 alternative. - * - * <p> - * Keys of this map represent the ASCII character while the values are the - * regular expression for all possible Unicode alternatives. - * </p> - * - * <p><i><b>Note:</b> - * All of them have been listed using - * <a href="https://unicode.org/cldr/utility/confusables.jsp">Unicode Utilities: Confusables</a>. - * </i></p> - * - * @since 1.5 - */ - protected final static java.util.Map<String, String> REGEX_UNICODE_CONFUSABLES = new java.util.HashMap<String, String>(10); - /** Regular expression matching all Unicode alternatives for <code>-</code>. - * @since 1.5 */ - protected final static String REGEX_DASH = "[\u002D\u02D7\u06D4\u2010\u2011\u2012\u2013\u2043\u2212\u2796\u2CBA\uFE58\u2014\u2015\u207B\u208B\u0096\u058A\uFE63\uFF0D]"; - /** Regular expression matching all Unicode alternatives for <code>_</code>. - * @since 1.5 */ - protected final static String REGEX_UNDERSCORE = "[\u005F\u07FA\uFE4D\uFE4E\uFE4F]"; - /** Regular expression matching all Unicode alternatives for <code>'</code>. - * @since 1.5 */ - protected final static String REGEX_QUOTE = "[\u0027\u0060\u00B4\u02B9\u02BB\u02BC\u02BD\u02BE\u02C8\u02CA\u02CB\u02F4\u0374\u0384\u055A\u055D\u05D9\u05F3\u07F4\u07F5\u144A\u16CC\u1FBD\u1FBF\u1FEF\u1FFD\u1FFE\u2018\u2019\u201B\u2032\u2035\uA78C\uFF07\uFF40]"; - /** Regular expression matching all Unicode alternatives for <code>"</code>. - * @since 1.5 */ - protected final static String REGEX_DOUBLE_QUOTE = "[\u02BA\u02DD\u02EE\u02F6\u05F2\u05F4\u1CD3\u201C\u201D\u201F\u2033\u2036\u3003\uFF02]"; - /** Regular expression matching all Unicode alternatives for <code>.</code>. - * @since 1.5 */ - protected final static String REGEX_STOP = "[\u002E\u0660\u06F0\u0701\u0702\u2024\uA4F8\uA60E]"; - /** Regular expression matching all Unicode alternatives for <code>+</code>. - * @since 1.5 */ - protected final static String REGEX_PLUS = "[\u002B\u16ED\u2795]"; - /** Regular expression matching all Unicode alternatives for <code> </code>. - * @since 1.5 */ - protected final static String REGEX_SPACE = "[\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F]"; - /** Regular expression matching all Unicode alternatives for <code><</code>. - * @since 1.5 */ - protected final static String REGEX_LESS_THAN = "[\u003C\u02C2\u1438\u16B2\u2039\u276E]"; - /** Regular expression matching all Unicode alternatives for <code>></code>. - * @since 1.5 */ - protected final static String REGEX_GREATER_THAN = "[\u003E\u02C3\u1433\u203A\u276F]"; - /** Regular expression matching all Unicode alternatives for <code>=</code>. - * @since 1.5 */ - protected final static String REGEX_EQUAL = "[\u003D\u1400\u2E40\u30A0\uA4FF]"; - static { - REGEX_UNICODE_CONFUSABLES.put("-", REGEX_DASH); - REGEX_UNICODE_CONFUSABLES.put("_", REGEX_UNDERSCORE); - REGEX_UNICODE_CONFUSABLES.put("'", REGEX_QUOTE); - REGEX_UNICODE_CONFUSABLES.put("\"", REGEX_DOUBLE_QUOTE); - REGEX_UNICODE_CONFUSABLES.put(".", REGEX_STOP); - REGEX_UNICODE_CONFUSABLES.put("+", REGEX_PLUS); - REGEX_UNICODE_CONFUSABLES.put(" ", REGEX_SPACE); - REGEX_UNICODE_CONFUSABLES.put("<", REGEX_LESS_THAN); - REGEX_UNICODE_CONFUSABLES.put(">", REGEX_GREATER_THAN); - REGEX_UNICODE_CONFUSABLES.put("=", REGEX_EQUAL); - } - - /** - * Replace all Unicode characters that can be confused with other ASCI/UTF-8 - * characters (e.g. different spaces, dashes, ...) in their ASCII version. - * - * @param adqlQuery The ADQL query string in which Unicode confusable - * characters must be replaced. - * - * @return The same query without the most common Unicode confusable - * characters. - * - * @since 1.5 - */ - protected String replaceUnicodeConfusables(final String adqlQuery){ - String newAdqlQuery = adqlQuery; - for(java.util.Map.Entry<String, String> confusable : REGEX_UNICODE_CONFUSABLES.entrySet()) - newAdqlQuery = newAdqlQuery.replaceAll(confusable.getValue(), confusable.getKey()); - return newAdqlQuery; - } - - /** - * Tell whether the given token represents the end of an ADQL query. - * - * @param token Token to analyze. - * - * @return <code>true</code> if the given token represents a query end, - * <code>false</code> otherwise. - * - * @since 1.5 - */ - protected boolean isEnd(final Token token){ - return token.kind == ADQLParser200Constants.EOF || token.kind == ADQLParser200Constants.EOQ; - } - - /** - * Tell whether the given token must be double quoted. - * - * <p> - * This function considers all the following as terms to double quote: - * </p> - * <ul> - * <li>SQL reserved keywords</li>, - * <li>unrecognised regular identifiers (e.g. neither a delimited nor a - * valid ADQL regular identifier)</li> - * <li>and ADQL function name without a parameters list.</li> - * </ul> - * - * @param token The token to analyze. - * @param nextToken The following token. (useful to detect the start of a - * function's parameters list) - * - * @return <code>true</code> if the given token must be double quoted, - * <code>false</code> to keep it as provided. - * - * @since 1.5 - */ - protected boolean mustEscape(final Token token, final Token nextToken){ - switch(token.kind){ - case ADQLParser200Constants.SQL_RESERVED_WORD: - return true; - case ADQLParser200Constants.REGULAR_IDENTIFIER_CANDIDATE: - return !isRegularIdentifier(token.image); - default: - return token.isFunctionName && (nextToken == null || nextToken.kind != ADQLParser200Constants.LEFT_PAR); - } + } + }; } + } -PARSER_END(ADQLParser200) +PARSER_END(ADQLGrammar200) /* ################################### */ /* # CUSTOMIZATION OF TOKEN CREATION # */ @@ -997,7 +180,7 @@ PARSER_END(ADQLParser200) TOKEN_MGR_DECLS: { protected void CommonTokenAction(final Token t) { - t.adqlVersion = ADQLParserFactory.ADQLVersion.V2_0; + t.adqlVersion = ADQLGrammar200.VERSION; } } @@ -1223,42 +406,17 @@ TOKEN : { /* ******************* */ /* GENERAL ADQL SYNTAX */ /* ******************* */ -/** -* Parses the ADQL query given at the parser creation or in the {@link ADQLParser200#ReInit(java.io.InputStream)} -* or in the <i>parseQuery</i> functions. -* -* @return The object representation of the query. -* @throws ParseException If the query syntax is incorrect. -*/ + ADQLQuery Query(): {ADQLQuery q = null;}{ q=QueryExpression() (<EOF> | <EOQ>) - { - /* check the optional features before any other check: - * (note: this check is very close to grammar check...hence its higher - * priority) */ - UnresolvedIdentifiersException exUnsupportedFeatures = new UnresolvedIdentifiersException("unsupported expression"); - SearchOptionalFeaturesHandler sFeaturesHandler = new SearchOptionalFeaturesHandler(true, false); - sFeaturesHandler.search(q); - for(ADQLObject obj : sFeaturesHandler) { - if (!supportedFeatures.isSupporting(obj.getFeatureDescription())) - exUnsupportedFeatures.addException(new UnsupportedFeatureException(obj)); - } - if (exUnsupportedFeatures.getNbErrors() > 0) - throw exUnsupportedFeatures; - - // check the query: - if (queryChecker != null) - queryChecker.check(q); - - return q; - } + { return q; } } ADQLQuery QueryExpression(): {TextPosition endPos = null;} { { try{ // create the query: - query = queryFactory.createQuery(ADQLVersion.V2_0); + query = queryFactory.createQuery(VERSION); stackQuery.push(query); }catch(Exception ex){ throw generateParseException(ex); @@ -2193,8 +1351,6 @@ UserDefinedFunction UserDefinedFunction(): {Token fct, end; Vector<ADQLOperand> if (!isRegularIdentifier(fct.image)) throw new ParseException("Invalid (User Defined) Function name: \""+fct.image+"\"!", new TextPosition(fct)); - //System.out.println("INFO [ADQLParser200]: \""+fct.image+"\" (from line "+fct.beginLine+" and column "+fct.beginColumn+" to line "+token.endLine+" and column "+(token.endColumn+1)+") is considered as an user defined function !"); - try{ // Build the parameters list: ADQLOperand[] parameters = new ADQLOperand[params.size()]; diff --git a/src/adql/parser/adqlGrammar201.jj b/src/adql/parser/grammar/adqlGrammar201.jj similarity index 61% rename from src/adql/parser/adqlGrammar201.jj rename to src/adql/parser/grammar/adqlGrammar201.jj index 98a75d6dacd56248b2ae0771cdcc9eb3e4f9ecf3..5276df35bc098592cb8aac977829611e4e9e0936 100644 --- a/src/adql/parser/adqlGrammar201.jj +++ b/src/adql/parser/grammar/adqlGrammar201.jj @@ -26,12 +26,12 @@ * successfully tested with JavaCC 6.0. * * The generated parser checks the syntax of the given ADQL query and generates -* an object representation but no coherence with any database is done. -* If the syntax is not conform to the ADQL definition an error message is -* printed else it will be the message "Correct syntax". +* an object representation but no consistency with any database is checked. +* If the syntax is not conform to the ADQL definition a TokenMgrError or a +* ParseException is thrown. * -* Author: Grégory Mantelet (CDS) -* Version: 2.0 (07/2019) +* Author: Grégory Mantelet (CDS) +* Version: 2.0 (08/2019) */ /* ########### */ @@ -48,9 +48,9 @@ options { /* ########## */ /* # PARSER # */ /* ########## */ -PARSER_BEGIN(ADQLParser201) +PARSER_BEGIN(ADQLGrammar201) -package adql.parser; +package adql.parser.grammar; /* * This file is part of ADQLLibrary. @@ -71,26 +71,16 @@ package adql.parser; * Copyright 2019 - UDS/Centre de Données astronomiques de Strasbourg (CDS) */ -import java.util.Stack; import java.util.Vector; import java.util.ArrayList; -import java.util.Collection; -import java.io.FileReader; -import java.io.IOException; - -import adql.db.exception.UnsupportedFeatureException; -import adql.db.exception.UnresolvedIdentifiersException; - -import adql.parser.ADQLParserFactory.ADQLVersion; +import adql.parser.ADQLParser.ADQLVersion; +import adql.parser.IdentifierItems; import adql.parser.IdentifierItems.IdentifierItem; import adql.parser.ADQLQueryFactory.JoinType; -import adql.parser.feature.FeatureSet; -import adql.parser.feature.LanguageFeature; - import adql.query.*; import adql.query.from.*; import adql.query.constraint.*; @@ -104,886 +94,87 @@ import adql.query.operand.function.string.*; import adql.query.operand.function.geometry.*; import adql.query.operand.function.geometry.GeometryFunction.GeometryValue; -import adql.search.SearchOptionalFeaturesHandler; - -import adql.translator.PostgreSQLTranslator; -import adql.translator.TranslationException; - /** -* Parses an ADQL-2.1 query thanks to the {@link ADQLParser201#Query() Query()} function. -* -* <p> -* This parser is able, thanks to a {@link QueryChecker} object, to check each -* {@link 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 {@link QueryChecker}. Thus -* you must extend {@link QueryChecker} to check semantically all generated -* ADQLQuery objects. -* </p> -* -* <p> -* To create an object representation of the given ADQL query, this parser uses -* a {@link 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 {@link ADQLQueryFactory} -* (ie. createContains(...)). -* </p> -* -* <p>Here are the key functions to use:</p> -* <ul> -* <li>{@link #parseQuery(java.lang.String)} (or any of its alternatives) -* to parse an input ADQL query String and get its corresponding ADQL tree -* </li> -* <li>{@link #tryQuickFix(java.lang.String)} to try fixing the most common -* issues with ADQL queries (e.g. Unicode confusable characters, -* unescaped ADQL identifiers, SQL reserved keywords, ...)</li> -* <li>{@link #setSupportedFeatures(FeatureSet)} to set which optional ADQL -* features are supported or not ; all optional features used in the query -* while being declared as un-supported will throw an error at the end of -* the parsing</li> -* </ul> -* -* <p><b><u>WARNING:</u> -* To modify this class it's strongly encouraged to modify the .jj file in the -* section between <i>PARSER_BEGIN</i> and <i>PARSER_END</i> and to re-compile -* it with JavaCC. -* </b></p> -* -* @see QueryChecker -* @see ADQLQueryFactory -* -* @author Grégory Mantelet (CDS) -* @version 2.0 (07/2019) -* @since 2.0 -*/ -public class ADQLParser201 implements ADQLParser { - - /** Tools to build the object representation of the ADQL query. */ - private ADQLQueryFactory queryFactory = new ADQLQueryFactory(); - - /** Default set of supported language features. - * <p><i><b>Note:</b> - * By default, all optional features are supported. - * </i></p> */ - private FeatureSet supportedFeatures = new FeatureSet(true, true); - - /** The stack of queries (because there may be some sub-queries). */ - private Stack<ADQLQuery> stackQuery = new Stack<ADQLQuery>(); - - /** The object representation of the ADQL query to parse. - * (ONLY USED DURING THE PARSING, else it is always <i>null</i>). */ - private ADQLQuery query = null; - - /** Checks each {@link ADQLQuery} (sub-query or not) just after their - * generation. */ - private QueryChecker queryChecker = null; - - /** - * Builds an ADQL parser without a query to parse. - */ - public ADQLParser201(){ - this(new java.io.ByteArrayInputStream("".getBytes())); - setDebug(false); - } - - /** - * Builds an ADQL parser without a query to parse but with a - * {@link QueryChecker} and a {@link ADQLQueryFactory}. - * - * @param checker The object to use to check each {@link ADQLQuery}. - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser201(QueryChecker checker, ADQLQueryFactory factory) { - this(); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds an ADQL parser without a query to parse but with a - * {@link QueryChecker}. - * - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser201(QueryChecker checker) { - this(checker, null); - } - - /** - * Builds an ADQL parser without a query to parse but with a - * {@link ADQLQueryFactory}. - * - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser201(ADQLQueryFactory factory) { - this((QueryChecker)null, factory); - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param checker The object to use to check each {@link ADQLQuery}. - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser201(java.io.InputStream stream, QueryChecker checker, ADQLQueryFactory factory) { - this(stream); - - setDebug(false); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser201(java.io.InputStream stream, QueryChecker checker) { - this(stream, checker, null); - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser201(java.io.InputStream stream, ADQLQueryFactory factory) { - this(stream, (QueryChecker)null, factory); - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param encoding The supplied encoding. - * @param checker The object to use to check each {@link ADQLQuery}. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser201(java.io.InputStream stream, String encoding, QueryChecker checker, ADQLQueryFactory factory) { - this(stream, encoding); - - setDebug(false); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param encoding The supplied encoding. - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser201(java.io.InputStream stream, String encoding, QueryChecker checker) { - this(stream, encoding, checker, null); - } - - /** - * Builds a parser with a stream containing the query to parse. - * - * @param stream The stream in which the ADQL query to parse is given. - * @param encoding The supplied encoding. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser201(java.io.InputStream stream, String encoding, ADQLQueryFactory factory) { - this(stream, encoding, null, factory); - } - - /** - * Builds a parser with a reader containing the query to parse. - * - * @param reader The reader in which the ADQL query to parse is given. - * @param checker The object to use to check each {@link ADQLQuery}. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser201(java.io.Reader reader, QueryChecker checker, ADQLQueryFactory factory) { - this(reader); - - setDebug(false); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds a parser with a reader containing the query to parse. - * - * @param reader The reader in which the ADQL query to parse is given. - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser201(java.io.Reader reader, QueryChecker checker) { - this(reader, checker, null); - } - - /** - * Builds a parser with a reader containing the query to parse. - * - * @param reader The reader in which the ADQL query to parse is given. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser201(java.io.Reader reader, ADQLQueryFactory factory) { - this(reader, null, factory); - } - - /** - * Builds a parser with another token manager. - * - * @param tm The manager which associates a token to a numeric code. - * @param checker The object to use to check each {@link ADQLQuery }. - * @param factory The object to use to build an object representation - * of the given ADQL query. - */ - public ADQLParser201(ADQLParser201TokenManager tm, QueryChecker checker, ADQLQueryFactory factory) { - this(tm); - - setDebug(false); - - queryChecker = checker; - - if (factory != null) - queryFactory = factory; - } - - /** - * Builds a parser with another token manager. - * - * @param tm The manager which associates a token to a numeric code. - * @param checker The object to use to check each {@link ADQLQuery}. - */ - public ADQLParser201(ADQLParser201TokenManager tm, QueryChecker checker) { - this(tm, checker, null); - } - - /** - * Builds a parser with another token manager. - * - * @param tm The manager which associates a token to a numeric code. - * @param factory The object to use to build an object representation of - * the given ADQL query. - */ - public ADQLParser201(ADQLParser201TokenManager tm, ADQLQueryFactory factory) { - this(tm, null, factory); - } - - /* ADDITIONAL GETTERS & SETTERS */ - - public final ADQLVersion getADQLVersion() { - return ADQLVersion.V2_1; - } - - public final void setDebug(boolean debug){ - if (debug) enable_tracing(); - else disable_tracing(); - } - - public final QueryChecker getQueryChecker(){ - return queryChecker; - } - - public final void setQueryChecker(QueryChecker checker){ - queryChecker = checker; - } - - public final ADQLQueryFactory getQueryFactory(){ - return queryFactory; - } - - public final void setQueryFactory(ADQLQueryFactory factory){ - queryFactory = (factory!=null)?factory:(new ADQLQueryFactory()); - } - - public final FeatureSet getSupportedFeatures() { - return supportedFeatures; - } - - public void setSupportedFeatures(final FeatureSet features) { - if (features != null) - supportedFeatures = features; - } - - /* EXCEPTION HELPER FUNCTION */ - - private final ParseException generateParseException(Exception ex){ - if (!(ex instanceof ParseException)){ - ParseException pex = new ParseException("["+ex.getClass().getName()+"] "+ex.getMessage()); - pex.setStackTrace(ex.getStackTrace()); - return pex; - }else - return (ParseException)ex; - } - - /* QUERY PARSING FUNCTIONS */ - - /** - * Tell whether the given string is a valid ADQL regular identifier. - * - * <p> - * According to the ADQL-2.0's BNF, a regular identifier (i.e. not delimited - * ; not between double quotes) must be a letter followed by a letter, digit - * or underscore. So, the following regular expression: - * </p> - * <pre>[a-zA-Z]+[a-zA-Z0-9_]*</pre> - * - * <p>This is what this function tests on the given string.</p> - * - * @param idCandidate The string to test. - * - * @return <code>true</code> if the given string is a valid regular - * identifier, - * <code>false</code> otherwise. - * - * @see #testRegularIdentifier(adql.parser.Token) - * - * @since 1.5 - */ - public final boolean isRegularIdentifier(final String idCandidate) { - return idCandidate.matches("[a-zA-Z]+[a-zA-Z0-9_]*"); - } + * Parser of ADQL expressions following the ADQL-2.1 grammar. + * + * <p><i><b>Note:</b> + * It is strongly recommended to not use this class directly in order to parse + * an ADQL expression. Instead, you should use + * {@link adql.parser.ADQLParser ADQLParser}. It provides a more user-friendly + * interface and provides additional features. + * </i></p> + * + * @see ADQLParser + * + * @author Grégory Mantelet (CDS) + * @version 2.0 (08/2019) + * @since 2.0 + */ +public class ADQLGrammar201 extends ADQLGrammarBase { - /** - * Test the given token as an ADQL's regular identifier. - * - * <p> - * This function uses {@link #isRegularIdentifier(java.lang.String)} to - * test the given token's image. If the test fails, a - * {@link adql.parser.ParseException} is thrown. - * </p> - * - * @param token The token to test. - * - * @throws ParseException If the given token is not a valid ADQL regular - * identifier. - * - * @see #isRegularIdentifier(java.lang.String) - * - * @since 1.5 - */ - public final void testRegularIdentifier(final Token token) throws ParseException { - if (!isRegularIdentifier(token.image)) - throw new ParseException("Invalid ADQL regular identifier: \""+token.image+"\"! If it aims to be a column/table name/alias, you should write it between double quotes.", new TextPosition(token)); - } - - /** - * Parses the query given at the creation of this parser or in the - * <i>ReInit</i> functions. - * - * @return The object representation of the given ADQL query. - * - * @throws ParseException If there is at least one syntactic error. - * - * @see ADQLParser201#Query() - */ - public final ADQLQuery parseQuery() throws ParseException { - stackQuery.clear(); - query = null; - try { - return Query(); - }catch(TokenMgrError tme) { - throw new ParseException(tme); - } - } - - /** - * Parses the query given in parameter. - * - * @param q The ADQL query to parse. - * - * @return The object representation of the given ADQL query. - * - * @throws ParseException If there is at least one syntactic error. - * - * @see ADQLParser201#ReInit(java.io.InputStream) - * @see ADQLParser201#setDebug(boolean) - * @see ADQLParser201#Query() - */ - public final ADQLQuery parseQuery(String q) throws ParseException { - stackQuery.clear(); - query = null; - ReInit(new java.io.ByteArrayInputStream(q.getBytes())); - try { - return Query(); - }catch(TokenMgrError tme) { - throw new ParseException(tme); - } - } + /* ********************************************************************** + * GETTERS/SETTERS * + ********************************************************************** */ - /** - * Parses the query contained in the stream given in parameter. - * - * @param stream The stream which contains the ADQL query to parse. - * - * @return The object representation of the given ADQL query. - * - * @throws ParseException If there is at least one syntactic error. - * - * @see ADQLParser201#ReInit(java.io.InputStream) - * @see ADQLParser201#setDebug(boolean) - * @see ADQLParser201#Query() - */ - public final ADQLQuery parseQuery(java.io.InputStream stream) throws ParseException { - stackQuery.clear(); - query = null; - ReInit(stream); - try { - return Query(); - }catch(TokenMgrError tme) { - throw new ParseException(tme); - } - } - - @Override - public final ClauseSelect parseSelect(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_1); - - // Parse the string as a SELECT clause: - Select(); + /** Implemented version of the ADQL Standard. */ + public final static ADQLVersion VERSION = ADQLVersion.V2_1; - // Return what's just got parsed: - return query.getSelect(); - - }catch(TokenMgrError tme) { - throw new ParseException(tme); - }catch(Exception ex){ - throw generateParseException(ex); - } + public final ADQLVersion getVersion() { + return VERSION; } - - @Override - public final FromContent parseFrom(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_1); - // Parse the string as a FROM clause: - From(); + /* ********************************************************************** + * TOKEN KIND TESTS * + ********************************************************************** */ - // Return what's just got parsed: - return query.getFrom(); - - }catch(TokenMgrError tme) { - throw new ParseException(tme); - }catch(Exception ex){ - throw generateParseException(ex); - } + public final boolean isEOF(final Token token) { + return token != null && token.kind == ADQLGrammar201Constants.EOF; } - - @Override - public final ClauseConstraints parseWhere(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_1); - - // Parse the string as a WHERE clause: - Where(); - // Return what's just got parsed: - return query.getWhere(); - - }catch(TokenMgrError tme) { - throw new ParseException(tme); - }catch(Exception ex){ - throw generateParseException(ex); - } + public final boolean isEOQ(final Token token) { + return token != null && token.kind == ADQLGrammar201Constants.EOQ; } - - @Override - public final ClauseADQL<ADQLOrder> parseOrderBy(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_1); - - // Parse the string as a ORDER BY clause: - OrderBy(); - // Return what's just got parsed: - return query.getOrderBy(); - - }catch(TokenMgrError tme) { - throw new ParseException(tme); - }catch(Exception ex){ - throw generateParseException(ex); - } + public final boolean isRegularIdentifierCandidate(final Token token) { + return token != null && token.kind == ADQLGrammar201Constants.REGULAR_IDENTIFIER_CANDIDATE; } - - @Override - public final ClauseADQL<ADQLColumn> parseGroupBy(java.lang.String adql) throws ParseException { - // Set the string to parse: - ReInit(new java.io.ByteArrayInputStream(adql.getBytes())); - - try { - // Create the query: - query = queryFactory.createQuery(ADQLVersion.V2_1); - - // Parse the string as a GROUP BY clause: - GroupBy(); - // Return what's just got parsed: - return query.getGroupBy(); - - }catch(TokenMgrError tme) { - throw new ParseException(tme); - }catch(Exception ex){ - throw generateParseException(ex); - } + public final boolean isSQLReservedWord(final Token token) { + return token != null && token.kind == ADQLGrammar201Constants.SQL_RESERVED_WORD; } - /* TOKENIZATION FUNCTION */ - - public Token[] tokenize(final String expr) throws ParseException { - ADQLParser201TokenManager parser = new ADQLParser201TokenManager(new SimpleCharStream(new java.io.ByteArrayInputStream(expr.getBytes()))); - try{ - ArrayList<Token> tokens = new ArrayList<Token>(); - Token token; - while(!isEnd((token=parser.getNextToken()))){ - tokens.add(token); - } - return tokens.toArray(new Token[tokens.size()]); - }catch(TokenMgrError err){ - // wrap such errors and propagate them: - throw new ParseException(err); - } + public final boolean isLeftPar(final Token token) { + return token != null && token.kind == ADQLGrammar201Constants.LEFT_PAR; } - /* CORRECTION SUGGESTION */ - - /** - * Try fixing tokens/terms of the input ADQL query. - * - * <p> - * <b>This function does not try to fix syntactical or semantical errors.</b> - * It just try to fix the most common issues in ADQL queries, such as: - * </p> - * <ul> - * <li>some Unicode characters confusable with ASCII characters (like a - * space, a dash, ...) ; this function replace them by their ASCII - * alternative,</li> - * <li>any of the following are double quoted: - * <ul> - * <li>non regular ADQL identifiers - * (e.g. <code>_RAJ2000</code>),</li> - * <li>ADQL function names used as identifiers - * (e.g. <code>distance</code>)</li> - * <li>and SQL reserved keywords - * (e.g. <code>public</code>).</li> - * </ul> - * </li> - * </ul> - * - * <p><i><b>Note 1:</b> - * The given stream is NOT closed by this function even if the EOF is - * reached. It is the responsibility of the caller to close it. - * </i></p> - * - * <p><i><b>Note 2:</b> - * This function does not use any instance variable of this parser - * (especially the InputStream or Reader provided at initialisation or - * ReInit). - * </i></p> - * - * @param input Stream containing the input ADQL query to fix. - * - * @return The suggested correction of the input ADQL query. - * - * @throws java.io.IOException If there is any error while reading from the - * given input stream. - * @throws ParseException If any unrecognised character is encountered, - * or if anything else prevented the tokenization - * of some characters/words/terms. - * - * @see #tryQuickFix(java.lang.String) - * - * @since 1.5 - */ - public final String tryQuickFix(final java.io.InputStream input) throws java.io.IOException, ParseException { - // Fetch everything into a single string: - StringBuffer buf = new StringBuffer(); - byte[] cBuf = new byte[1024]; - int nbChar; - while((nbChar = input.read(cBuf)) > -1){ - buf.append(new String(cBuf, 0, nbChar)); - } - - // Convert the buffer into a String and now try to fix it: - return tryQuickFix(buf.toString()); - } + /* ********************************************************************** + * TOKENIZATION HELPER * + ********************************************************************** */ - /** - * Try fixing tokens/terms of the given ADQL query. - * - * <p> - * <b>This function does not try to fix syntactical or semantical errors.</b> - * It just try to fix the most common issues in ADQL queries, such as: - * </p> - * <ul> - * <li>some Unicode characters confusable with ASCII characters (like a - * space, a dash, ...) ; this function replace them by their ASCII - * alternative,</li> - * <li>any of the following are double quoted: - * <ul> - * <li>non regular ADQL identifiers - * (e.g. <code>_RAJ2000</code>),</li> - * <li>ADQL function names used as identifiers - * (e.g. <code>distance</code>)</li> - * <li>and SQL reserved keywords - * (e.g. <code>public</code>).</li> - * </ul> - * </li> - * </ul> - * - * <p><i><b>Note:</b> - * This function does not use any instance variable of this parser - * (especially the InputStream or Reader provided at initialisation or - * ReInit). - * </i></p> - * - * @param adqlQuery The input ADQL query to fix. - * - * @return The suggested correction of the given ADQL query. - * - * @throws ParseException If any unrecognised character is encountered, - * or if anything else prevented the tokenization - * of some characters/words/terms. - * - * @since 1.5 - */ - public String tryQuickFix(String adqlQuery) throws ParseException { - StringBuffer suggestedQuery = new StringBuffer(); - - // 1. Replace all Unicode confusable characters: - adqlQuery = replaceUnicodeConfusables(adqlQuery); - - /* 1.bis. Normalise new lines and tabulations - * (to simplify the column counting): */ - adqlQuery = adqlQuery.replaceAll("(\r\n|\r|\n)", System.getProperty("line.separator")).replaceAll("\t", " "); - - // 2. Analyse the query token by token: - ADQLParser201TokenManager parser = new ADQLParser201TokenManager(new SimpleCharStream(new java.io.ByteArrayInputStream(adqlQuery.getBytes()))); - - final String[] lines = adqlQuery.split(System.getProperty("line.separator")); + public final Tokenizer getTokenizer(final String expr) throws NullPointerException { + // Error if no expression to tokenize: + if (expr == null) + throw new NullPointerException("Missing ADQL expression to tokenize!"); - try{ - String suggestedToken; - int lastLine = 1, lastCol = 1; - - Token token = null, nextToken = parser.getNextToken(); - // for all tokens until the EOF or EOQ: - do{ - // get the next token: - token = nextToken; - nextToken = (isEnd(token) ? null : parser.getNextToken()); - - // 3. Double quote any suspect token: - if (mustEscape(token, nextToken)){ - suggestedToken = "\"" + token.image + "\""; - }else - suggestedToken = token.image; - - /* 4. Append all space characters (and comments) before the - * token: */ - /* same line, just get the space characters between the last - * token and the one to append: */ - if (lastLine == token.beginLine){ - if (token.kind == ADQLParser201Constants.EOF) - suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1)); - else - suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1, token.beginColumn - (isEnd(token) ? 0 : 1))); - lastCol = token.endColumn + 1; - } - // not the same line... - else{ - /* append all remaining space characters until the position - * of the token to append: */ - do{ - suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1)).append('\n'); - lastLine++; - lastCol = 1; - }while(lastLine < token.beginLine); - /* if there are still space characters before the token, - * append them as well: */ - if (lastCol < token.beginColumn) - suggestedQuery.append(lines[lastLine - 1].substring(lastCol - 1, token.beginColumn - 1)); - // finally, set the correct column position: - lastCol = token.endColumn + 1; + // Return a Tokenizer: instance + return new Tokenizer() { + private final ADQLGrammar201TokenManager tokenManager = new ADQLGrammar201TokenManager(new SimpleCharStream(new java.io.ByteArrayInputStream(expr.getBytes()))); + private boolean eof = false; + @Override + public Token nextToken() { + if (eof) + return null; + else { + Token tok = tokenManager.getNextToken(); + eof = (tok.kind == ADQLGrammar201Constants.EOF); + return tok; } - - // 5. Append the suggested token: - suggestedQuery.append(suggestedToken); - - }while(!isEnd(token)); - - }catch(TokenMgrError err){ - // wrap such errors and propagate them: - throw new ParseException(err); - } - - return suggestedQuery.toString(); - } - - /** - * All of the most common Unicode confusable characters and their - * ASCII/UTF-8 alternative. - * - * <p> - * Keys of this map represent the ASCII character while the values are the - * regular expression for all possible Unicode alternatives. - * </p> - * - * <p><i><b>Note:</b> - * All of them have been listed using - * <a href="https://unicode.org/cldr/utility/confusables.jsp">Unicode Utilities: Confusables</a>. - * </i></p> - * - * @since 1.5 - */ - protected final static java.util.Map<String, String> REGEX_UNICODE_CONFUSABLES = new java.util.HashMap<String, String>(10); - /** Regular expression matching all Unicode alternatives for <code>-</code>. - * @since 1.5 */ - protected final static String REGEX_DASH = "[\u002D\u02D7\u06D4\u2010\u2011\u2012\u2013\u2043\u2212\u2796\u2CBA\uFE58\u2014\u2015\u207B\u208B\u0096\u058A\uFE63\uFF0D]"; - /** Regular expression matching all Unicode alternatives for <code>_</code>. - * @since 1.5 */ - protected final static String REGEX_UNDERSCORE = "[\u005F\u07FA\uFE4D\uFE4E\uFE4F]"; - /** Regular expression matching all Unicode alternatives for <code>'</code>. - * @since 1.5 */ - protected final static String REGEX_QUOTE = "[\u0027\u0060\u00B4\u02B9\u02BB\u02BC\u02BD\u02BE\u02C8\u02CA\u02CB\u02F4\u0374\u0384\u055A\u055D\u05D9\u05F3\u07F4\u07F5\u144A\u16CC\u1FBD\u1FBF\u1FEF\u1FFD\u1FFE\u2018\u2019\u201B\u2032\u2035\uA78C\uFF07\uFF40]"; - /** Regular expression matching all Unicode alternatives for <code>"</code>. - * @since 1.5 */ - protected final static String REGEX_DOUBLE_QUOTE = "[\u02BA\u02DD\u02EE\u02F6\u05F2\u05F4\u1CD3\u201C\u201D\u201F\u2033\u2036\u3003\uFF02]"; - /** Regular expression matching all Unicode alternatives for <code>.</code>. - * @since 1.5 */ - protected final static String REGEX_STOP = "[\u002E\u0660\u06F0\u0701\u0702\u2024\uA4F8\uA60E]"; - /** Regular expression matching all Unicode alternatives for <code>+</code>. - * @since 1.5 */ - protected final static String REGEX_PLUS = "[\u002B\u16ED\u2795]"; - /** Regular expression matching all Unicode alternatives for <code> </code>. - * @since 1.5 */ - protected final static String REGEX_SPACE = "[\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F]"; - /** Regular expression matching all Unicode alternatives for <code><</code>. - * @since 1.5 */ - protected final static String REGEX_LESS_THAN = "[\u003C\u02C2\u1438\u16B2\u2039\u276E]"; - /** Regular expression matching all Unicode alternatives for <code>></code>. - * @since 1.5 */ - protected final static String REGEX_GREATER_THAN = "[\u003E\u02C3\u1433\u203A\u276F]"; - /** Regular expression matching all Unicode alternatives for <code>=</code>. - * @since 1.5 */ - protected final static String REGEX_EQUAL = "[\u003D\u1400\u2E40\u30A0\uA4FF]"; - static { - REGEX_UNICODE_CONFUSABLES.put("-", REGEX_DASH); - REGEX_UNICODE_CONFUSABLES.put("_", REGEX_UNDERSCORE); - REGEX_UNICODE_CONFUSABLES.put("'", REGEX_QUOTE); - REGEX_UNICODE_CONFUSABLES.put("\"", REGEX_DOUBLE_QUOTE); - REGEX_UNICODE_CONFUSABLES.put(".", REGEX_STOP); - REGEX_UNICODE_CONFUSABLES.put("+", REGEX_PLUS); - REGEX_UNICODE_CONFUSABLES.put(" ", REGEX_SPACE); - REGEX_UNICODE_CONFUSABLES.put("<", REGEX_LESS_THAN); - REGEX_UNICODE_CONFUSABLES.put(">", REGEX_GREATER_THAN); - REGEX_UNICODE_CONFUSABLES.put("=", REGEX_EQUAL); - } - - /** - * Replace all Unicode characters that can be confused with other ASCI/UTF-8 - * characters (e.g. different spaces, dashes, ...) in their ASCII version. - * - * @param adqlQuery The ADQL query string in which Unicode confusable - * characters must be replaced. - * - * @return The same query without the most common Unicode confusable - * characters. - * - * @since 1.5 - */ - protected String replaceUnicodeConfusables(final String adqlQuery){ - String newAdqlQuery = adqlQuery; - for(java.util.Map.Entry<String, String> confusable : REGEX_UNICODE_CONFUSABLES.entrySet()) - newAdqlQuery = newAdqlQuery.replaceAll(confusable.getValue(), confusable.getKey()); - return newAdqlQuery; - } - - /** - * Tell whether the given token represents the end of an ADQL query. - * - * @param token Token to analyze. - * - * @return <code>true</code> if the given token represents a query end, - * <code>false</code> otherwise. - * - * @since 1.5 - */ - protected boolean isEnd(final Token token){ - return token.kind == ADQLParser201Constants.EOF || token.kind == ADQLParser201Constants.EOQ; - } - - /** - * Tell whether the given token must be double quoted. - * - * <p> - * This function considers all the following as terms to double quote: - * </p> - * <ul> - * <li>SQL reserved keywords</li>, - * <li>unrecognised regular identifiers (e.g. neither a delimited nor a - * valid ADQL regular identifier)</li> - * <li>and ADQL function name without a parameters list.</li> - * </ul> - * - * @param token The token to analyze. - * @param nextToken The following token. (useful to detect the start of a - * function's parameters list) - * - * @return <code>true</code> if the given token must be double quoted, - * <code>false</code> to keep it as provided. - * - * @since 1.5 - */ - protected boolean mustEscape(final Token token, final Token nextToken){ - switch(token.kind){ - case ADQLParser201Constants.SQL_RESERVED_WORD: - return true; - case ADQLParser201Constants.REGULAR_IDENTIFIER_CANDIDATE: - return !isRegularIdentifier(token.image); - default: - return token.isFunctionName && (nextToken == null || nextToken.kind != ADQLParser201Constants.LEFT_PAR); - } + } + }; } } -PARSER_END(ADQLParser201) +PARSER_END(ADQLGrammar201) /* ################################### */ /* # CUSTOMIZATION OF TOKEN CREATION # */ @@ -991,7 +182,7 @@ PARSER_END(ADQLParser201) TOKEN_MGR_DECLS: { protected void CommonTokenAction(final Token t) { - t.adqlVersion = ADQLParserFactory.ADQLVersion.V2_1; + t.adqlVersion = ADQLGrammar201.VERSION; } } @@ -1008,7 +199,7 @@ SKIP : { < " " | "\t" | "\n" | "\r" | "\r\n" > } /* Reserved SQL words */ /* */ /* NOTE: */ -/* This list is the one provided by the ADQL-2.0 standard after removal of */ +/* This list is the one provided by the ADQL-2.1 standard after removal of */ /* all ADQL used words (e.g. SELECT, AS, LIKE, AVG, ABS, COS, POINT). */ /* (see ParseException.initialise(Token, int[][], String[]) for more */ /* details) */ @@ -1225,42 +416,17 @@ TOKEN : { /* ******************* */ /* GENERAL ADQL SYNTAX */ /* ******************* */ -/** -* Parses the ADQL query given at the parser creation or in the {@link ADQLParser201#ReInit(java.io.InputStream)} -* or in the <i>parseQuery</i> functions. -* -* @return The object representation of the query. -* @throws ParseException If the query syntax is incorrect. -*/ + ADQLQuery Query(): {ADQLQuery q = null;}{ q=QueryExpression() (<EOF> | <EOQ>) - { - /* check the optional features before any other check: - * (note: this check is very close to grammar check...hence its higher - * priority) */ - UnresolvedIdentifiersException exUnsupportedFeatures = new UnresolvedIdentifiersException("unsupported expression"); - SearchOptionalFeaturesHandler sFeaturesHandler = new SearchOptionalFeaturesHandler(true, false); - sFeaturesHandler.search(q); - for(ADQLObject obj : sFeaturesHandler) { - if (!supportedFeatures.isSupporting(obj.getFeatureDescription())) - exUnsupportedFeatures.addException(new UnsupportedFeatureException(obj)); - } - if (exUnsupportedFeatures.getNbErrors() > 0) - throw exUnsupportedFeatures; - - // check the query: - if (queryChecker != null) - queryChecker.check(q); - - return q; - } + { return q; } } ADQLQuery QueryExpression(): {TextPosition endPos = null;} { { try{ // create the query: - query = queryFactory.createQuery(ADQLVersion.V2_1); + query = queryFactory.createQuery(VERSION); stackQuery.push(query); }catch(Exception ex){ throw generateParseException(ex); @@ -2214,8 +1380,6 @@ UserDefinedFunction UserDefinedFunction(): {Token fct, end; Vector<ADQLOperand> if (!isRegularIdentifier(fct.image)) throw new ParseException("Invalid (User Defined) Function name: \""+fct.image+"\"!", new TextPosition(fct)); - //System.out.println("INFO [ADQLParser201]: \""+fct.image+"\" (from line "+fct.beginLine+" and column "+fct.beginColumn+" to line "+token.endLine+" and column "+(token.endColumn+1)+") is considered as an user defined function !"); - try{ // Build the parameters list: ADQLOperand[] parameters = new ADQLOperand[params.size()]; diff --git a/src/adql/query/ADQLQuery.java b/src/adql/query/ADQLQuery.java index 1d280337d221af9a997fc4df66ba5c355985b572..eb230f8ccfbc495a49cd46824c12389c116d7afd 100644 --- a/src/adql/query/ADQLQuery.java +++ b/src/adql/query/ADQLQuery.java @@ -29,10 +29,9 @@ import adql.db.DBType; import adql.db.DBType.DBDatatype; import adql.db.DefaultDBColumn; import adql.parser.ADQLParser; -import adql.parser.ADQLParserFactory; -import adql.parser.ADQLParserFactory.ADQLVersion; -import adql.parser.ParseException; +import adql.parser.ADQLParser.ADQLVersion; import adql.parser.feature.LanguageFeature; +import adql.parser.grammar.ParseException; import adql.query.from.FromContent; import adql.query.operand.ADQLColumn; import adql.query.operand.ADQLOperand; @@ -92,7 +91,7 @@ public class ADQLQuery implements ADQLObject { * Builds an empty ADQL query. */ public ADQLQuery() { - this(ADQLParserFactory.DEFAULT_VERSION); + this(ADQLParser.DEFAULT_VERSION); } /** @@ -106,7 +105,7 @@ public class ADQLQuery implements ADQLObject { * @since 2.0 */ public ADQLQuery(final ADQLVersion version) { - this.adqlVersion = (version == null ? ADQLParserFactory.DEFAULT_VERSION : version); + this.adqlVersion = (version == null ? ADQLParser.DEFAULT_VERSION : version); select = new ClauseSelect(); from = null; where = new ClauseConstraints("WHERE"); diff --git a/src/adql/query/TextPosition.java b/src/adql/query/TextPosition.java index 5324ebab077160eed2e873d290f21779ad2161f8..a74a434d0dde20e04d5eeef5bd9e41216a4a8fa3 100644 --- a/src/adql/query/TextPosition.java +++ b/src/adql/query/TextPosition.java @@ -20,7 +20,7 @@ package adql.query; * Astronomisches Rechen Institute (ARI) */ -import adql.parser.Token; +import adql.parser.grammar.Token; /** * Indicates a simple position or a token/string position in a text. diff --git a/src/adql/query/operand/function/DefaultUDF.java b/src/adql/query/operand/function/DefaultUDF.java index aebb56480923a2fc63630c964938529cf79a6a00..ddf5fd6cd58715718896e8e8d799fec7e3799b0a 100644 --- a/src/adql/query/operand/function/DefaultUDF.java +++ b/src/adql/query/operand/function/DefaultUDF.java @@ -26,8 +26,8 @@ import adql.db.DBType; import adql.db.DBType.DBDatatype; import adql.db.FunctionDef; import adql.db.FunctionDef.FunctionParam; -import adql.parser.ParseException; import adql.parser.feature.LanguageFeature; +import adql.parser.grammar.ParseException; import adql.query.ADQLList; import adql.query.ADQLObject; import adql.query.ClauseADQL; diff --git a/src/adql/query/operand/function/geometry/GeometryFunction.java b/src/adql/query/operand/function/geometry/GeometryFunction.java index 6b1c30543ba33141699d5cdf0a598fabfa935342..6669a0482b9fdfdc4555c0ba61d0a8629b048a6f 100644 --- a/src/adql/query/operand/function/geometry/GeometryFunction.java +++ b/src/adql/query/operand/function/geometry/GeometryFunction.java @@ -20,8 +20,8 @@ package adql.query.operand.function.geometry; * Astronomisches Rechen Institut (ARI) */ -import adql.parser.ParseException; import adql.parser.feature.LanguageFeature; +import adql.parser.grammar.ParseException; import adql.query.ADQLIterator; import adql.query.ADQLObject; import adql.query.TextPosition; diff --git a/src/adql/translator/JDBCTranslator.java b/src/adql/translator/JDBCTranslator.java index e494eacd6280ae9bbdc875f711807df2b621021d..0baa58cea6db57f703636f0015cf29b5a955f07e 100644 --- a/src/adql/translator/JDBCTranslator.java +++ b/src/adql/translator/JDBCTranslator.java @@ -28,7 +28,7 @@ import adql.db.DBTableAlias; import adql.db.DBType; import adql.db.STCS.Region; import adql.db.exception.UnresolvedJoinException; -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; import adql.query.ADQLList; import adql.query.ADQLObject; import adql.query.ADQLOrder; diff --git a/src/adql/translator/MySQLTranslator.java b/src/adql/translator/MySQLTranslator.java index 0973de6270ce27651ac39c7b3a82e7ddc9276016..6d2b3ce465f7e10b6b91633addbec4ce745d413f 100644 --- a/src/adql/translator/MySQLTranslator.java +++ b/src/adql/translator/MySQLTranslator.java @@ -3,7 +3,7 @@ package adql.translator; import adql.db.DBType; import adql.db.DBType.DBDatatype; import adql.db.STCS.Region; -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; import adql.query.IdentifierField; import adql.query.operand.ADQLOperand; import adql.query.operand.Concatenation; diff --git a/src/adql/translator/PgSphereTranslator.java b/src/adql/translator/PgSphereTranslator.java index afc5a89b2d526a4e7363193b19652138c9e0d49e..7c34e1a4cea7c44dc22f2626fcd0079e052ade8b 100644 --- a/src/adql/translator/PgSphereTranslator.java +++ b/src/adql/translator/PgSphereTranslator.java @@ -28,7 +28,7 @@ import org.postgresql.util.PGobject; import adql.db.DBType; import adql.db.DBType.DBDatatype; import adql.db.STCS.Region; -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; import adql.query.TextPosition; import adql.query.constraint.Comparison; import adql.query.constraint.ComparisonOperator; diff --git a/src/adql/translator/PostgreSQLTranslator.java b/src/adql/translator/PostgreSQLTranslator.java index 68d740af5e41e4aef09899736af6ec3a92d051a9..da27125bd98061f73efe61a4314270f2fd1f2c17 100644 --- a/src/adql/translator/PostgreSQLTranslator.java +++ b/src/adql/translator/PostgreSQLTranslator.java @@ -23,7 +23,7 @@ package adql.translator; import adql.db.DBType; import adql.db.DBType.DBDatatype; import adql.db.STCS.Region; -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; import adql.query.IdentifierField; import adql.query.operand.StringConstant; import adql.query.operand.function.ADQLFunction; diff --git a/src/adql/translator/SQLServerTranslator.java b/src/adql/translator/SQLServerTranslator.java index 1790061f2fd16124fd20d2ae0265908b3f91bb3e..79990dd4eb6f78ccd55d1a7097ab30c0db80894d 100644 --- a/src/adql/translator/SQLServerTranslator.java +++ b/src/adql/translator/SQLServerTranslator.java @@ -28,8 +28,8 @@ import adql.db.DBType.DBDatatype; import adql.db.STCS.Region; import adql.db.SearchColumnList; import adql.db.exception.UnresolvedJoinException; -import adql.parser.ParseException; import adql.parser.SQLServer_ADQLQueryFactory; +import adql.parser.grammar.ParseException; import adql.query.ADQLQuery; import adql.query.ClauseSelect; import adql.query.IdentifierField; diff --git a/src/tap/ADQLExecutor.java b/src/tap/ADQLExecutor.java index 75fc6442fd1bbc8133862b992c4109c82877bcf5..72b0b87bfbd6ece5198973e25bb5b2304fb43b8d 100644 --- a/src/tap/ADQLExecutor.java +++ b/src/tap/ADQLExecutor.java @@ -26,9 +26,8 @@ import java.io.OutputStream; import javax.servlet.http.HttpServletResponse; import adql.parser.ADQLParser; -import adql.parser.ADQLParserFactory; import adql.parser.ADQLQueryFactory; -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; import adql.query.ADQLQuery; import tap.data.DataReadException; import tap.data.TableIterator; @@ -540,7 +539,7 @@ public class ADQLExecutor { ADQLParser parser = service.getFactory().createADQLParser(); if (parser == null) { logger.logTAP(LogLevel.WARNING, null, "PARSING", "No ADQL parser returned by the TAPFactory! The default implementation is used instead.", null); - parser = ADQLParserFactory.createDefaultParser(); + parser = new ADQLParser(); } // Set the ADQL factory: diff --git a/src/tap/AbstractTAPFactory.java b/src/tap/AbstractTAPFactory.java index c9899fdea0b6e329f62a941a9f5ff14bc92e9e0f..6d5956d481af5ff2aba45e2ea13b24e3d0b8f347 100644 --- a/src/tap/AbstractTAPFactory.java +++ b/src/tap/AbstractTAPFactory.java @@ -30,10 +30,9 @@ import javax.servlet.http.HttpServletRequest; import adql.db.DBChecker; import adql.parser.ADQLParser; -import adql.parser.ADQLParserFactory; import adql.parser.ADQLQueryFactory; -import adql.parser.ParseException; import adql.parser.QueryChecker; +import adql.parser.grammar.ParseException; import adql.query.ADQLQuery; import tap.db.DBConnection; import tap.error.DefaultTAPErrorWriter; @@ -56,18 +55,13 @@ import uws.service.error.ServiceErrorWriter; * Only the functions related with the database connection stay abstract. * * @author Grégory Mantelet (CDS;ARI) - * @version 3.0 (04/2019) + * @version 3.0 (08/2019) */ public abstract class AbstractTAPFactory extends TAPFactory { /** The error writer to use when any error occurs while executing a resource or to format an error occurring while executing an asynchronous job. */ protected final ServiceErrorWriter errorWriter; - /** Factory of ADQL parsers. This factory can be configured to work with a - * different version of the ADQL grammar. - * @since 3.0 */ - protected ADQLParserFactory parserFactory; - /** * Build a basic TAPFactory. * Nothing is done except setting the service connection. @@ -98,7 +92,6 @@ public abstract class AbstractTAPFactory extends TAPFactory { protected AbstractTAPFactory(final ServiceConnection service, final ServiceErrorWriter errorWriter) throws NullPointerException { super(service); this.errorWriter = errorWriter; - this.parserFactory = new ADQLParserFactory(); } @Override @@ -128,7 +121,7 @@ public abstract class AbstractTAPFactory extends TAPFactory { */ @Override public ADQLParser createADQLParser() throws TAPException { - return parserFactory.createParser(); + return new ADQLParser(); } /** diff --git a/src/tap/config/ConfigurableServiceConnection.java b/src/tap/config/ConfigurableServiceConnection.java index 8540f73d59d79fd19baf8bdc9a26b67ae384eafc..1cac6b64f86ca73d7f550d0add246a16b873c210 100644 --- a/src/tap/config/ConfigurableServiceConnection.java +++ b/src/tap/config/ConfigurableServiceConnection.java @@ -101,7 +101,7 @@ import java.util.regex.Pattern; import adql.db.FunctionDef; import adql.db.STCS; -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; import adql.query.operand.function.UserDefinedFunction; import tap.ServiceConnection; import tap.TAPException; diff --git a/src/tap/data/ResultSetTableIterator.java b/src/tap/data/ResultSetTableIterator.java index 0dc3012153f04101c2ac211a8eec139d006ef253..8b693bea6812f3a50568b8067b1a366e957add92 100644 --- a/src/tap/data/ResultSetTableIterator.java +++ b/src/tap/data/ResultSetTableIterator.java @@ -35,7 +35,7 @@ import adql.db.DBColumn; import adql.db.DBType; import adql.db.DBType.DBDatatype; import adql.db.STCS.Region; -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; import adql.translator.JDBCTranslator; import tap.db.DBConnection; import tap.metadata.TAPColumn; diff --git a/src/tap/db/JDBCConnection.java b/src/tap/db/JDBCConnection.java index ff7ce7c8320ed8dc4f378950cb0ffb370745bb22..4e4f17ec235698ea782eca8575803e5898b3771c 100644 --- a/src/tap/db/JDBCConnection.java +++ b/src/tap/db/JDBCConnection.java @@ -2486,7 +2486,7 @@ public class JDBCConnection implements DBConnection { // parse the region as an STC-S expression: try{ region = STCS.parseRegion(val.toString()); - }catch(adql.parser.ParseException e){ + }catch(adql.parser.grammar.ParseException e){ if (logger != null) logger.logDB(LogLevel.ERROR, this, "UPLOAD", "[l. " + nbRows + ", c. " + c + "] Incorrect STC-S syntax for the geometrical value \"" + val + "\"! " + e.getMessage(), e); throw new DataReadException("[l. " + nbRows + ", c. " + c + "] Incorrect STC-S syntax for the geometrical value \"" + val + "\"! " + e.getMessage(), e); @@ -2494,7 +2494,7 @@ public class JDBCConnection implements DBConnection { // translate this STC region into the corresponding column value: try{ val = translator.translateGeometryToDB(region); - }catch(adql.parser.ParseException e){ + }catch(adql.parser.grammar.ParseException e){ if (logger != null) logger.logDB(LogLevel.ERROR, this, "UPLOAD", "[l. " + nbRows + ", c. " + c + "] Impossible to import the ADQL geometry \"" + val + "\" into the database! " + e.getMessage(), e); throw new DataReadException("[l. " + nbRows + ", c. " + c + "] Impossible to import the ADQL geometry \"" + val + "\" into the database! " + e.getMessage(), e); diff --git a/test/adql/db/TestDBChecker.java b/test/adql/db/TestDBChecker.java index 7555e5dcd19dc53ed8d69f4d99e6c0d7a1cc132e..f0ab7ec8bd37fcaa44ec95513c427b966ad5f86e 100644 --- a/test/adql/db/TestDBChecker.java +++ b/test/adql/db/TestDBChecker.java @@ -22,9 +22,8 @@ import adql.db.DBType.DBDatatype; import adql.db.FunctionDef.FunctionParam; import adql.db.exception.UnresolvedIdentifiersException; import adql.parser.ADQLParser; -import adql.parser.ADQLParserFactory; -import adql.parser.ParseException; import adql.parser.feature.LanguageFeature; +import adql.parser.grammar.ParseException; import adql.query.ADQLObject; import adql.query.ADQLQuery; import adql.query.operand.ADQLColumn; @@ -43,8 +42,6 @@ import adql.translator.TranslationException; public class TestDBChecker { - ADQLParserFactory parserFactory = new ADQLParserFactory(); - private static List<DBTable> tables; @BeforeClass @@ -115,7 +112,7 @@ public class TestDBChecker { * * This issue can be tested by creating a ConstraintsGroup (i.e. in a constraints location like WHERE or JOIN...ON, * a constraint (or more) between parenthesis). */ - ADQLParser parser = parserFactory.createParser(); + ADQLParser parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables, new ArrayList<FunctionDef>(0))); try { parser.parseQuery("SELECT * FROM foo WHERE (colI BETWEEN 1 AND 10)"); @@ -127,7 +124,7 @@ public class TestDBChecker { @Test public void testGroupByWithQualifiedColName() { - ADQLParser parser = parserFactory.createParser(); + ADQLParser parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables, new ArrayList<FunctionDef>(0))); try { // Not qualified column name: @@ -146,7 +143,7 @@ public class TestDBChecker { @Test public void testQualifiedName() { - ADQLParser parser = parserFactory.createParser(); + ADQLParser parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables, new ArrayList<FunctionDef>(0))); try { // Tests with a table whose the schema is specified: @@ -189,7 +186,7 @@ public class TestDBChecker { @Test public void testColRefWithDottedAlias() { - ADQLParser parser = parserFactory.createParser(); + ADQLParser parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables)); try { // ORDER BY @@ -212,7 +209,7 @@ public class TestDBChecker { @Test public void testNumericOrStringValueExpressionPrimary() { - ADQLParser parser = parserFactory.createParser(); + ADQLParser parser = new ADQLParser(); try { assertNotNull(parser.parseQuery("SELECT 'toto' FROM foo;")); assertNotNull(parser.parseQuery("SELECT ('toto') FROM foo;")); @@ -266,7 +263,7 @@ public class TestDBChecker { @Test public void testUDFManagement() { // UNKNOWN FUNCTIONS ARE NOT ALLOWED: - ADQLParser parser = parserFactory.createParser(); + ADQLParser parser = new ADQLParser(); parser.getSupportedFeatures().allowAnyUdf(true); parser.setQueryChecker(new DBChecker(tables, new ArrayList<FunctionDef>(0))); @@ -293,7 +290,7 @@ public class TestDBChecker { FunctionDef[] udfs; try { udfs = new FunctionDef[]{ new FunctionDef("toto", new DBType(DBDatatype.VARCHAR)), new FunctionDef("tata", new DBType(DBDatatype.INTEGER)) }; - parser = parserFactory.createParser(); + parser = new ADQLParser(); parser.getSupportedFeatures().allowAnyUdf(true); parser.setQueryChecker(new DBChecker(tables, Arrays.asList(udfs))); } catch(ParseException pe) { @@ -349,7 +346,7 @@ public class TestDBChecker { try { udfs = new FunctionDef[]{ new FunctionDef("toto", new DBType(DBDatatype.VARCHAR), new FunctionParam[]{ new FunctionParam("txt", new DBType(DBDatatype.VARCHAR)) }) }; udfs[0].setUDFClass(UDFToto.class); - parser = parserFactory.createParser(); + parser = new ADQLParser(); parser.getSupportedFeatures().allowAnyUdf(true); parser.setQueryChecker(new DBChecker(tables, Arrays.asList(udfs))); } catch(ParseException pe) { @@ -389,7 +386,7 @@ public class TestDBChecker { try { udfs = new FunctionDef[]{ new FunctionDef("toto", new DBType(DBDatatype.VARCHAR), new FunctionParam[]{ new FunctionParam("txt", new DBType(DBDatatype.VARCHAR)) }) }; udfs[0].setUDFClass(WrongUDFToto.class); - parser = parserFactory.createParser(); + parser = new ADQLParser(); parser.getSupportedFeatures().allowAnyUdf(true); parser.setQueryChecker(new DBChecker(tables, Arrays.asList(udfs))); } catch(ParseException pe) { @@ -411,7 +408,7 @@ public class TestDBChecker { @Test public void testGeometry() { // DECLARE A SIMPLE PARSER where all geometries are allowed by default: - ADQLParser parser = parserFactory.createParser(); + ADQLParser parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables)); // Test with several geometries while all are allowed: @@ -424,7 +421,7 @@ public class TestDBChecker { // Test with several geometries while only the allowed ones: try { - parser = parserFactory.createParser(); + parser = new ADQLParser(); parser.getSupportedFeatures().unsupportAll(LanguageFeature.TYPE_ADQL_GEO); parser.getSupportedFeatures().support(ContainsFunction.FEATURE); parser.getSupportedFeatures().support(PointFunction.FEATURE); @@ -447,7 +444,7 @@ public class TestDBChecker { // Test by adding REGION: try { - parser = parserFactory.createParser(); + parser = new ADQLParser(); parser.getSupportedFeatures().unsupportAll(LanguageFeature.TYPE_ADQL_GEO); parser.getSupportedFeatures().support(ContainsFunction.FEATURE); parser.getSupportedFeatures().support(PointFunction.FEATURE); @@ -472,7 +469,7 @@ public class TestDBChecker { // Test with several geometries while none geometry is allowed: try { - parser = parserFactory.createParser(); + parser = new ADQLParser(); parser.getSupportedFeatures().unsupportAll(LanguageFeature.TYPE_ADQL_GEO); parser.parseQuery("SELECT * FROM foo WHERE CONTAINS(POINT('', 12.3, 45.6), CIRCLE('', 1.2, 2.3, 5)) = 1;"); @@ -491,7 +488,7 @@ public class TestDBChecker { @Test public void testCoordSys() { // DECLARE A SIMPLE PARSER where all coordinate systems are allowed by default: - ADQLParser parser = parserFactory.createParser(); + ADQLParser parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables)); // Test with several coordinate systems while all are allowed: @@ -517,7 +514,7 @@ public class TestDBChecker { // Test with several coordinate systems while only some allowed: try { - parser = parserFactory.createParser(); + parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables, new ArrayList<FunctionDef>(0), null, Arrays.asList(new String[]{ "icrs * *", "fk4 geocenter *", "galactic * spherical2" }))); assertNotNull(parser.parseQuery("SELECT * FROM foo WHERE CONTAINS(POINT('', 12.3, 45.6), CIRCLE('', 1.2, 2.3, 5)) = 1;")); assertNotNull(parser.parseQuery("SELECT * FROM foo WHERE CONTAINS(POINT('icrs', 12.3, 45.6), CIRCLE('cartesian3', 1.2, 2.3, 5)) = 1;")); @@ -552,7 +549,7 @@ public class TestDBChecker { // Test with a coordinate system while none is allowed: try { - parser = parserFactory.createParser(); + parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables, new ArrayList<FunctionDef>(0), null, new ArrayList<String>(0))); assertNotNull(parser.parseQuery("SELECT * FROM foo WHERE CONTAINS(POINT('', 12.3, 45.6), CIRCLE('', 1.2, 2.3, 5)) = 1;")); assertNotNull(parser.parseQuery("SELECT * FROM foo WHERE CONTAINS(REGION('position 12.3 45.6'), REGION('circle 1.2 2.3 5')) = 1;")); @@ -586,7 +583,7 @@ public class TestDBChecker { @Test public void testTypesChecking() { // DECLARE A SIMPLE PARSER: - ADQLParser parser = parserFactory.createParser(); + ADQLParser parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables)); // Test the type of columns generated by the parser: @@ -694,7 +691,7 @@ public class TestDBChecker { FunctionDef[] udfs; try { udfs = new FunctionDef[]{ new FunctionDef("toto", new DBType(DBDatatype.VARCHAR)), new FunctionDef("tata", new DBType(DBDatatype.INTEGER)), new FunctionDef("titi", new DBType(DBDatatype.REGION)) }; - parser = parserFactory.createParser(); + parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables, Arrays.asList(udfs))); } catch(ParseException pe) { pe.printStackTrace(); @@ -811,7 +808,7 @@ public class TestDBChecker { complexFcts[0] = new FunctionDef("fct1", new DBType(DBDatatype.VARCHAR), new FunctionParam[]{ new FunctionParam("str", new DBType(DBDatatype.VARCHAR)), new FunctionParam("num", new DBType(DBDatatype.INTEGER)) }); complexFcts[1] = new FunctionDef("fct2", new DBType(DBDatatype.INTEGER), new FunctionParam[]{ new FunctionParam("str", new DBType(DBDatatype.VARCHAR)) }); complexFcts[2] = new FunctionDef("fct3", new DBType(DBDatatype.VARCHAR), new FunctionParam[]{ new FunctionParam("str", new DBType(DBDatatype.VARCHAR)) }); - parser = parserFactory.createParser(); + parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables, Arrays.asList(complexFcts))); } catch(ParseException pe) { pe.printStackTrace(); @@ -837,7 +834,7 @@ public class TestDBChecker { } // CLEAR ALL UDFs AND ALLOW UNKNOWN FUNCTION: - parser = parserFactory.createParser(); + parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables, null)); // Test again: @@ -863,7 +860,7 @@ public class TestDBChecker { // DECLARE THE UDF (while unknown functions are allowed): try { - parser = parserFactory.createParser(); + parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables, Arrays.asList(new FunctionDef[]{ new FunctionDef("toto", new DBType(DBDatatype.VARCHAR)) }))); } catch(ParseException pe) { pe.printStackTrace(); @@ -886,7 +883,7 @@ public class TestDBChecker { // DECLARE UDFs WITH SAME NAMES BUT DIFFERENT TYPE OF ARGUMENT: try { udfs = new FunctionDef[]{ new FunctionDef("toto", new DBType(DBDatatype.VARCHAR), new FunctionParam[]{ new FunctionParam("attr", new DBType(DBDatatype.VARCHAR)) }), new FunctionDef("toto", new DBType(DBDatatype.INTEGER), new FunctionParam[]{ new FunctionParam("attr", new DBType(DBDatatype.INTEGER)) }), new FunctionDef("toto", new DBType(DBDatatype.INTEGER), new FunctionParam[]{ new FunctionParam("attr", new DBType(DBDatatype.POINT)) }) }; - parser = parserFactory.createParser(); + parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables, Arrays.asList(udfs))); } catch(ParseException pe) { pe.printStackTrace(); diff --git a/test/adql/db/TestFunctionDef.java b/test/adql/db/TestFunctionDef.java index e0fe91b79024ee7c6f41edbdbd5d549d96211fcf..571d7c3a51e6d5944d370bb5cb1912c5ca7b7317 100644 --- a/test/adql/db/TestFunctionDef.java +++ b/test/adql/db/TestFunctionDef.java @@ -11,9 +11,9 @@ import org.junit.Test; import adql.db.DBType.DBDatatype; import adql.db.FunctionDef.FunctionParam; -import adql.parser.ADQLParserFactory; -import adql.parser.ADQLParserFactory.ADQLVersion; -import adql.parser.ParseException; +import adql.parser.ADQLParser; +import adql.parser.ADQLParser.ADQLVersion; +import adql.parser.grammar.ParseException; import adql.query.operand.ADQLColumn; import adql.query.operand.ADQLOperand; import adql.query.operand.NumericConstant; @@ -501,7 +501,7 @@ public class TestFunctionDef { fail("LOWER is supposed to be a reserved keyword!"); } catch(Exception e) { assertEquals(ParseException.class, e.getClass()); - switch(ADQLParserFactory.DEFAULT_VERSION) { + switch(ADQLParser.DEFAULT_VERSION) { case V2_0: assertEquals(MSG_LOWER_2_0, e.getMessage()); break; diff --git a/test/adql/db/TestSTCS.java b/test/adql/db/TestSTCS.java index e9c25f72e8f9990623a4ba7b081ccf2386619bc5..5f39a2e89c2520dc4d0c975cd14416d8785fbb94 100644 --- a/test/adql/db/TestSTCS.java +++ b/test/adql/db/TestSTCS.java @@ -6,8 +6,6 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import java.io.StringBufferInputStream; - import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -21,8 +19,7 @@ import adql.db.STCS.RefPos; import adql.db.STCS.Region; import adql.db.STCS.RegionType; import adql.parser.ADQLParser; -import adql.parser.ADQLParserFactory; -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; import adql.query.operand.ADQLColumn; import adql.query.operand.ADQLOperand; import adql.query.operand.NegativeOperand; @@ -268,9 +265,8 @@ public class TestSTCS { assertEquals("Unknown STC region type: \"MYREGION\"!", e.getMessage()); } try { - ADQLParser parser = ADQLParserFactory.createDefaultParser(); - parser.ReInit(new StringBufferInputStream("'POSITION ' || coordinateSys || ' ' || ra || ' ' || dec")); - new Region(new RegionFunction(parser.StringExpression())); + ADQLOperand concat = (new ADQLParser()).parseSelect("SELECT 'POSITION ' || coordinateSys || ' ' || ra || ' ' || dec").get(0).getOperand(); + new Region(new RegionFunction(concat)); fail("String concatenation can not be managed!"); } catch(Exception e) { assertTrue(e instanceof ParseException); diff --git a/test/adql/db/TestSubQueries.java b/test/adql/db/TestSubQueries.java index e6f675e0e2822acad88f3e8674c9baec9a3d294b..afc58cbb996fa393d730ab643fb9090eb661d08c 100644 --- a/test/adql/db/TestSubQueries.java +++ b/test/adql/db/TestSubQueries.java @@ -11,7 +11,6 @@ import org.junit.Before; import org.junit.Test; import adql.parser.ADQLParser; -import adql.parser.ADQLParserFactory; import adql.query.ADQLQuery; import adql.translator.PostgreSQLTranslator; import tap.metadata.TAPMetadata; @@ -20,8 +19,6 @@ import tap.metadata.TableSetParser; public class TestSubQueries { - ADQLParserFactory adqlParserFactory = new ADQLParserFactory(); - @Before public void setUp() throws Exception { } @@ -36,7 +33,7 @@ public class TestSubQueries { while(itTables.hasNext()) esaTables.add(itTables.next()); - ADQLParser adqlParser = adqlParserFactory.createParser(); + ADQLParser adqlParser = new ADQLParser(); adqlParser.setQueryChecker(new DBChecker(esaTables)); ADQLQuery query = adqlParser.parseQuery("SELECT sel2.*,t1.h_m, t1.j_m, t1.k_m\nFROM (\n SELECT sel1.*, t3.*\n FROM (\n SELECT *\n FROM table2 AS t2\n WHERE 1=CONTAINS(POINT('ICRS', t2.ra, t2.dec), CIRCLE('ICRS', 56.75, 24.1167, 15.))\n ) AS sel1 JOIN table3 AS t3 ON t3.oid2=sel1.oid2\n) AS sel2 JOIN table1 AS t1 ON sel2.oid=t1.oid"); assertEquals("SELECT sel2.* , t1.h_m , t1.j_m , t1.k_m\nFROM (SELECT sel1.* , t3.*\nFROM (SELECT *\nFROM table2 AS t2\nWHERE 1 = CONTAINS(POINT('ICRS', t2.ra, t2.dec), CIRCLE('ICRS', 56.75, 24.1167, 15.))) AS sel1 INNER JOIN table3 AS t3 ON ON t3.oid2 = sel1.oid2) AS sel2 INNER JOIN table1 AS t1 ON ON sel2.oid = t1.oid", query.toADQL()); @@ -57,7 +54,7 @@ public class TestSubQueries { while(itTables.hasNext()) esaTables.add(itTables.next()); - ADQLParser adqlParser = adqlParserFactory.createParser(); + ADQLParser adqlParser = new ADQLParser(); adqlParser.setQueryChecker(new DBChecker(esaTables)); ADQLQuery query = adqlParser.parseQuery("SELECT oid FROM table1 as MyAlias WHERE oid IN (SELECT oid2 FROM table2 WHERE oid2 = myAlias.oid)"); @@ -78,7 +75,7 @@ public class TestSubQueries { while(itTables.hasNext()) esaTables.add(itTables.next()); - ADQLParser adqlParser = adqlParserFactory.createParser(); + ADQLParser adqlParser = new ADQLParser(); adqlParser.setQueryChecker(new DBChecker(esaTables)); ADQLQuery query = adqlParser.parseQuery("SELECT t.* FROM (SELECT (ra+ra_error) AS x, (dec+dec_error) AS Y, pmra AS \"ProperMotion\" FROM table2) AS t"); diff --git a/test/adql/parser/TestADQLParser.java b/test/adql/parser/TestADQLParser.java index 1e6893cf6d68e5fa945b5c4457283ad6be3d3330..423b9c3fd30b8832014207a1645b38b3d047896c 100644 --- a/test/adql/parser/TestADQLParser.java +++ b/test/adql/parser/TestADQLParser.java @@ -13,8 +13,11 @@ import org.junit.Test; import adql.db.exception.UnresolvedIdentifiersException; import adql.db.exception.UnsupportedFeatureException; -import adql.parser.ADQLParserFactory.ADQLVersion; +import adql.parser.ADQLParser.ADQLVersion; import adql.parser.feature.LanguageFeature; +import adql.parser.grammar.ADQLGrammar200Constants; +import adql.parser.grammar.ParseException; +import adql.parser.grammar.Token; import adql.query.ADQLQuery; import adql.query.from.ADQLJoin; import adql.query.from.ADQLTable; @@ -24,8 +27,6 @@ import adql.query.operand.function.string.LowerFunction; public class TestADQLParser { - ADQLParserFactory parserFactory = new ADQLParserFactory(); - @BeforeClass public static void setUpBeforeClass() throws Exception { } @@ -43,9 +44,9 @@ public class TestADQLParser { } @Test - public void testColumnReference(){ - ADQLParser parser = parserFactory.createParser(); - try{ + public void testColumnReference() { + ADQLParser parser = new ADQLParser(); + try { // ORDER BY parser.parseQuery("SELECT * FROM cat ORDER BY oid;"); parser.parseQuery("SELECT * FROM cat ORDER BY oid ASC;"); @@ -110,9 +111,9 @@ public class TestADQLParser { } @Test - public void testDelimitedIdentifiersWithDot(){ - ADQLParser parser = parserFactory.createParser(); - try{ + public void testDelimitedIdentifiersWithDot() { + ADQLParser parser = new ADQLParser(); + try { ADQLQuery query = parser.parseQuery("SELECT * FROM \"B/avo.rad/catalog\";"); assertEquals("B/avo.rad/catalog", query.getFrom().getTables().get(0).getTableName()); } catch(Exception e) { @@ -122,9 +123,9 @@ public class TestADQLParser { } @Test - public void testJoinTree(){ - ADQLParser parser = parserFactory.createParser(); - try{ + public void testJoinTree() { + ADQLParser parser = new ADQLParser(); + try { String[] queries = new String[]{ "SELECT * FROM aTable A JOIN aSecondTable B ON A.id = B.id JOIN aThirdTable C ON B.id = C.id;", "SELECT * FROM aTable A NATURAL JOIN aSecondTable B NATURAL JOIN aThirdTable C;" }; for(String q : queries) { ADQLQuery query = parser.parseQuery(q); @@ -149,9 +150,9 @@ public class TestADQLParser { } @Test - public void test(){ - ADQLParser parser = parserFactory.createParser(); - try{ + public void test() { + ADQLParser parser = new ADQLParser(); + try { ADQLQuery query = parser.parseQuery("SELECT 'truc''machin' 'bidule' --- why not a comment now ^^\n'FIN' FROM foo;"); assertNotNull(query); assertEquals("truc'machinbiduleFIN", ((StringConstant)(query.getSelect().get(0).getOperand())).getValue()); @@ -174,37 +175,37 @@ public class TestADQLParser { public void testIncorrectCharacter() { /* An identifier must be written only with digits, an underscore or * regular latin characters: */ - try{ - (parserFactory.createParser()).parseQuery("select gr\u00e9gory FROM aTable"); - }catch(Throwable t){ + try { + (new ADQLParser()).parseQuery("select gr\u00e9gory FROM aTable"); + } catch(Throwable t) { assertEquals(ParseException.class, t.getClass()); assertTrue(t.getMessage().startsWith("Incorrect character encountered at l.1, c.10: ")); assertTrue(t.getMessage().endsWith("Possible cause: a non-ASCI/UTF-8 character (solution: remove/replace it).")); } /* Un-finished double/single quoted string: */ - try{ - (parserFactory.createParser()).parseQuery("select \"stuff FROM aTable"); - }catch(Throwable t){ + try { + (new ADQLParser()).parseQuery("select \"stuff FROM aTable"); + } catch(Throwable t) { assertEquals(ParseException.class, t.getClass()); assertTrue(t.getMessage().startsWith("Incorrect character encountered at l.1, c.26: <EOF>")); assertTrue(t.getMessage().endsWith("Possible cause: a string between single or double quotes which is never closed (solution: well...just close it!).")); } // But in a string, delimited identifier or a comment, it is fine: - try{ - (parserFactory.createParser()).parseQuery("select 'gr\u00e9gory' FROM aTable"); - (parserFactory.createParser()).parseQuery("select \"gr\u00e9gory\" FROM aTable"); - (parserFactory.createParser()).parseQuery("select * FROM aTable -- a comment by Gr\u00e9gory"); - }catch(Throwable t){ + try { + (new ADQLParser()).parseQuery("select 'gr\u00e9gory' FROM aTable"); + (new ADQLParser()).parseQuery("select \"gr\u00e9gory\" FROM aTable"); + (new ADQLParser()).parseQuery("select * FROM aTable -- a comment by Gr\u00e9gory"); + } catch(Throwable t) { fail("This error should never occurs because all these queries have an accentuated character but at a correct place."); } } @Test - public void testMultipleSpacesInOrderAndGroupBy(){ - try{ - ADQLParser parser = parserFactory.createParser(); + public void testMultipleSpacesInOrderAndGroupBy() { + try { + ADQLParser parser = new ADQLParser(); // Single space: parser.parseQuery("select * from aTable ORDER BY aCol"); @@ -229,8 +230,8 @@ public class TestADQLParser { } @Test - public void testADQLReservedWord(){ - ADQLParser parser = parserFactory.createParser(); + public void testADQLReservedWord() { + ADQLParser parser = new ADQLParser(); final String hintAbs = ".*\n\\(HINT: \"abs\" is a reserved ADQL word in v[0-9]+\\.[0-9]+\\. To use it as a column/table/schema name/alias, write it between double quotes\\.\\)"; final String hintPoint = ".*\n\\(HINT: \"point\" is a reserved ADQL word in v[0-9]+\\.[0-9]+\\. To use it as a column/table/schema name/alias, write it between double quotes\\.\\)"; @@ -307,8 +308,8 @@ public class TestADQLParser { } @Test - public void testSQLReservedWord(){ - ADQLParser parser = parserFactory.createParser(); + public void testSQLReservedWord() { + ADQLParser parser = new ADQLParser(); try { parser.parseQuery("SELECT rows FROM aTable"); @@ -328,8 +329,8 @@ public class TestADQLParser { } @Test - public void testUDFName(){ - ADQLParser parser = parserFactory.createParser(); + public void testUDFName() { + ADQLParser parser = new ADQLParser(); // TODO [ADQL-2.1] Add the support for this specific UDF in the the FeatureSet! // CASE: Valid UDF name => OK @@ -353,47 +354,9 @@ public class TestADQLParser { } } - @Test - public void testTryQuickFix(){ - ADQLParser parser = parserFactory.createParser(); - - try { - /* CASE: Nothing to fix => exactly the same as provided */ - // raw ASCII query with perfectly regular ADQL identifiers: - assertEquals("SELECT foo, bar FROM aTable", parser.tryQuickFix("SELECT foo, bar FROM aTable")); - // same with \n, \r and \t (replaced by 4 spaces): - assertEquals("SELECT foo," + System.getProperty("line.separator") + " bar" + System.getProperty("line.separator") + "FROM aTable", parser.tryQuickFix("SELECT foo,\r\n\tbar\nFROM aTable")); - // still ASCII query with delimited identifiers and ADQL functions: - assertEquals("SELECT \"foo\"," + System.getProperty("line.separator") + " \"_bar\", AVG(col1)" + System.getProperty("line.separator") + "FROM \"public\".aTable", parser.tryQuickFix("SELECT \"foo\",\r\n\t\"_bar\", AVG(col1)\nFROM \"public\".aTable")); - - /* CASE: Unicode confusable characters => replace by their ASCII alternative */ - assertEquals("SELECT \"_bar\" FROM aTable", parser.tryQuickFix("SELECT \"\uFE4Dbar\" FROM aTable")); - - /* CASE: incorrect regular identifier */ - assertEquals("SELECT \"_bar\" FROM aTable", parser.tryQuickFix("SELECT _bar FROM aTable")); - assertEquals("SELECT \"_bar\" FROM aTable", parser.tryQuickFix("SELECT \uFE4Dbar FROM aTable")); - assertEquals("SELECT \"2mass_id\" FROM aTable", parser.tryQuickFix("SELECT 2mass_id FROM aTable")); - assertEquals("SELECT \"col?\" FROM aTable", parser.tryQuickFix("SELECT col? FROM aTable")); - assertEquals("SELECT \"col[2]\" FROM aTable", parser.tryQuickFix("SELECT col[2] FROM aTable")); - - /* CASE: SQL reserved keyword */ - assertEquals("SELECT \"date\", \"year\", \"user\" FROM \"public\".aTable", parser.tryQuickFix("SELECT date, year, user FROM public.aTable")); - - /* CASE: ADQL function name without parameters list */ - assertEquals("SELECT \"count\", \"distance\" FROM \"schema\".aTable", parser.tryQuickFix("SELECT count, distance FROM schema.aTable")); - - /* CASE: a nice combination of everything (with comments at beginning, middle and end) */ - assertEquals("-- begin comment" + System.getProperty("line.separator") + "SELECT id, \"_raj2000\", \"distance\", (\"date\")," + System.getProperty("line.separator") + " \"min\",min(mag), \"_dej2000\" -- in-between commment" + System.getProperty("line.separator") + "FROM \"public\".mytable -- end comment", parser.tryQuickFix("-- begin comment\r\nSELECT id, \uFE4Draj2000, distance, (date),\r\tmin,min(mag), \"_dej2000\" -- in-between commment\nFROM public.mytable -- end comment")); - - } catch(ParseException pe) { - pe.printStackTrace(); - fail("Unexpected parsing error! This query should have passed. (see console for more details)"); - } - } - @Test public void testOptionalFeatures() { - ADQLParser parser = parserFactory.createParser(ADQLVersion.V2_0); + ADQLParser parser = new ADQLParser(ADQLVersion.V2_0); // CASE: No support for the ADQL-2.1 function - LOWER => ERROR try { @@ -405,7 +368,7 @@ public class TestADQLParser { } // CASE: LOWER supported by default in ADQL-2.1 => OK - parser = parserFactory.createParser(ADQLVersion.V2_1); + parser = new ADQLParser(ADQLVersion.V2_1); try { ADQLQuery q = parser.parseQuery("SELECT LOWER(foo) FROM aTable"); assertNotNull(q); @@ -433,7 +396,7 @@ public class TestADQLParser { /* NOTE: Geometrical functions are the only optional features in 2.0 */ /* ***************************************************************** */ - parser = parserFactory.createParser(ADQLVersion.V2_0); + parser = new ADQLParser(ADQLVersion.V2_0); // CASE: By default all geometries are supported so if one is used => OK try { @@ -469,4 +432,66 @@ public class TestADQLParser { } } + @Test + public void testTokenize() { + ADQLParser parser = new ADQLParser(ADQLVersion.V2_0); + + final String[] EMPTY_STRINGS = new String[]{ null, "", " ", " " }; + + // TEST: NULL or empty string with end at EOF => only one token=EOF + try { + for(String str : EMPTY_STRINGS) { + Token[] tokens = parser.tokenize(str, false); + assertEquals(1, tokens.length); + assertEquals(ADQLGrammar200Constants.EOF, tokens[0].kind); + } + } catch(Exception e) { + e.printStackTrace(); + fail("Unexpected error when providing a NULL or empty string to tokenize! (see console for more details)"); + } + + // TEST: NULL or empty string with truncation at EOQ/EOF => empty array + try { + for(String str : EMPTY_STRINGS) + assertEquals(0, parser.tokenize(str, true).length); + } catch(Exception e) { + e.printStackTrace(); + fail("Unexpected error when providing a NULL or empty string to tokenize! (see console for more details)"); + } + + // TEST: unknown token => ParseException + try { + parser.tokenize("grégory", false); + fail("No known token is provided. A ParseException was expected."); + } catch(Exception ex) { + assertEquals(ParseException.class, ex.getClass()); + assertEquals("Incorrect character encountered at l.1, c.3: \"\\u00e9\" ('é'), after : \"\"! Possible cause: a non-ASCI/UTF-8 character (solution: remove/replace it).", ex.getMessage()); + } + + // TEST: correct list of token => ok + final String TEST_STR = "SELECT FROM Where foo; join"; + try { + Token[] tokens = parser.tokenize(TEST_STR, false); + assertEquals(7, tokens.length); + int[] expected = new int[]{ ADQLGrammar200Constants.SELECT, ADQLGrammar200Constants.FROM, ADQLGrammar200Constants.WHERE, ADQLGrammar200Constants.REGULAR_IDENTIFIER_CANDIDATE, ADQLGrammar200Constants.EOQ, ADQLGrammar200Constants.JOIN, ADQLGrammar200Constants.EOF }; + for(int i = 0; i < tokens.length; i++) + assertEquals(expected[i], tokens[i].kind); + } catch(Exception ex) { + ex.printStackTrace(); + fail("Unexpected error! All ADQL expressions were composed of correct tokens. (see console for more details)"); + } + + // TEST: same with truncation at EOQ/EOF => same but truncated from EOQ + try { + Token[] tokens = parser.tokenize(TEST_STR, true); + assertEquals(4, tokens.length); + int[] expected = new int[]{ ADQLGrammar200Constants.SELECT, ADQLGrammar200Constants.FROM, ADQLGrammar200Constants.WHERE, ADQLGrammar200Constants.REGULAR_IDENTIFIER_CANDIDATE }; + for(int i = 0; i < tokens.length; i++) + assertEquals(expected[i], tokens[i].kind); + } catch(Exception ex) { + ex.printStackTrace(); + fail("Unexpected error! All ADQL expressions were composed of correct tokens. (see console for more details)"); + } + } + } diff --git a/test/adql/parser/TestADQLVersion.java b/test/adql/parser/TestADQLVersion.java new file mode 100644 index 0000000000000000000000000000000000000000..d6f22b2e44ba6d3d32f077bf50820155a53533b6 --- /dev/null +++ b/test/adql/parser/TestADQLVersion.java @@ -0,0 +1,45 @@ +package adql.parser; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import org.junit.Test; + +import adql.parser.ADQLParser.ADQLVersion; + +public class TestADQLVersion { + + @Test + public void testToString() { + assertEquals("v2.0", ADQLVersion.V2_0.toString()); + assertEquals("v2.1", ADQLVersion.V2_1.toString()); + } + + @Test + public void testParse() { + // TEST: NULL or empty strings => NULL + String[] strings = new String[]{ null, "", " ", " " }; + for(String str : strings) + assertNull(ADQLVersion.parse(str)); + + // TEST: unknown version => NULL + strings = new String[]{ "foo", "v0.1", "V1.0" }; + for(String str : strings) + assertNull(ADQLVersion.parse(str)); + + // TEST: Expected version strings => OK + assertEquals(ADQLVersion.V2_0, ADQLVersion.parse("2.0")); + assertEquals(ADQLVersion.V2_0, ADQLVersion.parse("2_0")); + assertEquals(ADQLVersion.V2_0, ADQLVersion.parse("v2.0")); + assertEquals(ADQLVersion.V2_0, ADQLVersion.parse("V2.0")); + assertEquals(ADQLVersion.V2_0, ADQLVersion.parse("v2_0")); + assertEquals(ADQLVersion.V2_0, ADQLVersion.parse("V2_0")); + + // TEST: it MUST work with all available versions + for(ADQLVersion v : ADQLVersion.values()) { + assertEquals(v, ADQLVersion.parse(v.name())); + assertEquals(v, ADQLVersion.parse(v.toString())); + } + } + +} diff --git a/test/adql/parser/TestIdentifierItem.java b/test/adql/parser/TestIdentifierItem.java index 46e0bf9c216269bf23eb5a04f8436f3cd0bf3745..84627a75495e8f59ddf4ba82dca07f8bba9596ed 100644 --- a/test/adql/parser/TestIdentifierItem.java +++ b/test/adql/parser/TestIdentifierItem.java @@ -1,7 +1,7 @@ package adql.parser; -import static adql.parser.ADQLParser201Constants.DELIMITED_IDENTIFIER; -import static adql.parser.ADQLParser201Constants.REGULAR_IDENTIFIER_CANDIDATE; +import static adql.parser.grammar.ADQLGrammar201Constants.DELIMITED_IDENTIFIER; +import static adql.parser.grammar.ADQLGrammar201Constants.REGULAR_IDENTIFIER_CANDIDATE; import static org.junit.Assert.assertEquals; import org.junit.Before; @@ -9,19 +9,20 @@ import org.junit.BeforeClass; import org.junit.Test; import adql.parser.IdentifierItems.IdentifierItem; +import adql.parser.grammar.Token; public class TestIdentifierItem { @BeforeClass - public static void setUpBeforeClass() throws Exception{ + public static void setUpBeforeClass() throws Exception { } @Before - public void setUp() throws Exception{ + public void setUp() throws Exception { } @Test - public void testIdentifierItem(){ + public void testIdentifierItem() { /* A regular identifier (with no special characters) should be returned * as provided: */ IdentifierItem identifier = new IdentifierItem(new Token(REGULAR_IDENTIFIER_CANDIDATE, "m50"), false); diff --git a/test/adql/parser/TestQuickFixer.java b/test/adql/parser/TestQuickFixer.java new file mode 100644 index 0000000000000000000000000000000000000000..8549eb5302da0c07562fb69ea265434bb838611d --- /dev/null +++ b/test/adql/parser/TestQuickFixer.java @@ -0,0 +1,51 @@ +package adql.parser; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import org.junit.Test; + +import adql.parser.grammar.ParseException; + +public class TestQuickFixer { + + @Test + public void testFix() { + final ADQLParser parser = new ADQLParser(); + QueryFixer fixer = parser.getQuickFixer(); + + try { + /* CASE: Nothing to fix => exactly the same as provided */ + // raw ASCII query with perfectly regular ADQL identifiers: + assertEquals("SELECT foo, bar FROM aTable", fixer.fix("SELECT foo, bar FROM aTable")); + // same with \n, \r and \t (replaced by 4 spaces): + assertEquals("SELECT foo," + System.getProperty("line.separator") + " bar" + System.getProperty("line.separator") + "FROM aTable", fixer.fix("SELECT foo,\r\n\tbar\nFROM aTable")); + // still ASCII query with delimited identifiers and ADQL functions: + assertEquals("SELECT \"foo\"," + System.getProperty("line.separator") + " \"_bar\", AVG(col1)" + System.getProperty("line.separator") + "FROM \"public\".aTable", fixer.fix("SELECT \"foo\",\r\n\t\"_bar\", AVG(col1)\nFROM \"public\".aTable")); + + /* CASE: Unicode confusable characters => replace by their ASCII alternative */ + assertEquals("SELECT \"_bar\" FROM aTable", fixer.fix("SELECT \"\uFE4Dbar\" FROM aTable")); + + /* CASE: incorrect regular identifier */ + assertEquals("SELECT \"_bar\" FROM aTable", fixer.fix("SELECT _bar FROM aTable")); + assertEquals("SELECT \"_bar\" FROM aTable", fixer.fix("SELECT \uFE4Dbar FROM aTable")); + assertEquals("SELECT \"2mass_id\" FROM aTable", fixer.fix("SELECT 2mass_id FROM aTable")); + assertEquals("SELECT \"col?\" FROM aTable", fixer.fix("SELECT col? FROM aTable")); + assertEquals("SELECT \"col[2]\" FROM aTable", fixer.fix("SELECT col[2] FROM aTable")); + + /* CASE: SQL reserved keyword */ + assertEquals("SELECT \"date\", \"year\", \"user\" FROM \"public\".aTable", fixer.fix("SELECT date, year, user FROM public.aTable")); + + /* CASE: ADQL function name without parameters list */ + assertEquals("SELECT \"count\", \"distance\" FROM \"schema\".aTable", fixer.fix("SELECT count, distance FROM schema.aTable")); + + /* CASE: a nice combination of everything (with comments at beginning, middle and end) */ + assertEquals("-- begin comment" + System.getProperty("line.separator") + "SELECT id, \"_raj2000\", \"distance\", (\"date\")," + System.getProperty("line.separator") + " \"min\",min(mag), \"_dej2000\" -- in-between commment" + System.getProperty("line.separator") + "FROM \"public\".mytable -- end comment", fixer.fix("-- begin comment\r\nSELECT id, \uFE4Draj2000, distance, (date),\r\tmin,min(mag), \"_dej2000\" -- in-between commment\nFROM public.mytable -- end comment")); + + } catch(ParseException pe) { + pe.printStackTrace(); + fail("Unexpected parsing error! This query should have passed. (see console for more details)"); + } + } + +} diff --git a/test/adql/parser/TestUnknownTypes.java b/test/adql/parser/TestUnknownTypes.java index c29f2565b2e50ede106d1029f70772ba682824f1..373e2609306e008615b0ed6eaaacab9db56c678e 100644 --- a/test/adql/parser/TestUnknownTypes.java +++ b/test/adql/parser/TestUnknownTypes.java @@ -28,8 +28,6 @@ import adql.query.ADQLQuery; public class TestUnknownTypes { - ADQLParserFactory parserFactory = new ADQLParserFactory(); - @BeforeClass public static void setUpBeforeClass() throws Exception { } @@ -81,7 +79,7 @@ public class TestUnknownTypes { try { // Create the parser: - ADQLParser parser = parserFactory.createParser(); + ADQLParser parser = new ADQLParser(); // Create table/column metadata: DefaultDBTable table1 = new DefaultDBTable("T1"); diff --git a/test/adql/parser/feature/TestFeatureSet.java b/test/adql/parser/feature/TestFeatureSet.java index 78e050a6fba9c7ebf5edabbb8dbcc56cff81eb7d..fa1d4c4db5ea2fa408b77a6a716a07672214985f 100644 --- a/test/adql/parser/feature/TestFeatureSet.java +++ b/test/adql/parser/feature/TestFeatureSet.java @@ -14,8 +14,8 @@ import org.junit.Test; import adql.db.DBType; import adql.db.DBType.DBDatatype; +import adql.parser.grammar.ParseException; import adql.db.FunctionDef; -import adql.parser.ParseException; import adql.query.ColumnReference; import adql.query.operand.function.geometry.BoxFunction; import adql.query.operand.function.geometry.PolygonFunction; diff --git a/test/adql/query/TestADQLObjectPosition.java b/test/adql/query/TestADQLObjectPosition.java index 8ec064d3bcf53686d2bdec0c6eaea0d372761f7b..133caf7cb603d3e460c9c3c2d5bcb2cdc7e38547 100644 --- a/test/adql/query/TestADQLObjectPosition.java +++ b/test/adql/query/TestADQLObjectPosition.java @@ -9,8 +9,8 @@ import java.util.List; import org.junit.Before; import org.junit.Test; -import adql.parser.ADQLParserFactory; -import adql.parser.ParseException; +import adql.parser.ADQLParser; +import adql.parser.grammar.ParseException; import adql.query.constraint.Comparison; import adql.query.from.ADQLJoin; import adql.query.from.ADQLTable; @@ -21,8 +21,6 @@ import adql.search.SimpleSearchHandler; public class TestADQLObjectPosition { - private ADQLParserFactory parserFactory = new ADQLParserFactory(); - @Before public void setUp() { @@ -31,7 +29,7 @@ public class TestADQLObjectPosition { @Test public void testPositionInAllClauses() { try { - ADQLQuery query = parserFactory.createParser().parseQuery("SELECT truc, bidule.machin, toto(truc, chose) AS \"super\" FROM foo JOIN bidule USING(id) WHERE truc > 12.5 AND bidule.machin < 5 GROUP BY chose HAVING try > 0 ORDER BY chouetteAlors"); + ADQLQuery query = new ADQLParser().parseQuery("SELECT truc, bidule.machin, toto(truc, chose) AS \"super\" FROM foo JOIN bidule USING(id) WHERE truc > 12.5 AND bidule.machin < 5 GROUP BY chose HAVING try > 0 ORDER BY chouetteAlors"); Iterator<ADQLObject> results = query.search(new SimpleSearchHandler(true) { @Override @@ -61,7 +59,7 @@ public class TestADQLObjectPosition { @Test public void testPositionAccuracy() { try { - ADQLQuery query = parserFactory.createParser().parseQuery("SELECT TOP 1000 oid FROM foo JOIN bar USING(oid)\nWHERE foo || toto = 'truc'\n AND 2 > 1+0 GROUP BY oid HAVING COUNT(oid) > 10\n\tORDER BY 1 DESC"); + ADQLQuery query = new ADQLParser().parseQuery("SELECT TOP 1000 oid FROM foo JOIN bar USING(oid)\nWHERE foo || toto = 'truc'\n AND 2 > 1+0 GROUP BY oid HAVING COUNT(oid) > 10\n\tORDER BY 1 DESC"); // Test SELECT assertEquality(new TextPosition(1, 1, 1, 20), query.getSelect().getPosition()); // Test ADQLColumn (here: "oid") diff --git a/test/adql/query/TestADQLQuery.java b/test/adql/query/TestADQLQuery.java index 6478cb1c29398c0ae5f150951f83049fdf74f243..6098767c8b04b53414bbe71e31cfe2dcf7030da8 100644 --- a/test/adql/query/TestADQLQuery.java +++ b/test/adql/query/TestADQLQuery.java @@ -13,8 +13,8 @@ import org.junit.Test; import adql.db.DBType; import adql.db.DBType.DBDatatype; +import adql.parser.grammar.ParseException; import adql.db.FunctionDef; -import adql.parser.ParseException; import adql.query.constraint.Comparison; import adql.query.constraint.ComparisonOperator; import adql.query.constraint.ConstraintsGroup; diff --git a/test/adql/search/TestSimpleReplaceHandler.java b/test/adql/search/TestSimpleReplaceHandler.java index 8495676d0a3fe9e2c0a9e950cb9a53fa636c4894..dfcfff59a9ccf07f2b18ca944f3b82894f3c17ba 100644 --- a/test/adql/search/TestSimpleReplaceHandler.java +++ b/test/adql/search/TestSimpleReplaceHandler.java @@ -6,7 +6,7 @@ import static org.junit.Assert.fail; import org.junit.Before; import org.junit.Test; -import adql.parser.ADQLParserFactory; +import adql.parser.ADQLParser; import adql.query.ADQLObject; import adql.query.ADQLQuery; import adql.query.operand.function.DefaultUDF; @@ -15,8 +15,6 @@ import adql.query.operand.function.MathFunctionType; public class TestSimpleReplaceHandler { - ADQLParserFactory parserFactory = new ADQLParserFactory(); - @Before public void setUp() throws Exception { } @@ -37,7 +35,7 @@ public class TestSimpleReplaceHandler { String testQuery = "SELECT SQRT(ABS(81)) FROM myTable"; try { // Parse the query: - ADQLQuery query = parserFactory.createParser().parseQuery(testQuery); + ADQLQuery query = new ADQLParser().parseQuery(testQuery); // Check it is as expected, before the replacements: assertEquals(testQuery, query.toADQL().replaceAll("\\n", " ")); @@ -85,7 +83,7 @@ public class TestSimpleReplaceHandler { String testQuery = "SELECT foo(bar(123)) FROM myTable"; try { // Parse the query: - ADQLQuery query = parserFactory.createParser().parseQuery(testQuery); + ADQLQuery query = new ADQLParser().parseQuery(testQuery); // Check it is as expected, before the replacements: assertEquals(testQuery, query.toADQL().replaceAll("\\n", " ")); diff --git a/test/adql/translator/TestJDBCTranslator.java b/test/adql/translator/TestJDBCTranslator.java index c83dc5641c0fed47bea954443a84bf05b2207d74..1df654f5a8f272eef7dc7e88fe536cbdd817edc5 100644 --- a/test/adql/translator/TestJDBCTranslator.java +++ b/test/adql/translator/TestJDBCTranslator.java @@ -9,7 +9,7 @@ import org.junit.Test; import adql.db.DBType; import adql.db.FunctionDef; import adql.db.STCS.Region; -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; import adql.query.IdentifierField; import adql.query.operand.ADQLColumn; import adql.query.operand.ADQLOperand; diff --git a/test/adql/translator/TestMySQLTranslator.java b/test/adql/translator/TestMySQLTranslator.java index 9c1327a90b8a70d79c042cc4c33e6bec758d08d7..cb794ceadd6c558b51de823611dc0f505312bd51 100644 --- a/test/adql/translator/TestMySQLTranslator.java +++ b/test/adql/translator/TestMySQLTranslator.java @@ -6,8 +6,7 @@ import static org.junit.Assert.fail; import org.junit.Test; import adql.parser.ADQLParser; -import adql.parser.ADQLParserFactory; -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; import adql.query.ADQLQuery; public class TestMySQLTranslator { @@ -15,7 +14,7 @@ public class TestMySQLTranslator { @Test public void testConcat() { try { - ADQLParser parser = ADQLParserFactory.createDefaultParser(); + ADQLParser parser = new ADQLParser(); MySQLTranslator translator = new MySQLTranslator(); // Test with an easy translation: diff --git a/test/adql/translator/TestPgSphereTranslator.java b/test/adql/translator/TestPgSphereTranslator.java index 2d09fc3dac48fe0a125d6dd005b4142807a56d1e..825f21ac086ee2ab6673a901abbd42f0e0f4f7e9 100644 --- a/test/adql/translator/TestPgSphereTranslator.java +++ b/test/adql/translator/TestPgSphereTranslator.java @@ -19,7 +19,7 @@ import org.postgresql.util.PGobject; import adql.db.DBType; import adql.db.DBType.DBDatatype; import adql.db.STCS.Region; -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; import adql.query.operand.NumericConstant; import adql.query.operand.StringConstant; import adql.query.operand.function.geometry.CentroidFunction; diff --git a/test/adql/translator/TestSQLServerTranslator.java b/test/adql/translator/TestSQLServerTranslator.java index f7001429bf5a0c3bbbad1ff4f865f587a196e40d..7a523eed7338dde0de1cdb46892114a8db8a94ca 100644 --- a/test/adql/translator/TestSQLServerTranslator.java +++ b/test/adql/translator/TestSQLServerTranslator.java @@ -14,15 +14,12 @@ import adql.db.DBTable; import adql.db.DefaultDBColumn; import adql.db.DefaultDBTable; import adql.parser.ADQLParser; -import adql.parser.ADQLParserFactory; -import adql.parser.ParseException; import adql.parser.SQLServer_ADQLQueryFactory; +import adql.parser.grammar.ParseException; import adql.query.ADQLQuery; public class TestSQLServerTranslator { - ADQLParserFactory parserFactory = new ADQLParserFactory(); - private List<DBTable> tables = null; @Before @@ -45,7 +42,7 @@ public class TestSQLServerTranslator { final String adqlquery = "SELECT id, name, aColumn, anotherColumn FROM aTable A NATURAL JOIN anotherTable B;"; try { - ADQLParser parser = parserFactory.createParser(); + ADQLParser parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables)); parser.setQueryFactory(new SQLServer_ADQLQueryFactory()); ADQLQuery query = parser.parseQuery(adqlquery); @@ -71,7 +68,7 @@ public class TestSQLServerTranslator { final String adqlquery = "SELECT B.id, name, aColumn, anotherColumn FROM aTable A JOIN anotherTable B USING(name);"; try { - ADQLParser parser = parserFactory.createParser(); + ADQLParser parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables)); parser.setQueryFactory(new SQLServer_ADQLQueryFactory()); ADQLQuery query = parser.parseQuery(adqlquery); @@ -97,7 +94,7 @@ public class TestSQLServerTranslator { try { SQLServerTranslator translator = new SQLServerTranslator(); - ADQLParser parser = parserFactory.createParser(); + ADQLParser parser = new ADQLParser(); parser.setQueryFactory(new SQLServer_ADQLQueryFactory()); // Test with an easy translation: diff --git a/test/tap/data/TestResultSetTableIterator.java b/test/tap/data/TestResultSetTableIterator.java index e2bbeda9606518b174555f8e758a1f882027cf03..9a20e2802c72e910fedfb73dc0e6593d3e6c53df 100644 --- a/test/tap/data/TestResultSetTableIterator.java +++ b/test/tap/data/TestResultSetTableIterator.java @@ -13,7 +13,7 @@ import org.junit.BeforeClass; import org.junit.Test; import adql.db.DBType; -import adql.parser.ADQLParserFactory; +import adql.parser.ADQLParser; import adql.query.ADQLQuery; import adql.translator.AstroH2Translator; import tap.db_testtools.DBTools; @@ -23,8 +23,6 @@ public class TestResultSetTableIterator { private static Connection conn; - ADQLParserFactory parserFactory = new ADQLParserFactory(); - @BeforeClass public static void setUpBeforeClass() throws Exception { DBTools.createTestDB(); @@ -182,7 +180,7 @@ public class TestResultSetTableIterator { public void testGeometryColumns() { ResultSet rs = null; try { - ADQLQuery query = (parserFactory.createParser()).parseQuery("SELECT TOP 1 POINT('', ra, dec), CENTROID(CIRCLE('', ra, dec, 2)), BOX('', ra-1, dec-2, ra+1, dec+2), CIRCLE('', ra, dec, 2) FROM hipparcos;"); + ADQLQuery query = (new ADQLParser()).parseQuery("SELECT TOP 1 POINT('', ra, dec), CENTROID(CIRCLE('', ra, dec, 2)), BOX('', ra-1, dec-2, ra+1, dec+2), CIRCLE('', ra, dec, 2) FROM hipparcos;"); // create a valid ResultSet: rs = DBTools.select(conn, (new AstroH2Translator()).translate(query)); @@ -220,7 +218,7 @@ public class TestResultSetTableIterator { public void testSQLFunctions() { ResultSet rs = null; try { - ADQLQuery query = (parserFactory.createParser()).parseQuery("SELECT COUNT(*), MIN(vmag), AVG(plx) FROM hipparcos;"); + ADQLQuery query = (new ADQLParser()).parseQuery("SELECT COUNT(*), MIN(vmag), AVG(plx) FROM hipparcos;"); // create a valid ResultSet: rs = DBTools.select(conn, (new AstroH2Translator()).translate(query)); diff --git a/test/tap/db/TestJDBCConnection.java b/test/tap/db/TestJDBCConnection.java index b2da3eb5f85598165251ca417d4a8ca1a23dc18d..0ac40f73f383b2b526baa485dc19440d5fd08ce6 100644 --- a/test/tap/db/TestJDBCConnection.java +++ b/test/tap/db/TestJDBCConnection.java @@ -28,8 +28,7 @@ import adql.db.DBTable; import adql.db.DBType; import adql.db.DBType.DBDatatype; import adql.parser.ADQLParser; -import adql.parser.ADQLParserFactory; -import adql.parser.ParseException; +import adql.parser.grammar.ParseException; import adql.query.ADQLQuery; import adql.query.IdentifierField; import adql.translator.AstroH2Translator; @@ -65,14 +64,19 @@ public class TestJDBCConnection { uploadExamplePath = "./test/tap/db/upload_example.vot"; - DBTools.createTestDB(); - h2Connection = DBTools.createConnection("h2", null, null, DBTools.DB_TEST_PATH, DBTools.DB_TEST_USER, DBTools.DB_TEST_PWD); - h2JDBCConnection = new JDBCConnection(h2Connection, new AstroH2Translator(false), "H2", null); - sensH2JDBCConnection = new JDBCConnection(h2Connection, new AstroH2Translator(true, true, true, true), "SensitiveH2", null); - - sqliteConnection = DBTools.createConnection("sqlite", null, null, sqliteDbFile, null, null); - sqliteJDBCConnection = new JDBCConnection(sqliteConnection, new PostgreSQLTranslator(false), "SQLITE", null); - sensSqliteJDBCConnection = new JDBCConnection(sqliteConnection, new PostgreSQLTranslator(true), "SensitiveSQLite", null); + try { + DBTools.createTestDB(); + h2Connection = DBTools.createConnection("h2", null, null, DBTools.DB_TEST_PATH, DBTools.DB_TEST_USER, DBTools.DB_TEST_PWD); + h2JDBCConnection = new JDBCConnection(h2Connection, new AstroH2Translator(false), "H2", null); + sensH2JDBCConnection = new JDBCConnection(h2Connection, new AstroH2Translator(true, true, true, true), "SensitiveH2", null); + + sqliteConnection = DBTools.createConnection("sqlite", null, null, sqliteDbFile, null, null); + sqliteJDBCConnection = new JDBCConnection(sqliteConnection, new PostgreSQLTranslator(false), "SQLITE", null); + sensSqliteJDBCConnection = new JDBCConnection(sqliteConnection, new PostgreSQLTranslator(true), "SensitiveSQLite", null); + } catch(Throwable t) { + t.printStackTrace(); + fail(t.getMessage()); + } } @AfterClass @@ -524,7 +528,7 @@ public class TestJDBCConnection { for(TAPTable t : schema) tables.add(t); - ADQLParser parser = (new ADQLParserFactory()).createParser(); + ADQLParser parser = new ADQLParser(); parser.setQueryChecker(new DBChecker(tables)); parser.setDebug(false);