diff --git a/src/adql/parser/ADQLParser.java b/src/adql/parser/ADQLParser.java index 704d43b0adf8103419f8b2ee3ae9bca2feea7a8f..86491d846b1fd9a91623e08601cf2bd9c313c514 100644 --- a/src/adql/parser/ADQLParser.java +++ b/src/adql/parser/ADQLParser.java @@ -52,16 +52,31 @@ import adql.translator.PostgreSQLTranslator; import adql.translator.TranslationException; /** -* <p>Parses an ADQL query thanks to the {@link ADQLParser#Query()} function. </p> +* Parses an ADQL query thanks to the {@link ADQLParser#Query()} function. * -* <p>This parser is able, thanks to a {@link QueryChecker} object, to check each ADQLQuery just after its generation. -* It could be used to check the consistency between the ADQL query to parse and the "database" on which the query must be executed. -* By default, there is no {@link QueryChecker}. Thus you must extend {@link QueryChecker} to check semantically all generated ADQLQuery objects.</p> +* <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> +* 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><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> +* <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 @@ -77,13 +92,16 @@ public class ADQLParser implements ADQLParserConstants { /** 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>). */ + /** 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 ADQLQuery (sub-query or not) just after their generation. */ + /** 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()}. */ + /** The first token of a table/column name. This token is extracted by + * {@link #Identifier()}. */ private Token currentIdentifierToken = null; /** @@ -95,10 +113,12 @@ public class ADQLParser implements ADQLParserConstants { } /** - * Builds an ADQL parser without a query to parse but with a QueryChecker and a ADQLQueryFactory. + * 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 ADQLQuery. - * @param factory The object to use to build an object representation of the given ADQL query. + * @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 ADQLParser(QueryChecker checker, ADQLQueryFactory factory){ this(); @@ -110,18 +130,21 @@ public class ADQLParser implements ADQLParserConstants { } /** - * Builds an ADQL parser without a query to parse but with a QueryChecker. + * Builds an ADQL parser without a query to parse but with a + * {@link QueryChecker}. * - * @param checker The object to use to check each ADQLQuery. + * @param checker The object to use to check each {@link ADQLQuery}. */ public ADQLParser(QueryChecker checker){ this(checker, null); } /** - * Builds an ADQL parser without a query to parse but with a ADQLQueryFactory. + * 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. + * @param factory The object to use to build an object representation of + * the given ADQL query. */ public ADQLParser(ADQLQueryFactory factory){ this((QueryChecker)null, factory); @@ -131,8 +154,9 @@ public class ADQLParser implements ADQLParserConstants { * 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 ADQLQuery. - * @param factory The object to use to build an object representation of the given ADQL query. + * @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 ADQLParser(java.io.InputStream stream, QueryChecker checker, ADQLQueryFactory factory){ this(stream); @@ -150,7 +174,7 @@ public class ADQLParser implements ADQLParserConstants { * 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 ADQLQuery. + * @param checker The object to use to check each {@link ADQLQuery}. */ public ADQLParser(java.io.InputStream stream, QueryChecker checker){ this(stream, checker, null); @@ -160,7 +184,8 @@ public class ADQLParser implements ADQLParserConstants { * 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. + * @param factory The object to use to build an object representation of + * the given ADQL query. */ public ADQLParser(java.io.InputStream stream, ADQLQueryFactory factory){ this(stream, (QueryChecker)null, factory); @@ -169,10 +194,11 @@ public class ADQLParser implements ADQLParserConstants { /** * 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 ADQLQuery. - * @param factory The object to use to build an object representation of the given ADQL query. + * @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 ADQLParser(java.io.InputStream stream, String encoding, QueryChecker checker, ADQLQueryFactory factory){ this(stream, encoding); @@ -187,9 +213,9 @@ public class ADQLParser implements ADQLParserConstants { /** * 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 ADQLQuery. + * @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 ADQLParser(java.io.InputStream stream, String encoding, QueryChecker checker){ this(stream, encoding, checker, null); @@ -198,9 +224,10 @@ public class ADQLParser implements ADQLParserConstants { /** * 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. + * @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 ADQLParser(java.io.InputStream stream, String encoding, ADQLQueryFactory factory){ this(stream, encoding, null, factory); @@ -209,9 +236,10 @@ public class ADQLParser implements ADQLParserConstants { /** * 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 ADQLQuery. - * @param factory The object to use to build an object representation of the given ADQL query. + * @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 ADQLParser(java.io.Reader reader, QueryChecker checker, ADQLQueryFactory factory){ this(reader); @@ -228,8 +256,8 @@ public class ADQLParser implements ADQLParserConstants { /** * 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 ADQLQuery. + * @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 ADQLParser(java.io.Reader reader, QueryChecker checker){ this(reader, checker, null); @@ -239,7 +267,8 @@ public class ADQLParser implements ADQLParserConstants { * 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. + * @param factory The object to use to build an object representation + * of the given ADQL query. */ public ADQLParser(java.io.Reader reader, ADQLQueryFactory factory){ this(reader, null, factory); @@ -248,9 +277,10 @@ public class ADQLParser implements ADQLParserConstants { /** * 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 ADQLQuery. - * @param factory The object to use to build an object representation of the given ADQL query. + * @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 ADQLParser(ADQLParserTokenManager tm, QueryChecker checker, ADQLQueryFactory factory){ this(tm); @@ -267,8 +297,8 @@ public class ADQLParser implements ADQLParserConstants { /** * 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 ADQLQuery. + * @param tm The manager which associates a token to a numeric code. + * @param checker The object to use to check each {@link ADQLQuery}. */ public ADQLParser(ADQLParserTokenManager tm, QueryChecker checker){ this(tm, checker, null); @@ -277,17 +307,20 @@ public class ADQLParser implements ADQLParserConstants { /** * 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. + * @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 ADQLParser(ADQLParserTokenManager tm, ADQLQueryFactory factory){ this(tm, null, factory); } /** - * Parses the query given at the creation of this parser or in the <i>ReInit</i> functions. + * 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. + * @return The object representation of the given ADQL query. + * * @throws ParseException If there is at least one syntactic error. * * @see ADQLParser#Query() @@ -305,8 +338,10 @@ public class ADQLParser implements ADQLParserConstants { /** * Parses the query given in parameter. * - * @param q The ADQL query to parse. - * @return The object representation of the given ADQL query. + * @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 ADQLParser#ReInit(java.io.InputStream) @@ -327,8 +362,10 @@ public class ADQLParser implements ADQLParserConstants { /** * 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. + * @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 ADQLParser#ReInit(java.io.InputStream) @@ -379,11 +416,23 @@ public class ADQLParser implements ADQLParserConstants { } /** - * <p>Gets the specified ADQL query and parses the given ADQL query. The SQL translation is then printed if the syntax is correct.</p> - * <p><b>ONLY the syntax is checked: the query is NOT EXECUTED !</b></p> - * <p>Supplied parameters are: <ul><li>[-debug] -url http://...</li><li>[-debug] -file ...</li><li>[-debug] -query SELECT...</li></ul></p> + * Gets the specified ADQL query and parses the given ADQL query. The SQL + * translation is then printed if the syntax is correct. + * + * <p> + * <b>ONLY the syntax is checked: the query is NOT EXECUTED !</b> + * </p> + * + * <p>Supplied parameters are: + * <ul> + * <li>[-debug] -url http://...</li> + * <li>[-debug] -file ...</li> + * <li>[-debug] -query SELECT...</li> + * </ul> + * </p> * * @param args + * @throws Exception */ public static final void main(String[] args) throws Exception{ @@ -560,7 +609,7 @@ public class ADQLParser implements ADQLParserConstants { jj_la1[1] = jj_gen;; } switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk){ - case GROUP_BY:{ + case GROUP:{ GroupBy(); endPos = query.getGroupBy().getPosition(); break; @@ -578,7 +627,7 @@ public class ADQLParser implements ADQLParserConstants { jj_la1[3] = jj_gen;; } switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk){ - case ORDER_BY:{ + case ORDER:{ OrderBy(); endPos = query.getOrderBy().getPosition(); break; @@ -903,7 +952,8 @@ public class ADQLParser implements ADQLParserConstants { ClauseADQL<ADQLColumn> groupBy = query.getGroupBy(); ADQLColumn colRef = null; Token start; - start = jj_consume_token(GROUP_BY); + start = jj_consume_token(GROUP); + jj_consume_token(BY); colRef = Column(); groupBy.add(colRef); label_3: while(true){ @@ -946,7 +996,8 @@ public class ADQLParser implements ADQLParserConstants { ClauseADQL<ADQLOrder> orderBy = query.getOrderBy(); ADQLOrder order = null; Token start; - start = jj_consume_token(ORDER_BY); + start = jj_consume_token(ORDER); + jj_consume_token(BY); order = OrderItem(); orderBy.add(order); label_4: while(true){ @@ -3924,66 +3975,25 @@ public class ADQLParser implements ADQLParserConstants { } } - private boolean jj_3R_16(){ - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_31()) - return true; - return false; - } - - private boolean jj_3R_122(){ - if (jj_scan_token(BOX)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_134()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_135()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_101()) - return true; - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_101()) - return true; - if (jj_scan_token(RIGHT_PAR)) - return true; - return false; - } - - private boolean jj_3R_116(){ - if (jj_3R_21()) + private boolean jj_3R_107(){ + if (jj_scan_token(RIGHT)) return true; return false; } - private boolean jj_3R_42(){ + private boolean jj_3R_55(){ Token xsp; xsp = jj_scanpos; - if (jj_3R_56()){ + if (jj_3R_96()){ jj_scanpos = xsp; - if (jj_3R_57()){ + if (jj_3R_97()){ jj_scanpos = xsp; - if (jj_3R_58()){ + if (jj_3R_98()){ jj_scanpos = xsp; - if (jj_3R_59()){ + if (jj_3R_99()){ jj_scanpos = xsp; - if (jj_3R_60()){ - jj_scanpos = xsp; - if (jj_3R_61()){ - jj_scanpos = xsp; - if (jj_3R_62()){ - jj_scanpos = xsp; - if (jj_3R_63()) - return true; - } - } - } + if (jj_3R_100()) + return true; } } } @@ -3991,699 +4001,400 @@ public class ADQLParser implements ADQLParserConstants { return false; } - private boolean jj_3R_115(){ - if (jj_3R_22()) - return true; - return false; - } - - private boolean jj_3R_150(){ - if (jj_3R_21()) + private boolean jj_3R_135(){ + if (jj_3R_101()) return true; - return false; - } - - private boolean jj_3R_105(){ - if (jj_scan_token(FULL)) + if (jj_scan_token(COMMA)) return true; - return false; - } - - private boolean jj_3R_145(){ - if (jj_3R_136()) + if (jj_3R_101()) return true; return false; } - private boolean jj_3R_102(){ + private boolean jj_3R_139(){ Token xsp; xsp = jj_scanpos; - if (jj_3R_122()){ + if (jj_scan_token(48)){ jj_scanpos = xsp; - if (jj_3R_123()){ + if (jj_scan_token(49)){ jj_scanpos = xsp; - if (jj_3R_124()){ + if (jj_scan_token(50)){ jj_scanpos = xsp; - if (jj_3R_125()){ - jj_scanpos = xsp; - if (jj_3R_126()){ - jj_scanpos = xsp; - if (jj_3R_127()) - return true; - } - } + if (jj_scan_token(51)) + return true; } } } - return false; - } - - private boolean jj_3R_151(){ - if (jj_3R_42()) - return true; - return false; - } - - private boolean jj_3R_143(){ - if (jj_3R_136()) - return true; - return false; - } - - private boolean jj_3R_112(){ if (jj_scan_token(LEFT_PAR)) return true; - if (jj_3R_101()) + xsp = jj_scanpos; + if (jj_scan_token(19)) + jj_scanpos = xsp; + if (jj_3R_42()) return true; if (jj_scan_token(RIGHT_PAR)) return true; return false; } - private boolean jj_3R_148(){ - if (jj_3R_21()) - return true; + private boolean jj_3R_128(){ + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(98)){ + jj_scanpos = xsp; + if (jj_scan_token(99)){ + jj_scanpos = xsp; + if (jj_scan_token(100)) + return true; + } + } return false; } - private boolean jj_3R_111(){ - if (jj_3R_129()) + private boolean jj_3R_138(){ + if (jj_scan_token(COUNT)) + return true; + if (jj_scan_token(LEFT_PAR)) + return true; + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(19)) + jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_scan_token(10)){ + jj_scanpos = xsp; + if (jj_3R_151()) + return true; + } + if (jj_scan_token(RIGHT_PAR)) return true; return false; } - private boolean jj_3R_149(){ - if (jj_3R_136()) + private boolean jj_3R_103(){ + if (jj_scan_token(LEFT)) return true; return false; } - private boolean jj_3R_71(){ + private boolean jj_3R_64(){ Token xsp; xsp = jj_scanpos; - if (jj_3R_115()){ + if (jj_3R_103()){ jj_scanpos = xsp; - if (jj_3R_116()){ + if (jj_3R_104()){ jj_scanpos = xsp; - if (jj_3R_117()) + if (jj_3R_105()) return true; } } return false; } - private boolean jj_3R_110(){ - if (jj_3R_21()) - return true; + private boolean jj_3R_45(){ + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(24)){ + jj_scanpos = xsp; + if (jj_3R_64()) + return true; + } return false; } - private boolean jj_3R_134(){ - if (jj_3R_27()) - return true; + private boolean jj_3R_129(){ + Token xsp; + xsp = jj_scanpos; + if (jj_3R_138()){ + jj_scanpos = xsp; + if (jj_3R_139()) + return true; + } return false; } - private boolean jj_3R_109(){ - if (jj_3R_128()) + private boolean jj_3R_37(){ + if (jj_scan_token(STRING_LITERAL)) return true; return false; } - private boolean jj_3R_147(){ - if (jj_3R_136()) + private boolean jj_3R_22(){ + Token xsp; + if (jj_3R_37()) return true; + while(true){ + xsp = jj_scanpos; + if (jj_3R_37()){ + jj_scanpos = xsp; + break; + } + } return false; } - private boolean jj_3R_108(){ - if (jj_scan_token(FULL)) + private boolean jj_3R_106(){ + if (jj_scan_token(LEFT)) return true; return false; } - private boolean jj_3R_69(){ + private boolean jj_3R_65(){ Token xsp; xsp = jj_scanpos; - if (jj_3R_109()){ + if (jj_3R_106()){ jj_scanpos = xsp; - if (jj_3R_110()){ + if (jj_3R_107()){ jj_scanpos = xsp; - if (jj_3R_111()){ - jj_scanpos = xsp; - if (jj_3R_112()) - return true; - } + if (jj_3R_108()) + return true; } } + xsp = jj_scanpos; + if (jj_scan_token(25)) + jj_scanpos = xsp; return false; } - private boolean jj_3R_31(){ - if (jj_3R_44()) - return true; - return false; - } - - private boolean jj_3R_100(){ - if (jj_scan_token(DISTANCE)) - return true; - if (jj_scan_token(LEFT_PAR)) - return true; + private boolean jj_3R_46(){ Token xsp; xsp = jj_scanpos; - if (jj_3R_147()){ + if (jj_scan_token(24)){ jj_scanpos = xsp; - if (jj_3R_148()) + if (jj_3R_65()) return true; } - if (jj_scan_token(COMMA)) - return true; + return false; + } + + private boolean jj_3R_33(){ + Token xsp; xsp = jj_scanpos; - if (jj_3R_149()){ + if (jj_3R_46()) jj_scanpos = xsp; - if (jj_3R_150()) - return true; - } - if (jj_scan_token(RIGHT_PAR)) + if (jj_scan_token(JOIN)) + return true; + if (jj_3R_47()) return true; return false; } - private boolean jj_3R_99(){ - if (jj_scan_token(COORD2)) - return true; - if (jj_scan_token(LEFT_PAR)) + private boolean jj_3R_32(){ + if (jj_scan_token(NATURAL)) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_145()){ + if (jj_3R_45()) jj_scanpos = xsp; - if (jj_3R_146()) - return true; - } - if (jj_scan_token(RIGHT_PAR)) + if (jj_scan_token(JOIN)) return true; return false; } - private boolean jj_3R_98(){ - if (jj_scan_token(COORD1)) - return true; - if (jj_scan_token(LEFT_PAR)) + private boolean jj_3_16(){ + if (jj_3R_16()) return true; + return false; + } + + private boolean jj_3R_17(){ Token xsp; xsp = jj_scanpos; - if (jj_3R_143()){ + if (jj_3R_32()){ jj_scanpos = xsp; - if (jj_3R_144()) + if (jj_3R_33()) return true; } - if (jj_scan_token(RIGHT_PAR)) - return true; return false; } - private boolean jj_3R_97(){ - if (jj_scan_token(AREA)) - return true; - if (jj_scan_token(LEFT_PAR)) + private boolean jj_3R_26(){ + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(35)) + jj_scanpos = xsp; + if (jj_scan_token(BETWEEN)) return true; - if (jj_3R_113()) + if (jj_3R_42()) return true; - if (jj_scan_token(RIGHT_PAR)) + return false; + } + + private boolean jj_3R_67(){ + if (jj_scan_token(LEFT_PAR)) return true; return false; } - private boolean jj_3R_104(){ - if (jj_scan_token(RIGHT)) + private boolean jj_3_13(){ + if (jj_3R_26()) return true; return false; } - private boolean jj_3R_153(){ - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(8)){ - jj_scanpos = xsp; - if (jj_scan_token(9)) - return true; - } + private boolean jj_3_3(){ + if (jj_3R_17()) + return true; return false; } - private boolean jj_3R_96(){ + private boolean jj_3_15(){ + if (jj_3R_27()) + return true; Token xsp; xsp = jj_scanpos; - if (jj_scan_token(58)){ + if (jj_scan_token(35)) jj_scanpos = xsp; - if (jj_scan_token(59)) - return true; - } - if (jj_scan_token(LEFT_PAR)) - return true; - if (jj_3R_113()) - return true; - if (jj_scan_token(COMMA)) + if (jj_scan_token(LIKE)) return true; - if (jj_3R_113()) + return false; + } + + private boolean jj_3_14(){ + if (jj_3R_21()) return true; - if (jj_scan_token(RIGHT_PAR)) + if (jj_scan_token(IS)) return true; return false; } - private boolean jj_3R_152(){ - Token xsp; - xsp = jj_scanpos; - if (jj_3R_153()) - jj_scanpos = xsp; - if (jj_scan_token(UNSIGNED_INTEGER)) + private boolean jj_3_2(){ + if (jj_3R_16()) return true; return false; } - private boolean jj_3R_107(){ - if (jj_scan_token(RIGHT)) + private boolean jj_3R_66(){ + if (jj_3R_72()) return true; return false; } - private boolean jj_3R_55(){ + private boolean jj_3R_47(){ Token xsp; xsp = jj_scanpos; - if (jj_3R_96()){ + if (jj_3R_66()){ jj_scanpos = xsp; - if (jj_3R_97()){ + if (jj_3_2()){ jj_scanpos = xsp; - if (jj_3R_98()){ - jj_scanpos = xsp; - if (jj_3R_99()){ - jj_scanpos = xsp; - if (jj_3R_100()) - return true; - } - } + if (jj_3R_67()) + return true; } } return false; } - private boolean jj_3R_135(){ - if (jj_3R_101()) - return true; + private boolean jj_3R_132(){ if (jj_scan_token(COMMA)) return true; - if (jj_3R_101()) + if (jj_3R_42()) return true; return false; } - private boolean jj_3R_139(){ - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(47)){ - jj_scanpos = xsp; - if (jj_scan_token(48)){ - jj_scanpos = xsp; - if (jj_scan_token(49)){ - jj_scanpos = xsp; - if (jj_scan_token(50)) - return true; - } - } - } - if (jj_scan_token(LEFT_PAR)) - return true; - xsp = jj_scanpos; - if (jj_scan_token(19)) - jj_scanpos = xsp; + private boolean jj_3R_25(){ if (jj_3R_42()) return true; - if (jj_scan_token(RIGHT_PAR)) - return true; return false; } - private boolean jj_3R_128(){ + private boolean jj_3_12(){ Token xsp; xsp = jj_scanpos; - if (jj_scan_token(97)){ + if (jj_scan_token(41)){ jj_scanpos = xsp; - if (jj_scan_token(98)){ - jj_scanpos = xsp; - if (jj_scan_token(99)) - return true; - } + if (jj_3R_25()) + return true; } return false; } - private boolean jj_3R_138(){ - if (jj_scan_token(COUNT)) - return true; - if (jj_scan_token(LEFT_PAR)) + private boolean jj_3R_52(){ + if (jj_scan_token(DOT)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(19)) - jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(10)){ - jj_scanpos = xsp; - if (jj_3R_151()) - return true; - } - if (jj_scan_token(RIGHT_PAR)) + if (jj_3R_72()) return true; return false; } - private boolean jj_3R_103(){ - if (jj_scan_token(LEFT)) + private boolean jj_3R_21(){ + if (jj_3R_36()) return true; return false; } - private boolean jj_3R_64(){ + private boolean jj_3R_36(){ + if (jj_3R_14()) + return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_103()){ + if (jj_3R_52()) jj_scanpos = xsp; - if (jj_3R_104()){ - jj_scanpos = xsp; - if (jj_3R_105()) - return true; - } - } return false; } - private boolean jj_3R_45(){ + private boolean jj_3R_114(){ + if (jj_3R_42()) + return true; Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(24)){ - jj_scanpos = xsp; - if (jj_3R_64()) - return true; + while(true){ + xsp = jj_scanpos; + if (jj_3R_132()){ + jj_scanpos = xsp; + break; + } } return false; } - private boolean jj_3R_129(){ - Token xsp; - xsp = jj_scanpos; - if (jj_3R_138()){ - jj_scanpos = xsp; - if (jj_3R_139()) - return true; - } + private boolean jj_3R_119(){ + if (jj_scan_token(DOT)) + return true; + if (jj_3R_14()) + return true; return false; } - private boolean jj_3R_37(){ - if (jj_scan_token(STRING_LITERAL)) + private boolean jj_3R_118(){ + if (jj_scan_token(DOT)) + return true; + if (jj_3R_14()) return true; return false; } - private boolean jj_3R_22(){ - Token xsp; - if (jj_3R_37()) + private boolean jj_3R_142(){ + if (jj_scan_token(COMMA)) + return true; + if (jj_3R_152()) return true; - while(true){ - xsp = jj_scanpos; - if (jj_3R_37()){ - jj_scanpos = xsp; - break; - } - } return false; } - private boolean jj_3R_106(){ - if (jj_scan_token(LEFT)) + private boolean jj_3R_141(){ + if (jj_scan_token(COMMA)) + return true; + if (jj_3R_152()) return true; return false; } - private boolean jj_3R_65(){ + private boolean jj_3R_72(){ + if (jj_3R_14()) + return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_106()){ + if (jj_3R_118()) jj_scanpos = xsp; - if (jj_3R_107()){ - jj_scanpos = xsp; - if (jj_3R_108()) - return true; - } - } xsp = jj_scanpos; - if (jj_scan_token(25)) + if (jj_3R_119()) jj_scanpos = xsp; return false; } - private boolean jj_3R_46(){ - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(24)){ - jj_scanpos = xsp; - if (jj_3R_65()) - return true; - } - return false; - } - - private boolean jj_3R_33(){ - Token xsp; - xsp = jj_scanpos; - if (jj_3R_46()) - jj_scanpos = xsp; - if (jj_scan_token(JOIN)) - return true; - if (jj_3R_47()) - return true; - return false; - } - - private boolean jj_3R_32(){ - if (jj_scan_token(NATURAL)) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_45()) - jj_scanpos = xsp; - if (jj_scan_token(JOIN)) - return true; - return false; - } - - private boolean jj_3_16(){ - if (jj_3R_16()) - return true; - return false; - } - - private boolean jj_3R_17(){ - Token xsp; - xsp = jj_scanpos; - if (jj_3R_32()){ - jj_scanpos = xsp; - if (jj_3R_33()) - return true; - } - return false; - } - - private boolean jj_3R_26(){ - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(35)) - jj_scanpos = xsp; - if (jj_scan_token(BETWEEN)) - return true; - if (jj_3R_42()) - return true; - return false; - } - - private boolean jj_3R_67(){ - if (jj_scan_token(LEFT_PAR)) - return true; - return false; - } - - private boolean jj_3_13(){ - if (jj_3R_26()) - return true; - return false; - } - - private boolean jj_3_3(){ - if (jj_3R_17()) - return true; - return false; - } - - private boolean jj_3_15(){ - if (jj_3R_27()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(35)) - jj_scanpos = xsp; - if (jj_scan_token(LIKE)) - return true; - return false; - } - - private boolean jj_3_14(){ - if (jj_3R_21()) - return true; - if (jj_scan_token(IS)) - return true; - return false; - } - - private boolean jj_3_2(){ - if (jj_3R_16()) - return true; - return false; - } - - private boolean jj_3R_66(){ - if (jj_3R_72()) - return true; - return false; - } - - private boolean jj_3R_47(){ - Token xsp; - xsp = jj_scanpos; - if (jj_3R_66()){ - jj_scanpos = xsp; - if (jj_3_2()){ - jj_scanpos = xsp; - if (jj_3R_67()) - return true; - } - } - return false; - } - - private boolean jj_3R_132(){ - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_42()) - return true; - return false; - } - - private boolean jj_3R_25(){ - if (jj_3R_42()) - return true; - return false; - } - - private boolean jj_3_12(){ - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(41)){ - jj_scanpos = xsp; - if (jj_3R_25()) - return true; - } - return false; - } - - private boolean jj_3R_52(){ - if (jj_scan_token(DOT)) - return true; - if (jj_3R_72()) - return true; - return false; - } - - private boolean jj_3R_21(){ - if (jj_3R_36()) - return true; - return false; - } - - private boolean jj_3R_36(){ - if (jj_3R_14()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_52()) - jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_114(){ - if (jj_3R_42()) - return true; - Token xsp; - while(true){ - xsp = jj_scanpos; - if (jj_3R_132()){ - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_119(){ - if (jj_scan_token(DOT)) - return true; - if (jj_3R_14()) - return true; - return false; - } - - private boolean jj_3R_118(){ - if (jj_scan_token(DOT)) - return true; - if (jj_3R_14()) - return true; - return false; - } - - private boolean jj_3R_142(){ - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_152()) - return true; - return false; - } - - private boolean jj_3R_141(){ - if (jj_scan_token(COMMA)) - return true; - if (jj_3R_152()) - return true; - return false; - } - - private boolean jj_3R_72(){ - if (jj_3R_14()) - return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_118()) - jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_119()) - jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_29(){ - if (jj_scan_token(DELIMITED_IDENTIFIER)) - return true; + private boolean jj_3R_29(){ + if (jj_scan_token(DELIMITED_IDENTIFIER)) + return true; return false; } @@ -5446,7 +5157,7 @@ public class ADQLParser implements ADQLParserConstants { private boolean jj_3_5(){ Token xsp; xsp = jj_scanpos; - if (jj_scan_token(63)){ + if (jj_scan_token(64)){ jj_scanpos = xsp; if (jj_3R_20()) return true; @@ -5624,6 +5335,346 @@ public class ADQLParser implements ADQLParserConstants { return false; } + private boolean jj_3R_16(){ + if (jj_scan_token(LEFT_PAR)) + return true; + if (jj_3R_31()) + return true; + return false; + } + + private boolean jj_3R_122(){ + if (jj_scan_token(BOX)) + return true; + if (jj_scan_token(LEFT_PAR)) + return true; + if (jj_3R_134()) + return true; + if (jj_scan_token(COMMA)) + return true; + if (jj_3R_135()) + return true; + if (jj_scan_token(COMMA)) + return true; + if (jj_3R_101()) + return true; + if (jj_scan_token(COMMA)) + return true; + if (jj_3R_101()) + return true; + if (jj_scan_token(RIGHT_PAR)) + return true; + return false; + } + + private boolean jj_3R_116(){ + if (jj_3R_21()) + return true; + return false; + } + + private boolean jj_3R_42(){ + Token xsp; + xsp = jj_scanpos; + if (jj_3R_56()){ + jj_scanpos = xsp; + if (jj_3R_57()){ + jj_scanpos = xsp; + if (jj_3R_58()){ + jj_scanpos = xsp; + if (jj_3R_59()){ + jj_scanpos = xsp; + if (jj_3R_60()){ + jj_scanpos = xsp; + if (jj_3R_61()){ + jj_scanpos = xsp; + if (jj_3R_62()){ + jj_scanpos = xsp; + if (jj_3R_63()) + return true; + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_115(){ + if (jj_3R_22()) + return true; + return false; + } + + private boolean jj_3R_150(){ + if (jj_3R_21()) + return true; + return false; + } + + private boolean jj_3R_105(){ + if (jj_scan_token(FULL)) + return true; + return false; + } + + private boolean jj_3R_145(){ + if (jj_3R_136()) + return true; + return false; + } + + private boolean jj_3R_102(){ + 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()){ + jj_scanpos = xsp; + if (jj_3R_127()) + return true; + } + } + } + } + } + return false; + } + + private boolean jj_3R_151(){ + if (jj_3R_42()) + return true; + return false; + } + + private boolean jj_3R_143(){ + if (jj_3R_136()) + return true; + return false; + } + + private boolean jj_3R_112(){ + if (jj_scan_token(LEFT_PAR)) + return true; + if (jj_3R_101()) + return true; + if (jj_scan_token(RIGHT_PAR)) + return true; + return false; + } + + private boolean jj_3R_148(){ + if (jj_3R_21()) + return true; + return false; + } + + private boolean jj_3R_111(){ + if (jj_3R_129()) + return true; + return false; + } + + private boolean jj_3R_149(){ + if (jj_3R_136()) + return true; + return false; + } + + private boolean jj_3R_71(){ + Token xsp; + xsp = jj_scanpos; + if (jj_3R_115()){ + jj_scanpos = xsp; + if (jj_3R_116()){ + jj_scanpos = xsp; + if (jj_3R_117()) + return true; + } + } + return false; + } + + private boolean jj_3R_110(){ + if (jj_3R_21()) + return true; + return false; + } + + private boolean jj_3R_134(){ + if (jj_3R_27()) + return true; + return false; + } + + private boolean jj_3R_109(){ + if (jj_3R_128()) + return true; + return false; + } + + private boolean jj_3R_147(){ + if (jj_3R_136()) + return true; + return false; + } + + private boolean jj_3R_108(){ + if (jj_scan_token(FULL)) + return true; + return false; + } + + private boolean jj_3R_69(){ + Token xsp; + xsp = jj_scanpos; + 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_31(){ + if (jj_3R_44()) + return true; + return false; + } + + private boolean jj_3R_100(){ + 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_149()){ + jj_scanpos = xsp; + if (jj_3R_150()) + return true; + } + if (jj_scan_token(RIGHT_PAR)) + return true; + return false; + } + + private boolean jj_3R_99(){ + 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_98(){ + 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_97(){ + if (jj_scan_token(AREA)) + 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(RIGHT)) + return true; + return false; + } + + private boolean jj_3R_153(){ + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(8)){ + jj_scanpos = xsp; + if (jj_scan_token(9)) + return true; + } + return false; + } + + private boolean jj_3R_96(){ + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(59)){ + jj_scanpos = xsp; + if (jj_scan_token(60)) + 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_152(){ + Token xsp; + xsp = jj_scanpos; + if (jj_3R_153()) + jj_scanpos = xsp; + if (jj_scan_token(UNSIGNED_INTEGER)) + return true; + return false; + } + /** Generated Token Manager. */ public ADQLParserTokenManager token_source; SimpleCharStream jj_input_stream; @@ -5652,15 +5703,15 @@ public class ADQLParser implements ADQLParserConstants { } private static void jj_la1_init_1(){ - jj_la1_1 = new int[]{0x0,0x1,0x400,0x800,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xffff8000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x6000,0x6000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf8000,0x0,0x3f00000,0x7c0f8000,0x0,0x0,0x0,0x0,0x0,0x0,0xf8000,0x0,0x80000000,0x0,0x3f00000,0x8,0x6,0x6,0x8,0x0,0x8,0x8,0x0,0x108,0x200,0xffff8000,0x0,0x8,0x8,0x0,0x0,0x0,0xffff8000,0x78000,0x0,0xf8000,0xc000000,0x800000,0x800000,0x800000,0x800000,0x7c000000,0x0,0x3f00000,0x7c000000,0x7c0f8000,0x0,0x0,0x0,0x0,0x0,0xffff8000,}; + jj_la1_1 = new int[]{0x0,0x1,0x800,0x1000,0x2000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xffff0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc000,0xc000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1f0000,0x0,0x7e00000,0xf81f0000,0x0,0x0,0x0,0x0,0x0,0x0,0x1f0000,0x0,0x0,0x0,0x7e00000,0x8,0x6,0x6,0x8,0x0,0x8,0x8,0x0,0x108,0x200,0xffff0000,0x0,0x8,0x8,0x0,0x0,0x0,0xffff0000,0xf0000,0x0,0x1f0000,0x18000000,0x1000000,0x1000000,0x1000000,0x1000000,0xf8000000,0x0,0x7e00000,0xf8000000,0xf81f0000,0x0,0x0,0x0,0x0,0x0,0xffff0000,}; } private static void jj_la1_init_2(){ - jj_la1_2 = new int[]{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0000000,0xc0000000,0x0,0xc0000000,0x0,0xc8ffffff,0x0,0x0,0x0,0xc0000000,0x0,0x0,0x0,0xc0000000,0x0,0x0,0x0,0xc0000000,0x0,0xc0000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8000000,0x0,0x0,0x0,0x0,0xc0000000,0xc8000000,0x0,0xc0ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0xc0000000,0x0,0x0,0xc8000000,0xc0000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc8ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0xc8ffffff,0x0,0x0,0x0,0x0,0xc0000000,0xc0000000,0xc0000000,0xc0000000,0x1,0x0,0x0,0x80ffffff,0xc0ffffff,0x0,0x0,0xfffe,0xff0000,0x0,0xc8ffffff,}; + jj_la1_2 = new int[]{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000000,0x80000000,0x0,0x80000000,0x0,0x91ffffff,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x80000000,0x0,0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10000000,0x0,0x0,0x0,0x0,0x80000000,0x90000000,0x0,0x81fffffe,0x0,0x0,0x0,0x0,0x0,0x0,0x80000000,0x0,0x1,0x90000000,0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x91ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x91ffffff,0x0,0x0,0x0,0x0,0x80000000,0x80000000,0x80000000,0x80000000,0x2,0x0,0x0,0x1fffffe,0x81fffffe,0x0,0x0,0x1fffc,0x1fe0000,0x0,0x91ffffff,}; } private static void jj_la1_init_3(){ - jj_la1_3 = new int[]{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xe,0xc,0x0,0x0,0xe,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0xe,}; + jj_la1_3 = new int[]{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x1,0x0,0x1,0x0,0x1d,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x11,0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1c,0x18,0x0,0x0,0x1d,0x1,0x0,0x1d,0x0,0x0,0x0,0x0,0x0,0x0,0x1d,0x0,0x0,0x1,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1d,0x0,0x0,0x0,0x0,0x0,0x0,0x1d,0x0,0x0,0x0,0x0,0x1,0x1,0x1,0x1,0x0,0x0,0x0,0x1,0x1d,0x0,0x0,0x0,0x0,0x0,0x1d,}; } final private JJCalls[] jj_2_rtns = new JJCalls[16]; @@ -5889,7 +5940,7 @@ public class ADQLParser implements ADQLParserConstants { /** Generate ParseException. */ public ParseException generateParseException(){ jj_expentries.clear(); - boolean[] la1tokens = new boolean[101]; + boolean[] la1tokens = new boolean[102]; if (jj_kind >= 0){ la1tokens[jj_kind] = true; jj_kind = -1; @@ -5912,7 +5963,7 @@ public class ADQLParser implements ADQLParserConstants { } } } - for(int i = 0; i < 101; i++){ + for(int i = 0; i < 102; i++){ if (la1tokens[i]){ jj_expentry = new int[1]; jj_expentry[0] = i; diff --git a/src/adql/parser/ADQLParserConstants.java b/src/adql/parser/ADQLParserConstants.java index b4760665c05c5583da470768fe8acafb6cab10cb..4eabe5f1bd3586bfd48ef1a99c3f592e0847e919 100644 --- a/src/adql/parser/ADQLParserConstants.java +++ b/src/adql/parser/ADQLParserConstants.java @@ -91,113 +91,115 @@ public interface ADQLParserConstants { /** RegularExpression Id. */ int EXISTS = 41; /** RegularExpression Id. */ - int GROUP_BY = 42; + int BY = 42; /** RegularExpression Id. */ - int HAVING = 43; + int GROUP = 43; /** RegularExpression Id. */ - int ORDER_BY = 44; + int HAVING = 44; /** RegularExpression Id. */ - int ASC = 45; + int ORDER = 45; /** RegularExpression Id. */ - int DESC = 46; + int ASC = 46; /** RegularExpression Id. */ - int AVG = 47; + int DESC = 47; /** RegularExpression Id. */ - int MAX = 48; + int AVG = 48; /** RegularExpression Id. */ - int MIN = 49; + int MAX = 49; /** RegularExpression Id. */ - int SUM = 50; + int MIN = 50; /** RegularExpression Id. */ - int COUNT = 51; + int SUM = 51; /** RegularExpression Id. */ - int BOX = 52; + int COUNT = 52; /** RegularExpression Id. */ - int CENTROID = 53; + int BOX = 53; /** RegularExpression Id. */ - int CIRCLE = 54; + int CENTROID = 54; /** RegularExpression Id. */ - int POINT = 55; + int CIRCLE = 55; /** RegularExpression Id. */ - int POLYGON = 56; + int POINT = 56; /** RegularExpression Id. */ - int REGION = 57; + int POLYGON = 57; /** RegularExpression Id. */ - int CONTAINS = 58; + int REGION = 58; /** RegularExpression Id. */ - int INTERSECTS = 59; + int CONTAINS = 59; /** RegularExpression Id. */ - int AREA = 60; + int INTERSECTS = 60; /** RegularExpression Id. */ - int COORD1 = 61; + int AREA = 61; /** RegularExpression Id. */ - int COORD2 = 62; + int COORD1 = 62; /** RegularExpression Id. */ - int COORDSYS = 63; + int COORD2 = 63; /** RegularExpression Id. */ - int DISTANCE = 64; + int COORDSYS = 64; /** RegularExpression Id. */ - int ABS = 65; + int DISTANCE = 65; /** RegularExpression Id. */ - int CEILING = 66; + int ABS = 66; /** RegularExpression Id. */ - int DEGREES = 67; + int CEILING = 67; /** RegularExpression Id. */ - int EXP = 68; + int DEGREES = 68; /** RegularExpression Id. */ - int FLOOR = 69; + int EXP = 69; /** RegularExpression Id. */ - int LOG = 70; + int FLOOR = 70; /** RegularExpression Id. */ - int LOG10 = 71; + int LOG = 71; /** RegularExpression Id. */ - int MOD = 72; + int LOG10 = 72; /** RegularExpression Id. */ - int PI = 73; + int MOD = 73; /** RegularExpression Id. */ - int POWER = 74; + int PI = 74; /** RegularExpression Id. */ - int RADIANS = 75; + int POWER = 75; /** RegularExpression Id. */ - int RAND = 76; + int RADIANS = 76; /** RegularExpression Id. */ - int ROUND = 77; + int RAND = 77; /** RegularExpression Id. */ - int SQRT = 78; + int ROUND = 78; /** RegularExpression Id. */ - int TRUNCATE = 79; + int SQRT = 79; /** RegularExpression Id. */ - int ACOS = 80; + int TRUNCATE = 80; /** RegularExpression Id. */ - int ASIN = 81; + int ACOS = 81; /** RegularExpression Id. */ - int ATAN = 82; + int ASIN = 82; /** RegularExpression Id. */ - int ATAN2 = 83; + int ATAN = 83; /** RegularExpression Id. */ - int COS = 84; + int ATAN2 = 84; /** RegularExpression Id. */ - int COT = 85; + int COS = 85; /** RegularExpression Id. */ - int SIN = 86; + int COT = 86; /** RegularExpression Id. */ - int TAN = 87; + int SIN = 87; /** RegularExpression Id. */ - int STRING_LITERAL = 91; + int TAN = 88; /** RegularExpression Id. */ - int DELIMITED_IDENTIFIER = 94; + int STRING_LITERAL = 92; /** RegularExpression Id. */ - int REGULAR_IDENTIFIER = 95; + int DELIMITED_IDENTIFIER = 95; /** RegularExpression Id. */ - int Letter = 96; + int REGULAR_IDENTIFIER = 96; /** RegularExpression Id. */ - int SCIENTIFIC_NUMBER = 97; + int Letter = 97; /** RegularExpression Id. */ - int UNSIGNED_FLOAT = 98; + int SCIENTIFIC_NUMBER = 98; /** RegularExpression Id. */ - int UNSIGNED_INTEGER = 99; + int UNSIGNED_FLOAT = 99; /** RegularExpression Id. */ - int DIGIT = 100; + int UNSIGNED_INTEGER = 100; + /** RegularExpression Id. */ + int DIGIT = 101; /** Lexical state. */ int DEFAULT = 0; @@ -250,9 +252,10 @@ public interface ADQLParserConstants { "\"LIKE\"", "\"IN\"", "\"EXISTS\"", - "\"GROUP BY\"", + "\"BY\"", + "\"GROUP\"", "\"HAVING\"", - "\"ORDER BY\"", + "\"ORDER\"", "\"ASC\"", "\"DESC\"", "\"AVG\"", @@ -296,12 +299,12 @@ public interface ADQLParserConstants { "\"COT\"", "\"SIN\"", "\"TAN\"", - "<token of kind 88>", + "<token of kind 89>", "\"\\\'\"", - "<token of kind 90>", + "<token of kind 91>", "\"\\\'\"", "\"\\\"\"", - "<token of kind 93>", + "<token of kind 94>", "\"\\\"\"", "<REGULAR_IDENTIFIER>", "<Letter>", diff --git a/src/adql/parser/ADQLParserTokenManager.java b/src/adql/parser/ADQLParserTokenManager.java index a266be293325c70e1d406656c3e5ca7a8a9154de..0ac05cc9308634bdddb86d5718f226ae889a7c46 100644 --- a/src/adql/parser/ADQLParserTokenManager.java +++ b/src/adql/parser/ADQLParserTokenManager.java @@ -47,7 +47,7 @@ private int jjMoveStringLiteralDfa0_2(){ switch(curChar) { case 34: - return jjStartNfaWithStates_2(0, 94, 1); + return jjStartNfaWithStates_2(0, 95, 1); default : return jjMoveNfa_2(0, 0); } @@ -84,15 +84,15 @@ private int jjMoveNfa_2(int startState, int curPos) case 0: if ((0xfffffffbffffffffL & l) != 0L) { - if (kind > 93) - kind = 93; + if (kind > 94) + kind = 94; } else if (curChar == 34) jjstateSet[jjnewStateCnt++] = 1; break; case 1: - if (curChar == 34 && kind > 93) - kind = 93; + if (curChar == 34 && kind > 94) + kind = 94; break; case 2: if (curChar == 34) @@ -110,7 +110,7 @@ private int jjMoveNfa_2(int startState, int curPos) switch(jjstateSet[--i]) { case 0: - kind = 93; + kind = 94; break; default : break; } @@ -125,8 +125,8 @@ private int jjMoveNfa_2(int startState, int curPos) switch(jjstateSet[--i]) { case 0: - if ((jjbitVec0[i2] & l2) != 0L && kind > 93) - kind = 93; + if ((jjbitVec0[i2] & l2) != 0L && kind > 94) + kind = 94; break; default : break; } @@ -149,180 +149,153 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1){ switch (pos) { case 0: - if ((active0 & 0xc000L) != 0L) - return 3; - if ((active0 & 0x1000a00200400000L) != 0L || (active1 & 0xf0002L) != 0L) + if ((active0 & 0x2001400200400000L) != 0L || (active1 & 0x1e0004L) != 0L) { - jjmatchedKind = 95; + jjmatchedKind = 96; return 16; } - if ((active0 & 0x10L) != 0L) + if ((active0 & 0xdffe3ffdffb40000L) != 0L || (active1 & 0x1e1ffe9L) != 0L) + { + jjmatchedKind = 96; return 41; - if ((active0 & 0x400000000000L) != 0L || (active1 & 0x9L) != 0L) + } + if ((active0 & 0x800000000000L) != 0L || (active1 & 0x12L) != 0L) { - jjmatchedKind = 95; + jjmatchedKind = 96; return 13; } - if ((active0 & 0xefff1ffdffb40000L) != 0L || (active1 & 0xf0fff4L) != 0L) - { - jjmatchedKind = 95; + if ((active0 & 0xc000L) != 0L) + return 3; + if ((active0 & 0x10L) != 0L) return 42; - } if ((active0 & 0x200L) != 0L) return 19; return -1; case 1: - if ((active0 & 0x800311441400000L) != 0L || (active1 & 0x20200L) != 0L) - return 42; - if ((active1 & 0x1L) != 0L) + if ((active0 & 0x1000651441400000L) != 0L || (active1 & 0x40400L) != 0L) + return 41; + if ((active1 & 0x2L) != 0L) { if (jjmatchedPos != 1) { - jjmatchedKind = 95; + jjmatchedKind = 96; jjmatchedPos = 1; } return 12; } - if ((active0 & 0xf7ffceebbeb40000L) != 0L || (active1 & 0xfdfdfeL) != 0L) + if ((active0 & 0xefff9aebbeb40000L) != 0L || (active1 & 0x1fbfbfdL) != 0L) { if (jjmatchedPos != 1) { - jjmatchedKind = 95; + jjmatchedKind = 96; jjmatchedPos = 1; } - return 42; + return 41; } return -1; case 2: - if ((active0 & 0x17a00a00100000L) != 0L || (active1 & 0xf001d2L) != 0L) - return 42; - if ((active0 & 0xffe85ee1bfa40000L) != 0L || (active1 & 0xffc2cL) != 0L) + if ((active1 & 0x2L) != 0L) { if (jjmatchedPos != 2) { - jjmatchedKind = 95; + jjmatchedKind = 96; jjmatchedPos = 2; } - return 42; + return 11; } - if ((active1 & 0x1L) != 0L) + if ((active0 & 0x2f400a00100000L) != 0L || (active1 & 0x1e003a4L) != 0L) + return 41; + if ((active0 & 0xffd0bae1bfa40000L) != 0L || (active1 & 0x1ff859L) != 0L) { if (jjmatchedPos != 2) { - jjmatchedKind = 95; + jjmatchedKind = 96; jjmatchedPos = 2; } - return 11; + return 41; } return -1; case 3: - if ((active1 & 0x1L) != 0L) + if ((active0 & 0xdfd03a4187840000L) != 0L || (active1 & 0x15859L) != 0L) { if (jjmatchedPos != 3) { - jjmatchedKind = 95; + jjmatchedKind = 96; jjmatchedPos = 3; } - return 10; + return 41; } - if ((active0 & 0xefe81e4187840000L) != 0L || (active1 & 0xac2cL) != 0L) + if ((active0 & 0x200080a038200000L) != 0L || (active1 & 0x1ea000L) != 0L) + return 41; + if ((active1 & 0x2L) != 0L) { if (jjmatchedPos != 3) { - jjmatchedKind = 95; + jjmatchedKind = 96; jjmatchedPos = 3; } - return 42; + return 10; } - if ((active0 & 0x100040a038200000L) != 0L || (active1 & 0xf5000L) != 0L) - return 42; - if ((active1 & 0x80L) != 0L) + if ((active1 & 0x100L) != 0L) { if (jjmatchedPos != 3) { - jjmatchedKind = 95; + jjmatchedKind = 96; jjmatchedPos = 3; } return 25; } return -1; case 4: - if ((active0 & 0x88000187000000L) != 0L || (active1 & 0x2420L) != 0L) - return 42; - if ((active1 & 0x80080L) != 0L) + if ((active0 & 0x110280187000000L) != 0L || (active1 & 0x4840L) != 0L) + return 41; + if ((active1 & 0x100100L) != 0L) return 25; - if ((active0 & 0xef601e4000840000L) != 0L || (active1 & 0x880dL) != 0L) + if ((active0 & 0xdec0124000840000L) != 0L || (active1 & 0x1101bL) != 0L) { - jjmatchedKind = 95; + jjmatchedKind = 96; jjmatchedPos = 4; - return 42; + return 41; } return -1; case 5: - if ((active0 & 0x140000000000L) != 0L) - { - if (jjmatchedPos < 4) - { - jjmatchedKind = 95; - jjmatchedPos = 4; - } - return -1; - } - if ((active0 & 0x2400a0000040000L) != 0L) - return 42; - if ((active0 & 0x8d20004000800000L) != 0L || (active1 & 0x880dL) != 0L) + if ((active0 & 0x480120000040000L) != 0L) + return 41; + if ((active0 & 0x1a40004000800000L) != 0L || (active1 & 0x1101bL) != 0L) { - jjmatchedKind = 95; + jjmatchedKind = 96; jjmatchedPos = 5; - return 42; + return 41; } - if ((active0 & 0x6000000000000000L) != 0L) + if ((active0 & 0xc000000000000000L) != 0L) return 25; return -1; case 6: - if ((active0 & 0x8c20000000000000L) != 0L || (active1 & 0x8001L) != 0L) + if ((active0 & 0x1840000000000000L) != 0L || (active1 & 0x10003L) != 0L) { - jjmatchedKind = 95; + jjmatchedKind = 96; jjmatchedPos = 6; - return 42; - } - if ((active0 & 0x140000000000L) != 0L) - { - if (jjmatchedPos < 4) - { - jjmatchedKind = 95; - jjmatchedPos = 4; - } - return -1; + return 41; } - if ((active0 & 0x100004000800000L) != 0L || (active1 & 0x80cL) != 0L) - return 42; + if ((active0 & 0x200004000800000L) != 0L || (active1 & 0x1018L) != 0L) + return 41; return -1; case 7: - if ((active0 & 0x8420000000000000L) != 0L || (active1 & 0x8001L) != 0L) - return 42; - if ((active0 & 0x140000000000L) != 0L) - { - if (jjmatchedPos < 4) - { - jjmatchedKind = 95; - jjmatchedPos = 4; - } - return -1; - } - if ((active0 & 0x800000000000000L) != 0L) + if ((active0 & 0x840000000000000L) != 0L || (active1 & 0x10003L) != 0L) + return 41; + if ((active0 & 0x1000000000000000L) != 0L) { - jjmatchedKind = 95; + jjmatchedKind = 96; jjmatchedPos = 7; - return 42; + return 41; } return -1; case 8: - if ((active0 & 0x800000000000000L) != 0L) + if ((active0 & 0x1000000000000000L) != 0L) { - jjmatchedKind = 95; + jjmatchedKind = 96; jjmatchedPos = 8; - return 42; + return 41; } return -1; default : @@ -336,9 +309,9 @@ private int jjMoveStringLiteralDfa0_0(){ switch(curChar) { case 34: - return jjStopAtPos(0, 92); + return jjStopAtPos(0, 93); case 39: - return jjStopAtPos(0, 89); + return jjStopAtPos(0, 90); case 40: return jjStopAtPos(0, 2); case 41: @@ -352,7 +325,7 @@ private int jjMoveStringLiteralDfa0_0(){ case 45: return jjStartNfaWithStates_0(0, 9, 19); case 46: - return jjStartNfaWithStates_0(0, 4, 41); + return jjStartNfaWithStates_0(0, 4, 42); case 47: return jjStopAtPos(0, 11); case 59: @@ -367,58 +340,58 @@ private int jjMoveStringLiteralDfa0_0(){ return jjMoveStringLiteralDfa1_0(0x20000L, 0x0L); case 65: case 97: - return jjMoveStringLiteralDfa1_0(0x1000a00200400000L, 0xf0002L); + return jjMoveStringLiteralDfa1_0(0x2001400200400000L, 0x1e0004L); case 66: case 98: - return jjMoveStringLiteralDfa1_0(0x10004000000000L, 0x0L); + return jjMoveStringLiteralDfa1_0(0x20044000000000L, 0x0L); case 67: case 99: - return jjMoveStringLiteralDfa1_0(0xe468000000000000L, 0x300004L); + return jjMoveStringLiteralDfa1_0(0xc8d0000000000000L, 0x600009L); case 68: case 100: - return jjMoveStringLiteralDfa1_0(0x400000000000L, 0x9L); + return jjMoveStringLiteralDfa1_0(0x800000000000L, 0x12L); case 69: case 101: - return jjMoveStringLiteralDfa1_0(0x20000000000L, 0x10L); + return jjMoveStringLiteralDfa1_0(0x20000000000L, 0x20L); case 70: case 102: - return jjMoveStringLiteralDfa1_0(0x10200000L, 0x20L); + return jjMoveStringLiteralDfa1_0(0x10200000L, 0x40L); case 71: case 103: - return jjMoveStringLiteralDfa1_0(0x40000000000L, 0x0L); + return jjMoveStringLiteralDfa1_0(0x80000000000L, 0x0L); case 72: case 104: - return jjMoveStringLiteralDfa1_0(0x80000000000L, 0x0L); + return jjMoveStringLiteralDfa1_0(0x100000000000L, 0x0L); case 73: case 105: - return jjMoveStringLiteralDfa1_0(0x800011001000000L, 0x0L); + return jjMoveStringLiteralDfa1_0(0x1000011001000000L, 0x0L); case 74: case 106: return jjMoveStringLiteralDfa1_0(0x20000000L, 0x0L); case 76: case 108: - return jjMoveStringLiteralDfa1_0(0x8008000000L, 0xc0L); + return jjMoveStringLiteralDfa1_0(0x8008000000L, 0x180L); case 77: case 109: - return jjMoveStringLiteralDfa1_0(0x3000000000000L, 0x100L); + return jjMoveStringLiteralDfa1_0(0x6000000000000L, 0x200L); case 78: case 110: return jjMoveStringLiteralDfa1_0(0x2800800000L, 0x0L); case 79: case 111: - return jjMoveStringLiteralDfa1_0(0x100442000000L, 0x0L); + return jjMoveStringLiteralDfa1_0(0x200442000000L, 0x0L); case 80: case 112: - return jjMoveStringLiteralDfa1_0(0x180000000000000L, 0x600L); + return jjMoveStringLiteralDfa1_0(0x300000000000000L, 0xc00L); case 82: case 114: - return jjMoveStringLiteralDfa1_0(0x200000004000000L, 0x3800L); + return jjMoveStringLiteralDfa1_0(0x400000004000000L, 0x7000L); case 83: case 115: - return jjMoveStringLiteralDfa1_0(0x4000000040000L, 0x404000L); + return jjMoveStringLiteralDfa1_0(0x8000000040000L, 0x808000L); case 84: case 116: - return jjMoveStringLiteralDfa1_0(0x100000L, 0x808000L); + return jjMoveStringLiteralDfa1_0(0x100000L, 0x1010000L); case 85: case 117: return jjMoveStringLiteralDfa1_0(0x80000000L, 0x0L); @@ -447,43 +420,43 @@ private int jjMoveStringLiteralDfa1_0(long active0, long active1){ break; case 65: case 97: - return jjMoveStringLiteralDfa2_0(active0, 0x1080000800000L, active1, 0x801800L); + return jjMoveStringLiteralDfa2_0(active0, 0x2100000800000L, active1, 0x1003000L); case 66: case 98: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x2L); + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x4L); case 67: case 99: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x10000L); + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x20000L); case 69: case 101: - return jjMoveStringLiteralDfa2_0(active0, 0x220404008040000L, active1, 0xcL); + return jjMoveStringLiteralDfa2_0(active0, 0x440804008040000L, active1, 0x18L); case 72: case 104: return jjMoveStringLiteralDfa2_0(active0, 0x100000000L, active1, 0L); case 73: case 105: - if ((active1 & 0x200L) != 0L) - return jjStartNfaWithStates_0(1, 73, 42); - return jjMoveStringLiteralDfa2_0(active0, 0x42008004000000L, active1, 0x400001L); + if ((active1 & 0x400L) != 0L) + return jjStartNfaWithStates_0(1, 74, 41); + return jjMoveStringLiteralDfa2_0(active0, 0x84008004000000L, active1, 0x800002L); case 76: case 108: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x20L); + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x40L); case 78: case 110: if ((active0 & 0x40000000L) != 0L) - return jjStartNfaWithStates_0(1, 30, 42); + return jjStartNfaWithStates_0(1, 30, 41); else if ((active0 & 0x10000000000L) != 0L) { jjmatchedKind = 40; jjmatchedPos = 1; } - return jjMoveStringLiteralDfa2_0(active0, 0x800000201000000L, active1, 0L); + return jjMoveStringLiteralDfa2_0(active0, 0x1000000201000000L, active1, 0L); case 79: case 111: - return jjMoveStringLiteralDfa2_0(active0, 0xe598000820100000L, active1, 0x3025c0L); + return jjMoveStringLiteralDfa2_0(active0, 0xcb30000820100000L, active1, 0x604b81L); case 81: case 113: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x4000L); + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x8000L); case 82: case 114: if ((active0 & 0x400000000L) != 0L) @@ -491,7 +464,7 @@ private int jjMoveStringLiteralDfa1_0(long active0, long active1){ jjmatchedKind = 34; jjmatchedPos = 1; } - return jjMoveStringLiteralDfa2_0(active0, 0x1000140000200000L, active1, 0x8000L); + return jjMoveStringLiteralDfa2_0(active0, 0x2000280000200000L, active1, 0x10000L); case 83: case 115: if ((active0 & 0x400000L) != 0L) @@ -500,20 +473,25 @@ private int jjMoveStringLiteralDfa1_0(long active0, long active1){ jjmatchedPos = 1; } else if ((active0 & 0x1000000000L) != 0L) - return jjStartNfaWithStates_0(1, 36, 42); - return jjMoveStringLiteralDfa2_0(active0, 0x200080000000L, active1, 0x20000L); + return jjStartNfaWithStates_0(1, 36, 41); + return jjMoveStringLiteralDfa2_0(active0, 0x400080000000L, active1, 0x40000L); case 84: case 116: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0xc0000L); + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x180000L); case 85: case 117: - return jjMoveStringLiteralDfa2_0(active0, 0x4002012000000L, active1, 0L); + return jjMoveStringLiteralDfa2_0(active0, 0x8002012000000L, active1, 0L); case 86: case 118: - return jjMoveStringLiteralDfa2_0(active0, 0x800000000000L, active1, 0L); + return jjMoveStringLiteralDfa2_0(active0, 0x1000000000000L, active1, 0L); case 88: case 120: - return jjMoveStringLiteralDfa2_0(active0, 0x20000000000L, active1, 0x10L); + return jjMoveStringLiteralDfa2_0(active0, 0x20000000000L, active1, 0x20L); + case 89: + case 121: + if ((active0 & 0x40000000000L) != 0L) + return jjStartNfaWithStates_0(1, 42, 41); + break; case 124: if ((active0 & 0x80L) != 0L) return jjStopAtPos(1, 7); @@ -535,100 +513,100 @@ private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long a { case 65: case 97: - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0xc0000L); + return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x180000L); case 67: case 99: - if ((active0 & 0x200000000000L) != 0L) - return jjStartNfaWithStates_0(2, 45, 42); + if ((active0 & 0x400000000000L) != 0L) + return jjStartNfaWithStates_0(2, 46, 41); break; case 68: case 100: if ((active0 & 0x200000000L) != 0L) - return jjStartNfaWithStates_0(2, 33, 42); - else if ((active1 & 0x100L) != 0L) - return jjStartNfaWithStates_0(2, 72, 42); - return jjMoveStringLiteralDfa3_0(active0, 0x100000000000L, active1, 0x800L); + return jjStartNfaWithStates_0(2, 33, 41); + else if ((active1 & 0x200L) != 0L) + return jjStartNfaWithStates_0(2, 73, 41); + return jjMoveStringLiteralDfa3_0(active0, 0x200000000000L, active1, 0x1000L); case 69: case 101: - return jjMoveStringLiteralDfa3_0(active0, 0x1000000100000000L, active1, 0L); + return jjMoveStringLiteralDfa3_0(active0, 0x2000000100000000L, active1, 0L); case 70: case 102: return jjMoveStringLiteralDfa3_0(active0, 0x8000000L, active1, 0L); case 71: case 103: - if ((active0 & 0x800000000000L) != 0L) - return jjStartNfaWithStates_0(2, 47, 42); - else if ((active1 & 0x40L) != 0L) + if ((active0 & 0x1000000000000L) != 0L) + return jjStartNfaWithStates_0(2, 48, 41); + else if ((active1 & 0x80L) != 0L) { - jjmatchedKind = 70; + jjmatchedKind = 71; jjmatchedPos = 2; } - return jjMoveStringLiteralDfa3_0(active0, 0x200000004000000L, active1, 0x88L); + return jjMoveStringLiteralDfa3_0(active0, 0x400000004000000L, active1, 0x110L); case 73: case 105: - return jjMoveStringLiteralDfa3_0(active0, 0x800200a0000000L, active1, 0x20004L); + return jjMoveStringLiteralDfa3_0(active0, 0x1000200a0000000L, active1, 0x40008L); case 75: case 107: return jjMoveStringLiteralDfa3_0(active0, 0x8000000000L, active1, 0L); case 76: case 108: - return jjMoveStringLiteralDfa3_0(active0, 0x100002010040000L, active1, 0L); + return jjMoveStringLiteralDfa3_0(active0, 0x200002010040000L, active1, 0L); case 77: case 109: - if ((active0 & 0x4000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 50, 42); + if ((active0 & 0x8000000000000L) != 0L) + return jjStartNfaWithStates_0(2, 51, 41); break; case 78: case 110: - if ((active0 & 0x2000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 49, 42); - else if ((active1 & 0x400000L) != 0L) - return jjStartNfaWithStates_0(2, 86, 42); + if ((active0 & 0x4000000000000L) != 0L) + return jjStartNfaWithStates_0(2, 50, 41); else if ((active1 & 0x800000L) != 0L) - return jjStartNfaWithStates_0(2, 87, 42); - return jjMoveStringLiteralDfa3_0(active0, 0x420000001000000L, active1, 0x1000L); + return jjStartNfaWithStates_0(2, 87, 41); + else if ((active1 & 0x1000000L) != 0L) + return jjStartNfaWithStates_0(2, 88, 41); + return jjMoveStringLiteralDfa3_0(active0, 0x840000001000000L, active1, 0x2000L); case 79: case 111: - return jjMoveStringLiteralDfa3_0(active0, 0xe000040000200000L, active1, 0x10020L); + return jjMoveStringLiteralDfa3_0(active0, 0xc000080000200000L, active1, 0x20041L); case 80: case 112: if ((active0 & 0x100000L) != 0L) - return jjStartNfaWithStates_0(2, 20, 42); - else if ((active1 & 0x10L) != 0L) - return jjStartNfaWithStates_0(2, 68, 42); + return jjStartNfaWithStates_0(2, 20, 41); + else if ((active1 & 0x20L) != 0L) + return jjStartNfaWithStates_0(2, 69, 41); break; case 82: case 114: - return jjMoveStringLiteralDfa3_0(active0, 0x40000000000000L, active1, 0x4000L); + return jjMoveStringLiteralDfa3_0(active0, 0x80000000000000L, active1, 0x8000L); case 83: case 115: - if ((active1 & 0x2L) != 0L) - return jjStartNfaWithStates_0(2, 65, 42); - else if ((active1 & 0x100000L) != 0L) - return jjStartNfaWithStates_0(2, 84, 42); - return jjMoveStringLiteralDfa3_0(active0, 0x400000000000L, active1, 0x1L); + if ((active1 & 0x4L) != 0L) + return jjStartNfaWithStates_0(2, 66, 41); + else if ((active1 & 0x200000L) != 0L) + return jjStartNfaWithStates_0(2, 85, 41); + return jjMoveStringLiteralDfa3_0(active0, 0x800000000000L, active1, 0x2L); case 84: case 116: if ((active0 & 0x800000000L) != 0L) - return jjStartNfaWithStates_0(2, 35, 42); - else if ((active1 & 0x200000L) != 0L) - return jjStartNfaWithStates_0(2, 85, 42); - return jjMoveStringLiteralDfa3_0(active0, 0x800004002800000L, active1, 0L); + return jjStartNfaWithStates_0(2, 35, 41); + else if ((active1 & 0x400000L) != 0L) + return jjStartNfaWithStates_0(2, 86, 41); + return jjMoveStringLiteralDfa3_0(active0, 0x1000004002800000L, active1, 0L); case 85: case 117: - return jjMoveStringLiteralDfa3_0(active0, 0x8000000000000L, active1, 0xa000L); + return jjMoveStringLiteralDfa3_0(active0, 0x10000000000000L, active1, 0x14000L); case 86: case 118: - return jjMoveStringLiteralDfa3_0(active0, 0x80000000000L, active1, 0L); + return jjMoveStringLiteralDfa3_0(active0, 0x100000000000L, active1, 0L); case 87: case 119: - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x400L); + return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x800L); case 88: case 120: - if ((active0 & 0x1000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 48, 42); - else if ((active0 & 0x10000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 52, 42); + if ((active0 & 0x2000000000000L) != 0L) + return jjStartNfaWithStates_0(2, 49, 41); + else if ((active0 & 0x20000000000000L) != 0L) + return jjStartNfaWithStates_0(2, 53, 41); break; default : break; @@ -646,84 +624,84 @@ private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long a switch(curChar) { case 49: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x80L); + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x100L); case 65: case 97: - if ((active0 & 0x1000000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 60, 42); + if ((active0 & 0x2000000000000000L) != 0L) + return jjStartNfaWithStates_0(3, 61, 41); break; case 67: case 99: - if ((active0 & 0x400000000000L) != 0L) - return jjStartNfaWithStates_0(3, 46, 42); - return jjMoveStringLiteralDfa4_0(active0, 0x40000000000000L, active1, 0L); + if ((active0 & 0x800000000000L) != 0L) + return jjStartNfaWithStates_0(3, 47, 41); + return jjMoveStringLiteralDfa4_0(active0, 0x80000000000000L, active1, 0L); case 68: case 100: - if ((active1 & 0x1000L) != 0L) - return jjStartNfaWithStates_0(3, 76, 42); + if ((active1 & 0x2000L) != 0L) + return jjStartNfaWithStates_0(3, 77, 41); break; case 69: case 101: if ((active0 & 0x8000000000L) != 0L) - return jjStartNfaWithStates_0(3, 39, 42); - return jjMoveStringLiteralDfa4_0(active0, 0x800100003040000L, active1, 0x400L); + return jjStartNfaWithStates_0(3, 39, 41); + return jjMoveStringLiteralDfa4_0(active0, 0x1000200003040000L, active1, 0x800L); case 72: case 104: return jjMoveStringLiteralDfa4_0(active0, 0x4000000L, active1, 0L); case 73: case 105: - return jjMoveStringLiteralDfa4_0(active0, 0x200080000000000L, active1, 0x800L); + return jjMoveStringLiteralDfa4_0(active0, 0x400100000000000L, active1, 0x1000L); case 76: case 108: if ((active0 & 0x10000000L) != 0L) - return jjStartNfaWithStates_0(3, 28, 42); + return jjStartNfaWithStates_0(3, 28, 41); else if ((active0 & 0x2000000000L) != 0L) - return jjStartNfaWithStates_0(3, 37, 42); - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x4L); + return jjStartNfaWithStates_0(3, 37, 41); + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x8L); case 77: case 109: if ((active0 & 0x200000L) != 0L) - return jjStartNfaWithStates_0(3, 21, 42); + return jjStartNfaWithStates_0(3, 21, 41); break; case 78: case 110: if ((active0 & 0x20000000L) != 0L) - return jjStartNfaWithStates_0(3, 29, 42); - else if ((active1 & 0x20000L) != 0L) - return jjStartNfaWithStates_0(3, 81, 42); + return jjStartNfaWithStates_0(3, 29, 41); else if ((active1 & 0x40000L) != 0L) + return jjStartNfaWithStates_0(3, 82, 41); + else if ((active1 & 0x80000L) != 0L) { - jjmatchedKind = 82; + jjmatchedKind = 83; jjmatchedPos = 3; } - return jjMoveStringLiteralDfa4_0(active0, 0x88000080000000L, active1, 0x8a000L); + return jjMoveStringLiteralDfa4_0(active0, 0x110000080000000L, active1, 0x114000L); case 79: case 111: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x20L); + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x40L); case 82: case 114: - return jjMoveStringLiteralDfa4_0(active0, 0xe000000100000000L, active1, 0x8L); + return jjMoveStringLiteralDfa4_0(active0, 0xc000000100000000L, active1, 0x11L); case 83: case 115: - if ((active1 & 0x10000L) != 0L) - return jjStartNfaWithStates_0(3, 80, 42); + if ((active1 & 0x20000L) != 0L) + return jjStartNfaWithStates_0(3, 81, 41); return jjMoveStringLiteralDfa4_0(active0, 0x20000000000L, active1, 0L); case 84: case 116: if ((active0 & 0x8000000L) != 0L) - return jjStartNfaWithStates_0(3, 27, 42); - else if ((active1 & 0x4000L) != 0L) - return jjStartNfaWithStates_0(3, 78, 42); - return jjMoveStringLiteralDfa4_0(active0, 0x420000000000000L, active1, 0x1L); + return jjStartNfaWithStates_0(3, 27, 41); + else if ((active1 & 0x8000L) != 0L) + return jjStartNfaWithStates_0(3, 79, 41); + return jjMoveStringLiteralDfa4_0(active0, 0x840000000000000L, active1, 0x2L); case 85: case 117: - return jjMoveStringLiteralDfa4_0(active0, 0x40000800000L, active1, 0L); + return jjMoveStringLiteralDfa4_0(active0, 0x80000800000L, active1, 0L); case 87: case 119: return jjMoveStringLiteralDfa4_0(active0, 0x4000000000L, active1, 0L); case 89: case 121: - return jjMoveStringLiteralDfa4_0(active0, 0x100000000000000L, active1, 0L); + return jjMoveStringLiteralDfa4_0(active0, 0x200000000000000L, active1, 0L); default : break; } @@ -740,68 +718,72 @@ private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long a switch(curChar) { case 48: - if ((active1 & 0x80L) != 0L) - return jjStartNfaWithStates_0(4, 71, 25); + if ((active1 & 0x100L) != 0L) + return jjStartNfaWithStates_0(4, 72, 25); break; case 50: - if ((active1 & 0x80000L) != 0L) - return jjStartNfaWithStates_0(4, 83, 25); + if ((active1 & 0x100000L) != 0L) + return jjStartNfaWithStates_0(4, 84, 25); break; case 65: case 97: - return jjMoveStringLiteralDfa5_0(active0, 0x400000000000000L, active1, 0x801L); + return jjMoveStringLiteralDfa5_0(active0, 0x800000000000000L, active1, 0x1002L); case 67: case 99: - return jjMoveStringLiteralDfa5_0(active0, 0x40000L, active1, 0x8000L); + return jjMoveStringLiteralDfa5_0(active0, 0x40000L, active1, 0x10000L); case 68: case 100: - if ((active1 & 0x2000L) != 0L) - return jjStartNfaWithStates_0(4, 77, 42); - return jjMoveStringLiteralDfa5_0(active0, 0xe000000000000000L, active1, 0L); + if ((active1 & 0x4000L) != 0L) + return jjStartNfaWithStates_0(4, 78, 41); + return jjMoveStringLiteralDfa5_0(active0, 0xc000000000000000L, active1, 0x1L); case 69: case 101: if ((active0 & 0x100000000L) != 0L) - return jjStartNfaWithStates_0(4, 32, 42); - return jjMoveStringLiteralDfa5_0(active0, 0x4000000000L, active1, 0x8L); + return jjStartNfaWithStates_0(4, 32, 41); + return jjMoveStringLiteralDfa5_0(active0, 0x4000000000L, active1, 0x10L); case 71: case 103: if ((active0 & 0x80000000L) != 0L) - return jjStartNfaWithStates_0(4, 31, 42); - return jjMoveStringLiteralDfa5_0(active0, 0x100000000000000L, active1, 0L); + return jjStartNfaWithStates_0(4, 31, 41); + return jjMoveStringLiteralDfa5_0(active0, 0x200000000000000L, active1, 0L); case 73: case 105: - return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x4L); + return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x8L); case 76: case 108: - return jjMoveStringLiteralDfa5_0(active0, 0x40000000000000L, active1, 0L); + return jjMoveStringLiteralDfa5_0(active0, 0x80000000000000L, active1, 0L); case 78: case 110: - return jjMoveStringLiteralDfa5_0(active0, 0x80000000000L, active1, 0L); + return jjMoveStringLiteralDfa5_0(active0, 0x100000000000L, active1, 0L); case 79: case 111: - return jjMoveStringLiteralDfa5_0(active0, 0x200000000000000L, active1, 0L); + return jjMoveStringLiteralDfa5_0(active0, 0x400000000000000L, active1, 0L); case 80: case 112: - return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L, active1, 0L); + if ((active0 & 0x80000000000L) != 0L) + return jjStartNfaWithStates_0(4, 43, 41); + break; case 82: case 114: if ((active0 & 0x1000000L) != 0L) - return jjStartNfaWithStates_0(4, 24, 42); + return jjStartNfaWithStates_0(4, 24, 41); else if ((active0 & 0x2000000L) != 0L) - return jjStartNfaWithStates_0(4, 25, 42); - else if ((active1 & 0x20L) != 0L) - return jjStartNfaWithStates_0(4, 69, 42); - else if ((active1 & 0x400L) != 0L) - return jjStartNfaWithStates_0(4, 74, 42); - return jjMoveStringLiteralDfa5_0(active0, 0x820100000800000L, active1, 0L); + return jjStartNfaWithStates_0(4, 25, 41); + else if ((active0 & 0x200000000000L) != 0L) + return jjStartNfaWithStates_0(4, 45, 41); + else if ((active1 & 0x40L) != 0L) + return jjStartNfaWithStates_0(4, 70, 41); + else if ((active1 & 0x800L) != 0L) + return jjStartNfaWithStates_0(4, 75, 41); + return jjMoveStringLiteralDfa5_0(active0, 0x1040000000800000L, active1, 0L); case 84: case 116: if ((active0 & 0x4000000L) != 0L) - return jjStartNfaWithStates_0(4, 26, 42); - else if ((active0 & 0x8000000000000L) != 0L) - return jjStartNfaWithStates_0(4, 51, 42); - else if ((active0 & 0x80000000000000L) != 0L) - return jjStartNfaWithStates_0(4, 55, 42); + return jjStartNfaWithStates_0(4, 26, 41); + else if ((active0 & 0x10000000000000L) != 0L) + return jjStartNfaWithStates_0(4, 52, 41); + else if ((active0 & 0x100000000000000L) != 0L) + return jjStartNfaWithStates_0(4, 56, 41); return jjMoveStringLiteralDfa5_0(active0, 0x20000000000L, active1, 0L); default : break; @@ -818,49 +800,47 @@ private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long a } switch(curChar) { - case 32: - return jjMoveStringLiteralDfa6_0(active0, 0x140000000000L, active1, 0L); case 49: - if ((active0 & 0x2000000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 61, 25); - break; - case 50: if ((active0 & 0x4000000000000000L) != 0L) return jjStartNfaWithStates_0(5, 62, 25); break; + case 50: + if ((active0 & 0x8000000000000000L) != 0L) + return jjStartNfaWithStates_0(5, 63, 25); + break; case 65: case 97: - return jjMoveStringLiteralDfa6_0(active0, 0x800000L, active1, 0x8000L); + return jjMoveStringLiteralDfa6_0(active0, 0x800000L, active1, 0x10000L); case 69: case 101: - if ((active0 & 0x40000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 54, 42); - return jjMoveStringLiteralDfa6_0(active0, 0x4000000000L, active1, 0x8L); + if ((active0 & 0x80000000000000L) != 0L) + return jjStartNfaWithStates_0(5, 55, 41); + return jjMoveStringLiteralDfa6_0(active0, 0x4000000000L, active1, 0x10L); case 71: case 103: - if ((active0 & 0x80000000000L) != 0L) - return jjStartNfaWithStates_0(5, 43, 42); + if ((active0 & 0x100000000000L) != 0L) + return jjStartNfaWithStates_0(5, 44, 41); break; case 73: case 105: - return jjMoveStringLiteralDfa6_0(active0, 0x400000000000000L, active1, 0L); + return jjMoveStringLiteralDfa6_0(active0, 0x800000000000000L, active1, 0L); case 78: case 110: - if ((active0 & 0x200000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 57, 42); - return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x805L); + if ((active0 & 0x400000000000000L) != 0L) + return jjStartNfaWithStates_0(5, 58, 41); + return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x100aL); case 79: case 111: - return jjMoveStringLiteralDfa6_0(active0, 0x120000000000000L, active1, 0L); + return jjMoveStringLiteralDfa6_0(active0, 0x240000000000000L, active1, 0L); case 83: case 115: if ((active0 & 0x20000000000L) != 0L) - return jjStartNfaWithStates_0(5, 41, 42); - return jjMoveStringLiteralDfa6_0(active0, 0x8800000000000000L, active1, 0L); + return jjStartNfaWithStates_0(5, 41, 41); + return jjMoveStringLiteralDfa6_0(active0, 0x1000000000000000L, active1, 0x1L); case 84: case 116: if ((active0 & 0x40000L) != 0L) - return jjStartNfaWithStates_0(5, 18, 42); + return jjStartNfaWithStates_0(5, 18, 41); break; default : break; @@ -877,48 +857,45 @@ private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long a } switch(curChar) { - case 66: - case 98: - return jjMoveStringLiteralDfa7_0(active0, 0x140000000000L, active1, 0L); case 67: case 99: - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x1L); + return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x2L); case 69: case 101: - return jjMoveStringLiteralDfa7_0(active0, 0x800000000000000L, active1, 0L); + return jjMoveStringLiteralDfa7_0(active0, 0x1000000000000000L, active1, 0L); case 71: case 103: - if ((active1 & 0x4L) != 0L) - return jjStartNfaWithStates_0(6, 66, 42); + if ((active1 & 0x8L) != 0L) + return jjStartNfaWithStates_0(6, 67, 41); break; case 73: case 105: - return jjMoveStringLiteralDfa7_0(active0, 0x20000000000000L, active1, 0L); + return jjMoveStringLiteralDfa7_0(active0, 0x40000000000000L, active1, 0L); case 76: case 108: if ((active0 & 0x800000L) != 0L) - return jjStartNfaWithStates_0(6, 23, 42); + return jjStartNfaWithStates_0(6, 23, 41); break; case 78: case 110: if ((active0 & 0x4000000000L) != 0L) - return jjStartNfaWithStates_0(6, 38, 42); - else if ((active0 & 0x100000000000000L) != 0L) - return jjStartNfaWithStates_0(6, 56, 42); - return jjMoveStringLiteralDfa7_0(active0, 0x400000000000000L, active1, 0L); + return jjStartNfaWithStates_0(6, 38, 41); + else if ((active0 & 0x200000000000000L) != 0L) + return jjStartNfaWithStates_0(6, 57, 41); + return jjMoveStringLiteralDfa7_0(active0, 0x800000000000000L, active1, 0L); case 83: case 115: - if ((active1 & 0x8L) != 0L) - return jjStartNfaWithStates_0(6, 67, 42); - else if ((active1 & 0x800L) != 0L) - return jjStartNfaWithStates_0(6, 75, 42); + if ((active1 & 0x10L) != 0L) + return jjStartNfaWithStates_0(6, 68, 41); + else if ((active1 & 0x1000L) != 0L) + return jjStartNfaWithStates_0(6, 76, 41); break; case 84: case 116: - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x8000L); + return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x10000L); case 89: case 121: - return jjMoveStringLiteralDfa7_0(active0, 0x8000000000000000L, active1, 0L); + return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x1L); default : break; } @@ -936,32 +913,25 @@ private int jjMoveStringLiteralDfa7_0(long old0, long active0, long old1, long a { case 67: case 99: - return jjMoveStringLiteralDfa8_0(active0, 0x800000000000000L, active1, 0L); + return jjMoveStringLiteralDfa8_0(active0, 0x1000000000000000L, active1, 0L); case 68: case 100: - if ((active0 & 0x20000000000000L) != 0L) - return jjStartNfaWithStates_0(7, 53, 42); + if ((active0 & 0x40000000000000L) != 0L) + return jjStartNfaWithStates_0(7, 54, 41); break; case 69: case 101: - if ((active1 & 0x1L) != 0L) - return jjStartNfaWithStates_0(7, 64, 42); - else if ((active1 & 0x8000L) != 0L) - return jjStartNfaWithStates_0(7, 79, 42); + if ((active1 & 0x2L) != 0L) + return jjStartNfaWithStates_0(7, 65, 41); + else if ((active1 & 0x10000L) != 0L) + return jjStartNfaWithStates_0(7, 80, 41); break; case 83: case 115: - if ((active0 & 0x400000000000000L) != 0L) - return jjStartNfaWithStates_0(7, 58, 42); - else if ((active0 & 0x8000000000000000L) != 0L) - return jjStartNfaWithStates_0(7, 63, 42); - break; - case 89: - case 121: - if ((active0 & 0x40000000000L) != 0L) - return jjStopAtPos(7, 42); - else if ((active0 & 0x100000000000L) != 0L) - return jjStopAtPos(7, 44); + if ((active0 & 0x800000000000000L) != 0L) + return jjStartNfaWithStates_0(7, 59, 41); + else if ((active1 & 0x1L) != 0L) + return jjStartNfaWithStates_0(7, 64, 41); break; default : break; @@ -980,7 +950,7 @@ private int jjMoveStringLiteralDfa8_0(long old0, long active0, long old1, long a { case 84: case 116: - return jjMoveStringLiteralDfa9_0(active0, 0x800000000000000L); + return jjMoveStringLiteralDfa9_0(active0, 0x1000000000000000L); default : break; } @@ -998,8 +968,8 @@ private int jjMoveStringLiteralDfa9_0(long old0, long active0){ { case 83: case 115: - if ((active0 & 0x800000000000000L) != 0L) - return jjStartNfaWithStates_0(9, 59, 42); + if ((active0 & 0x1000000000000000L) != 0L) + return jjStartNfaWithStates_0(9, 60, 41); break; default : break; @@ -1036,36 +1006,36 @@ private int jjMoveNfa_0(int startState, int curPos) case 25: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAdd(25); } break; case 11: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAdd(25); } break; case 16: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAdd(25); } break; case 13: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAdd(25); } break; - case 41: + case 42: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 98) - kind = 98; + if (kind > 99) + kind = 99; { jjCheckNAdd(31); } } if ((0x3ff000000000000L & l) != 0L) @@ -1074,22 +1044,22 @@ private int jjMoveNfa_0(int startState, int curPos) case 10: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAdd(25); } break; - case 42: + case 41: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAdd(25); } break; case 0: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 99) - kind = 99; + if (kind > 100) + kind = 100; { jjCheckNAddStates(0, 6); } } else if ((0x100002600L & l) != 0L) @@ -1139,24 +1109,24 @@ private int jjMoveNfa_0(int startState, int curPos) case 19: if (curChar != 45) break; - if (kind > 88) - kind = 88; + if (kind > 89) + kind = 89; { jjCheckNAddStates(7, 9); } break; case 20: if ((0xffffffffffffdbffL & l) == 0L) break; - if (kind > 88) - kind = 88; + if (kind > 89) + kind = 89; { jjCheckNAddStates(7, 9); } break; case 21: - if ((0x2400L & l) != 0L && kind > 88) - kind = 88; + if ((0x2400L & l) != 0L && kind > 89) + kind = 89; break; case 22: - if (curChar == 10 && kind > 88) - kind = 88; + if (curChar == 10 && kind > 89) + kind = 89; break; case 23: if (curChar == 13) @@ -1177,22 +1147,22 @@ private int jjMoveNfa_0(int startState, int curPos) case 30: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 97) - kind = 97; + if (kind > 98) + kind = 98; { jjCheckNAdd(30); } break; case 31: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 98) - kind = 98; + if (kind > 99) + kind = 99; { jjCheckNAdd(31); } break; case 32: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 99) - kind = 99; + if (kind > 100) + kind = 100; { jjCheckNAddStates(0, 6); } break; case 33: @@ -1218,22 +1188,22 @@ private int jjMoveNfa_0(int startState, int curPos) case 38: if (curChar != 46) break; - if (kind > 98) - kind = 98; + if (kind > 99) + kind = 99; { jjCheckNAdd(39); } break; case 39: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 98) - kind = 98; + if (kind > 99) + kind = 99; { jjCheckNAdd(39); } break; case 40: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 99) - kind = 99; + if (kind > 100) + kind = 100; { jjCheckNAdd(40); } break; default : break; @@ -1250,14 +1220,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 12: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAdd(25); } } if ((0x7fffffe07fffffeL & l) != 0L) { - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAddTwoStates(24, 25); } } if ((0x8000000080000L & l) != 0L) @@ -1266,14 +1236,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 11: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAdd(25); } } if ((0x7fffffe07fffffeL & l) != 0L) { - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAddTwoStates(24, 25); } } if ((0x10000000100000L & l) != 0L) @@ -1282,14 +1252,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 16: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAdd(25); } } if ((0x7fffffe07fffffeL & l) != 0L) { - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAddTwoStates(24, 25); } } if ((0x100000001000L & l) != 0L) @@ -1298,14 +1268,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 13: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAdd(25); } } if ((0x7fffffe07fffffeL & l) != 0L) { - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAddTwoStates(24, 25); } } if ((0x20000000200L & l) != 0L) @@ -1314,38 +1284,38 @@ private int jjMoveNfa_0(int startState, int curPos) case 10: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAdd(25); } } if ((0x7fffffe07fffffeL & l) != 0L) { - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAddTwoStates(24, 25); } } if ((0x20000000200L & l) != 0L) jjstateSet[jjnewStateCnt++] = 9; break; - case 42: + case 41: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAdd(25); } } if ((0x7fffffe07fffffeL & l) != 0L) { - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAddTwoStates(24, 25); } } break; case 0: if ((0x7fffffe07fffffeL & l) != 0L) { - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAddTwoStates(24, 25); } } if ((0x200000002L & l) != 0L) @@ -1378,22 +1348,22 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 16; break; case 20: - if (kind > 88) - kind = 88; + if (kind > 89) + kind = 89; { jjAddStates(7, 9); } break; case 24: if ((0x7fffffe07fffffeL & l) == 0L) break; - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAddTwoStates(24, 25); } break; case 25: if ((0x7fffffe87fffffeL & l) == 0L) break; - if (kind > 95) - kind = 95; + if (kind > 96) + kind = 96; { jjCheckNAdd(25); } break; case 28: @@ -1415,8 +1385,8 @@ private int jjMoveNfa_0(int startState, int curPos) case 20: if ((jjbitVec0[i2] & l2) == 0L) break; - if (kind > 88) - kind = 88; + if (kind > 89) + kind = 89; { jjAddStates(7, 9); } break; default : break; @@ -1450,7 +1420,7 @@ private int jjMoveStringLiteralDfa0_1(){ switch(curChar) { case 39: - return jjStartNfaWithStates_1(0, 91, 1); + return jjStartNfaWithStates_1(0, 92, 1); default : return jjMoveNfa_1(0, 0); } @@ -1484,15 +1454,15 @@ private int jjMoveNfa_1(int startState, int curPos) case 0: if ((0xffffff7fffffffffL & l) != 0L) { - if (kind > 90) - kind = 90; + if (kind > 91) + kind = 91; } else if (curChar == 39) jjstateSet[jjnewStateCnt++] = 1; break; case 1: - if (curChar == 39 && kind > 90) - kind = 90; + if (curChar == 39 && kind > 91) + kind = 91; break; case 2: if (curChar == 39) @@ -1510,7 +1480,7 @@ private int jjMoveNfa_1(int startState, int curPos) switch(jjstateSet[--i]) { case 0: - kind = 90; + kind = 91; break; default : break; } @@ -1525,8 +1495,8 @@ private int jjMoveNfa_1(int startState, int curPos) switch(jjstateSet[--i]) { case 0: - if ((jjbitVec0[i2] & l2) != 0L && kind > 90) - kind = 90; + if ((jjbitVec0[i2] & l2) != 0L && kind > 91) + kind = 91; break; default : break; } @@ -1558,7 +1528,7 @@ null, null, null, null, null, null, null, null, null, null, null, null, null, nu 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; @@ -1769,17 +1739,17 @@ 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, 0, 2, -1, 0, -1, -1, -1, -1, -1, - -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 0, 2, -1, 0, -1, -1, -1, -1, + -1, -1, }; static final long[] jjtoToken = { - 0xfffffffffffffffdL, 0xec8ffffffL, + 0xfffffffffffffffdL, 0x1d91ffffffL, }; static final long[] jjtoSkip = { - 0x2L, 0x1000000L, + 0x2L, 0x2000000L, }; static final long[] jjtoMore = { - 0x0L, 0x36000000L, + 0x0L, 0x6c000000L, }; protected SimpleCharStream input_stream; diff --git a/src/adql/parser/adqlGrammar.jj b/src/adql/parser/adqlGrammar.jj index 1de71d3864354d1c64c3219a35fb85e7c0856b65..7f67e4ebffdea92978201d506ab4550e90d6e872 100644 --- a/src/adql/parser/adqlGrammar.jj +++ b/src/adql/parser/adqlGrammar.jj @@ -19,11 +19,16 @@ */ /* -* This JavaCC file implements the BNF definition of ADQL v2.0 (IVOA Recommendation 30 Oct 2008 - http://www.ivoa.net/Documents/cover/ADQL-20081030.html). -* To generate the parser with this file use JavaCC. This .jj file has been 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". +* This JavaCC file implements the BNF definition of ADQL v2.0 +* (IVOA Recommendation 30 Oct 2008 - http://www.ivoa.net/Documents/cover/ADQL-20081030.html). +* +* To generate the parser with this file use JavaCC. This .jj file has been +* 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". * * Author: Grégory Mantelet (CDS;ARI) - gmantele@ari.uni-heidelberg.de * Version: 1.4 (09/2017) @@ -74,16 +79,31 @@ import adql.translator.PostgreSQLTranslator; import adql.translator.TranslationException; /** -* <p>Parses an ADQL query thanks to the {@link ADQLParser#Query()} function. </p> +* Parses an ADQL query thanks to the {@link ADQLParser#Query()} function. * -* <p>This parser is able, thanks to a {@link QueryChecker} object, to check each ADQLQuery just after its generation. -* It could be used to check the consistency between the ADQL query to parse and the "database" on which the query must be executed. -* By default, there is no {@link QueryChecker}. Thus you must extend {@link QueryChecker} to check semantically all generated ADQLQuery objects.</p> +* <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> +* 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><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> +* <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 @@ -99,13 +119,16 @@ public class ADQLParser { /** 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>). */ + /** 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 ADQLQuery (sub-query or not) just after their generation. */ + /** 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()}. */ + /** The first token of a table/column name. This token is extracted by + * {@link #Identifier()}. */ private Token currentIdentifierToken = null; /** @@ -117,10 +140,12 @@ public class ADQLParser { } /** - * Builds an ADQL parser without a query to parse but with a QueryChecker and a ADQLQueryFactory. + * 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 ADQLQuery. - * @param factory The object to use to build an object representation of the given ADQL query. + * @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 ADQLParser(QueryChecker checker, ADQLQueryFactory factory) { this(); @@ -132,18 +157,21 @@ public class ADQLParser { } /** - * Builds an ADQL parser without a query to parse but with a QueryChecker. + * Builds an ADQL parser without a query to parse but with a + * {@link QueryChecker}. * - * @param checker The object to use to check each ADQLQuery. + * @param checker The object to use to check each {@link ADQLQuery}. */ public ADQLParser(QueryChecker checker) { this(checker, null); } /** - * Builds an ADQL parser without a query to parse but with a ADQLQueryFactory. + * 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. + * @param factory The object to use to build an object representation of + * the given ADQL query. */ public ADQLParser(ADQLQueryFactory factory) { this((QueryChecker)null, factory); @@ -153,8 +181,9 @@ public class ADQLParser { * 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 ADQLQuery. - * @param factory The object to use to build an object representation of the given ADQL query. + * @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 ADQLParser(java.io.InputStream stream, QueryChecker checker, ADQLQueryFactory factory) { this(stream); @@ -172,7 +201,7 @@ public class ADQLParser { * 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 ADQLQuery. + * @param checker The object to use to check each {@link ADQLQuery}. */ public ADQLParser(java.io.InputStream stream, QueryChecker checker) { this(stream, checker, null); @@ -182,7 +211,8 @@ public class ADQLParser { * 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. + * @param factory The object to use to build an object representation of + * the given ADQL query. */ public ADQLParser(java.io.InputStream stream, ADQLQueryFactory factory) { this(stream, (QueryChecker)null, factory); @@ -191,10 +221,11 @@ public class ADQLParser { /** * 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 ADQLQuery. - * @param factory The object to use to build an object representation of the given ADQL query. + * @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 ADQLParser(java.io.InputStream stream, String encoding, QueryChecker checker, ADQLQueryFactory factory) { this(stream, encoding); @@ -209,9 +240,9 @@ public class ADQLParser { /** * 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 ADQLQuery. + * @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 ADQLParser(java.io.InputStream stream, String encoding, QueryChecker checker) { this(stream, encoding, checker, null); @@ -220,9 +251,10 @@ public class ADQLParser { /** * 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. + * @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 ADQLParser(java.io.InputStream stream, String encoding, ADQLQueryFactory factory) { this(stream, encoding, null, factory); @@ -231,9 +263,10 @@ public class ADQLParser { /** * 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 ADQLQuery. - * @param factory The object to use to build an object representation of the given ADQL query. + * @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 ADQLParser(java.io.Reader reader, QueryChecker checker, ADQLQueryFactory factory) { this(reader); @@ -250,8 +283,8 @@ public class ADQLParser { /** * 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 ADQLQuery. + * @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 ADQLParser(java.io.Reader reader, QueryChecker checker) { this(reader, checker, null); @@ -261,7 +294,8 @@ public class ADQLParser { * 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. + * @param factory The object to use to build an object representation + * of the given ADQL query. */ public ADQLParser(java.io.Reader reader, ADQLQueryFactory factory) { this(reader, null, factory); @@ -270,9 +304,10 @@ public class ADQLParser { /** * 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 ADQLQuery. - * @param factory The object to use to build an object representation of the given ADQL query. + * @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 ADQLParser(ADQLParserTokenManager tm, QueryChecker checker, ADQLQueryFactory factory) { this(tm); @@ -289,8 +324,8 @@ public class ADQLParser { /** * 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 ADQLQuery. + * @param tm The manager which associates a token to a numeric code. + * @param checker The object to use to check each {@link ADQLQuery}. */ public ADQLParser(ADQLParserTokenManager tm, QueryChecker checker) { this(tm, checker, null); @@ -299,17 +334,20 @@ public class ADQLParser { /** * 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. + * @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 ADQLParser(ADQLParserTokenManager tm, ADQLQueryFactory factory) { this(tm, null, factory); } /** - * Parses the query given at the creation of this parser or in the <i>ReInit</i> functions. + * 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. + * @return The object representation of the given ADQL query. + * * @throws ParseException If there is at least one syntactic error. * * @see ADQLParser#Query() @@ -327,8 +365,10 @@ public class ADQLParser { /** * Parses the query given in parameter. * - * @param q The ADQL query to parse. - * @return The object representation of the given ADQL query. + * @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 ADQLParser#ReInit(java.io.InputStream) @@ -349,8 +389,10 @@ public class ADQLParser { /** * 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. + * @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 ADQLParser#ReInit(java.io.InputStream) @@ -399,11 +441,23 @@ public class ADQLParser { } /** - * <p>Gets the specified ADQL query and parses the given ADQL query. The SQL translation is then printed if the syntax is correct.</p> - * <p><b>ONLY the syntax is checked: the query is NOT EXECUTED !</b></p> - * <p>Supplied parameters are: <ul><li>[-debug] -url http://...</li><li>[-debug] -file ...</li><li>[-debug] -query SELECT...</li></ul></p> + * Gets the specified ADQL query and parses the given ADQL query. The SQL + * translation is then printed if the syntax is correct. + * + * <p> + * <b>ONLY the syntax is checked: the query is NOT EXECUTED !</b> + * </p> + * + * <p>Supplied parameters are: + * <ul> + * <li>[-debug] -url http://...</li> + * <li>[-debug] -file ...</li> + * <li>[-debug] -query SELECT...</li> + * </ul> + * </p> * * @param args + * @throws Exception */ public static final void main(String[] args) throws Exception { @@ -589,9 +643,10 @@ TOKEN : { /* Other clauses' tokens */ /* ********************* */ TOKEN : { - < GROUP_BY: "GROUP BY" > + < BY: "BY" > +| < GROUP: "GROUP" > | < HAVING: "HAVING" > -| < ORDER_BY: "ORDER BY" > +| < ORDER: "ORDER" > | < ASC: "ASC" > | < DESC: "DESC" > } @@ -854,7 +909,7 @@ void Where(): {ClauseConstraints where = query.getWhere(); ADQLConstraint condit } void GroupBy(): {ClauseADQL<ADQLColumn> groupBy = query.getGroupBy(); ADQLColumn colRef = null; Token start;} { - start=<GROUP_BY> colRef=Column() { groupBy.add(colRef); } + start=<GROUP> <BY> colRef=Column() { groupBy.add(colRef); } ( <COMMA> colRef=Column() { groupBy.add(colRef); } )* { groupBy.setPosition(new TextPosition(start.beginLine, start.beginColumn, colRef.getPosition().endLine, colRef.getPosition().endColumn)); } } @@ -868,7 +923,7 @@ void Having(): {ClauseConstraints having = query.getHaving(); Token start;} { } void OrderBy(): {ClauseADQL<ADQLOrder> orderBy = query.getOrderBy(); ADQLOrder order = null; Token start;} { - start=<ORDER_BY> order=OrderItem() {orderBy.add(order);} + start=<ORDER> <BY> order=OrderItem() {orderBy.add(order);} ( <COMMA> order=OrderItem() {orderBy.add(order);} )* { orderBy.setPosition(new TextPosition(start, token)); } } diff --git a/test/adql/parser/TestADQLParser.java b/test/adql/parser/TestADQLParser.java index 691c10cd0e413481582b88deb150fb8435c4d431..679ed01a68050b83df3d574582ba5441659caf35 100644 --- a/test/adql/parser/TestADQLParser.java +++ b/test/adql/parser/TestADQLParser.java @@ -179,4 +179,31 @@ public class TestADQLParser { } } + @Test + public void testMultipleSpacesInOrderAndGroupBy(){ + try{ + ADQLParser parser = new ADQLParser(); + + // Single space: + parser.parseQuery("select * from aTable ORDER BY aCol"); + parser.parseQuery("select * from aTable GROUP BY aCol"); + + // More than one space: + parser.parseQuery("select * from aTable ORDER BY aCol"); + parser.parseQuery("select * from aTable GROUP BY aCol"); + + // With any other space character: + parser.parseQuery("select * from aTable ORDER\tBY aCol"); + parser.parseQuery("select * from aTable ORDER\nBY aCol"); + parser.parseQuery("select * from aTable ORDER \t\nBY aCol"); + + parser.parseQuery("select * from aTable GROUP\tBY aCol"); + parser.parseQuery("select * from aTable GROUP\nBY aCol"); + parser.parseQuery("select * from aTable GROUP \t\nBY aCol"); + }catch(Throwable t){ + t.printStackTrace(); + fail("Having multiple space characters between the ORDER/GROUP and the BY keywords should not generate any parsing error."); + } + } + }