From 2a136e6511bacf00eeccf51676a24df8e217df1b Mon Sep 17 00:00:00 2001 From: gmantele <gmantele@ari.uni-heidelberg.de> Date: Tue, 12 Jul 2016 20:57:35 +0200 Subject: [PATCH] [ADQL] Fix ADQL grammar interpretation: the keyword AS is optional in the clause SELECT. --- src/adql/parser/ADQLParser.java | 213 +++++++------- src/adql/parser/ADQLParserTokenManager.java | 300 ++++++++++---------- src/adql/parser/adqlGrammar.jj | 6 +- 3 files changed, 258 insertions(+), 261 deletions(-) diff --git a/src/adql/parser/ADQLParser.java b/src/adql/parser/ADQLParser.java index 609111c..928f869 100644 --- a/src/adql/parser/ADQLParser.java +++ b/src/adql/parser/ADQLParser.java @@ -68,7 +68,7 @@ import adql.translator.TranslationException; * @see ADQLQueryFactory * * @author Grégory Mantelet (CDS;ARI) - gmantele@ari.uni-heidelberg.de -* @version 1.4 (04/2016) +* @version 1.4 (07/2016) */ public class ADQLParser implements ADQLParserConstants { @@ -690,7 +690,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[11] = jj_gen; + jj_la1[12] = jj_gen; if (jj_2_1(7)){ id = Identifier(); jj_consume_token(DOT); @@ -786,18 +786,27 @@ public class ADQLParser implements ADQLParserConstants { case UNSIGNED_INTEGER:{ op = ValueExpression(); switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk){ - case AS:{ - jj_consume_token(AS); + case AS: + case DELIMITED_IDENTIFIER: + case REGULAR_IDENTIFIER:{ + switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk){ + case AS:{ + jj_consume_token(AS); + break; + } + default: + jj_la1[10] = jj_gen;; + } label = Identifier(); break; } default: - jj_la1[10] = jj_gen;; + jj_la1[11] = jj_gen;; } break; } default: - jj_la1[12] = jj_gen; + jj_la1[13] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -840,7 +849,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[13] = jj_gen; + jj_la1[14] = jj_gen; break label_2; } jj_consume_token(COMMA); @@ -893,7 +902,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[14] = jj_gen; + jj_la1[15] = jj_gen; break label_3; } jj_consume_token(COMMA); @@ -936,7 +945,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[15] = jj_gen; + jj_la1[16] = jj_gen; break label_4; } jj_consume_token(COMMA); @@ -974,7 +983,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[16] = jj_gen; + jj_la1[17] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1004,7 +1013,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[17] = jj_gen;; + jj_la1[18] = jj_gen;; } switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk){ case DOT:{ @@ -1014,7 +1023,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[18] = jj_gen;; + jj_la1[19] = jj_gen;; } { if ("" != null) @@ -1045,7 +1054,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[19] = jj_gen;; + jj_la1[20] = jj_gen;; } identifiers.append(id); if (table != null){ @@ -1122,7 +1131,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[20] = jj_gen; + jj_la1[21] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1139,14 +1148,14 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[21] = jj_gen; + jj_la1[22] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; } default: - jj_la1[22] = jj_gen;; + jj_la1[23] = jj_gen;; } try{ ADQLOrder order = null; @@ -1196,13 +1205,13 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[23] = jj_gen;; + jj_la1[24] = jj_gen;; } alias = Identifier(); break; } default: - jj_la1[24] = jj_gen;; + jj_la1[25] = jj_gen;; } content = queryFactory.createTable(identifiers, alias); if (alias == null) @@ -1216,7 +1225,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[26] = jj_gen; + jj_la1[27] = jj_gen; if (jj_2_2(2)){ subQuery = SubQueryExpression(); switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk){ @@ -1225,7 +1234,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[25] = jj_gen;; + jj_la1[26] = jj_gen;; } alias = Identifier(); content = queryFactory.createTable(subQuery, alias); @@ -1251,7 +1260,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[27] = jj_gen; + jj_la1[28] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1310,7 +1319,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[28] = jj_gen; + jj_la1[29] = jj_gen; break label_6; } } @@ -1370,7 +1379,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[29] = jj_gen; + jj_la1[30] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1380,19 +1389,19 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[30] = jj_gen;; + jj_la1[31] = jj_gen;; } break; } default: - jj_la1[31] = jj_gen; + jj_la1[32] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; } default: - jj_la1[32] = jj_gen;; + jj_la1[33] = jj_gen;; } jj_consume_token(JOIN); rightTable = TableRef(); @@ -1439,7 +1448,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[33] = jj_gen; + jj_la1[34] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1449,19 +1458,19 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[34] = jj_gen;; + jj_la1[35] = jj_gen;; } break; } default: - jj_la1[35] = jj_gen; + jj_la1[36] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; } default: - jj_la1[36] = jj_gen;; + jj_la1[37] = jj_gen;; } jj_consume_token(JOIN); rightTable = TableRef(); @@ -1489,7 +1498,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[37] = jj_gen; + jj_la1[38] = jj_gen; break label_7; } jj_consume_token(COMMA); @@ -1506,14 +1515,14 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[38] = jj_gen; + jj_la1[39] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; } default: - jj_la1[39] = jj_gen; + jj_la1[40] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1549,7 +1558,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[40] = jj_gen; + jj_la1[41] = jj_gen; break label_8; } } @@ -1594,7 +1603,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[41] = jj_gen; + jj_la1[42] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1632,7 +1641,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[42] = jj_gen; + jj_la1[43] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1673,14 +1682,14 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[43] = jj_gen; + jj_la1[44] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; } default: - jj_la1[44] = jj_gen;; + jj_la1[45] = jj_gen;; } number = jj_consume_token(UNSIGNED_INTEGER); try{ @@ -1764,7 +1773,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[45] = jj_gen; + jj_la1[46] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1821,7 +1830,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[46] = jj_gen; + jj_la1[47] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1867,7 +1876,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[47] = jj_gen; + jj_la1[48] = jj_gen; if (jj_2_8(2147483647)){ valueExpr = Column(); }else if (jj_2_9(2147483647)){ @@ -1920,7 +1929,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[48] = jj_gen; + jj_la1[49] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1962,7 +1971,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[49] = jj_gen; + jj_la1[50] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1970,7 +1979,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[50] = jj_gen;; + jj_la1[51] = jj_gen;; } if (sign == null){ if ("" != null) @@ -2015,7 +2024,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[51] = jj_gen; + jj_la1[52] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2023,7 +2032,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[52] = jj_gen;; + jj_la1[53] = jj_gen;; } if (sign == null){ if ("" != null) @@ -2069,14 +2078,14 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[53] = jj_gen; + jj_la1[54] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; } default: - jj_la1[54] = jj_gen;; + jj_la1[55] = jj_gen;; } if (jj_2_10(2)){ op = NumericFunction(); @@ -2097,7 +2106,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[55] = jj_gen; + jj_la1[56] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2142,7 +2151,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[56] = jj_gen; + jj_la1[57] = jj_gen; break label_9; } jj_consume_token(CONCAT); @@ -2185,7 +2194,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[57] = jj_gen; + jj_la1[58] = jj_gen; if (jj_2_11(2)){ op = UserDefinedFunction(); ((UserDefinedFunction)op).setExpectedType('S'); @@ -2199,7 +2208,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[58] = jj_gen; + jj_la1[59] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2236,7 +2245,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[59] = jj_gen; + jj_la1[60] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2273,7 +2282,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[60] = jj_gen;; + jj_la1[61] = jj_gen;; } constraint = Constraint(); if (notOp){ @@ -2295,7 +2304,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[61] = jj_gen; + jj_la1[62] = jj_gen; break label_10; } switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk){ @@ -2308,7 +2317,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[62] = jj_gen; + jj_la1[63] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2319,7 +2328,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[63] = jj_gen;; + jj_la1[64] = jj_gen;; } constraint = Constraint(); if (notOp){ @@ -2380,7 +2389,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[64] = jj_gen; + jj_la1[65] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2418,7 +2427,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[69] = jj_gen; + jj_la1[70] = jj_gen; if (jj_2_14(2147483647)){ column = Column(); jj_consume_token(IS); @@ -2428,7 +2437,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[65] = jj_gen;; + jj_la1[66] = jj_gen;; } end = jj_consume_token(NULL); IsNull in = queryFactory.createIsNull((notToken != null), column); @@ -2445,7 +2454,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[66] = jj_gen;; + jj_la1[67] = jj_gen;; } jj_consume_token(LIKE); strExpr2 = StringExpression(); @@ -2519,7 +2528,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[67] = jj_gen; + jj_la1[68] = jj_gen; if (jj_2_13(2)){ constraint = BetweenEnd(op); }else{ @@ -2530,7 +2539,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[68] = jj_gen; + jj_la1[69] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2539,7 +2548,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[70] = jj_gen; + jj_la1[71] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2592,7 +2601,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[71] = jj_gen; + jj_la1[72] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2627,7 +2636,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[72] = jj_gen;; + jj_la1[73] = jj_gen;; } start = jj_consume_token(BETWEEN); min = ValueExpression(); @@ -2667,7 +2676,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[73] = jj_gen;; + jj_la1[74] = jj_gen;; } start = jj_consume_token(IN); if (jj_2_16(2)){ @@ -2685,7 +2694,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[74] = jj_gen; + jj_la1[75] = jj_gen; break label_11; } jj_consume_token(COMMA); @@ -2696,7 +2705,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[75] = jj_gen; + jj_la1[76] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2751,7 +2760,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[76] = jj_gen;; + jj_la1[77] = jj_gen;; } switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk){ case ASTERISK:{ @@ -2812,7 +2821,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[77] = jj_gen; + jj_la1[78] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2843,7 +2852,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[78] = jj_gen; + jj_la1[79] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2854,7 +2863,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[79] = jj_gen;; + jj_la1[80] = jj_gen;; } op = ValueExpression(); end = jj_consume_token(RIGHT_PAR); @@ -2863,7 +2872,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[80] = jj_gen; + jj_la1[81] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2926,7 +2935,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[81] = jj_gen; + jj_la1[82] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2966,7 +2975,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[82] = jj_gen; + jj_la1[83] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2990,7 +2999,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[83] = jj_gen; + jj_la1[84] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3011,7 +3020,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[84] = jj_gen; + jj_la1[85] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3033,7 +3042,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[85] = jj_gen; + jj_la1[86] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3048,7 +3057,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[86] = jj_gen; + jj_la1[87] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3159,7 +3168,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[87] = jj_gen; + jj_la1[88] = jj_gen; break label_12; } jj_consume_token(COMMA); @@ -3180,7 +3189,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[88] = jj_gen; + jj_la1[89] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3313,7 +3322,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[89] = jj_gen; + jj_la1[90] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3465,7 +3474,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[90] = jj_gen;; + jj_la1[91] = jj_gen;; } end = jj_consume_token(RIGHT_PAR); break; @@ -3481,7 +3490,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[91] = jj_gen;; + jj_la1[92] = jj_gen;; } end = jj_consume_token(RIGHT_PAR); break; @@ -3504,13 +3513,13 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[92] = jj_gen;; + jj_la1[93] = jj_gen;; } end = jj_consume_token(RIGHT_PAR); break; } default: - jj_la1[93] = jj_gen; + jj_la1[94] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3597,7 +3606,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[94] = jj_gen; + jj_la1[95] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3688,7 +3697,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[95] = jj_gen; + jj_la1[96] = jj_gen; break label_13; } jj_consume_token(COMMA); @@ -3698,7 +3707,7 @@ public class ADQLParser implements ADQLParserConstants { break; } default: - jj_la1[96] = jj_gen;; + jj_la1[97] = jj_gen;; } end = jj_consume_token(RIGHT_PAR); //System.out.println("INFO [ADQLParser]: \""+fct.image+"\" (from line "+fct.beginLine+" and column "+fct.beginColumn+" to line "+token.endLine+" and column "+(token.endColumn+1)+") is considered as an user defined function !"); @@ -5643,7 +5652,7 @@ public class ADQLParser implements ADQLParserConstants { private Token jj_scanpos, jj_lastpos; private int jj_la; private int jj_gen; - final private int[] jj_la1 = new int[97]; + final private int[] jj_la1 = new int[98]; static private int[] jj_la1_0; static private int[] jj_la1_1; static private int[] jj_la1_2; @@ -5656,19 +5665,19 @@ public class ADQLParser implements ADQLParserConstants { } private static void jj_la1_init_0(){ - jj_la1_0 = new int[]{0x41,0x0,0x0,0x0,0x0,0x80000,0x100000,0x20,0x0,0x0,0x400000,0x400,0x304,0x20,0x20,0x20,0x0,0x10,0x10,0x10,0x0,0x0,0x0,0x400000,0x400000,0x400000,0x0,0x4,0x3d800000,0x1c000000,0x2000000,0x1d000000,0x1d000000,0x1c000000,0x2000000,0x1d000000,0x1d000000,0x20,0xc0000000,0x3d800000,0x0,0x0,0x0,0x300,0x300,0x4,0x4,0x0,0x304,0x300,0x300,0xc00,0xc00,0x300,0x300,0x4,0x80,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x4,0x0,0x0,0x3f000,0x0,0x0,0x304,0x3f000,0x0,0x0,0x20,0x4,0x80000,0x704,0x0,0x80000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0x304,0x20,0x20,0x0,0x0,0x20,0x304,}; + jj_la1_0 = new int[]{0x41,0x0,0x0,0x0,0x0,0x80000,0x100000,0x20,0x0,0x0,0x400000,0x400000,0x400,0x304,0x20,0x20,0x20,0x0,0x10,0x10,0x10,0x0,0x0,0x0,0x400000,0x400000,0x400000,0x0,0x4,0x3d800000,0x1c000000,0x2000000,0x1d000000,0x1d000000,0x1c000000,0x2000000,0x1d000000,0x1d000000,0x20,0xc0000000,0x3d800000,0x0,0x0,0x0,0x300,0x300,0x4,0x4,0x0,0x304,0x300,0x300,0xc00,0xc00,0x300,0x300,0x4,0x80,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x4,0x0,0x0,0x3f000,0x0,0x0,0x304,0x3f000,0x0,0x0,0x20,0x4,0x80000,0x704,0x0,0x80000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0x304,0x20,0x20,0x0,0x0,0x20,0x304,}; } private static void jj_la1_init_1(){ - jj_la1_1 = new int[]{0x0,0x1,0x400,0x800,0x1000,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,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,}; } private static void jj_la1_init_2(){ - jj_la1_2 = new int[]{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20000000,0x0,0x0,0x0,0x0,0x0,0x20000000,0x0,0xffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x20ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xffffff,0xffffff,0x0,0x0,0xfffe,0xff0000,0x0,0x20ffffff,}; + jj_la1_2 = new int[]{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20000000,0x0,0x0,0x0,0x0,0x0,0x20000000,0x0,0xffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x20ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xffffff,0xffffff,0x0,0x0,0xfffe,0xff0000,0x0,0x20ffffff,}; } private static void jj_la1_init_3(){ - jj_la1_3 = new int[]{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x3,0x0,0x0,0x3b,0x0,0x0,0x0,0x3,0x0,0x0,0x0,0x23,0x0,0x0,0x0,0x3,0x0,0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x38,0x30,0x0,0x0,0x3b,0x3,0x0,0x3b,0x0,0x0,0x0,0x0,0x0,0x0,0x3b,0x0,0x0,0x3,0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3b,0x0,0x0,0x0,0x0,0x0,0x0,0x3b,0x0,0x0,0x0,0x0,0x3,0x3,0x3,0x3,0x0,0x0,0x0,0x2,0x3b,0x0,0x0,0x0,0x0,0x0,0x3b,}; + jj_la1_3 = new int[]{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x3,0x0,0x3,0x0,0x3b,0x0,0x0,0x0,0x3,0x0,0x0,0x0,0x23,0x0,0x0,0x0,0x3,0x0,0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x38,0x30,0x0,0x0,0x3b,0x3,0x0,0x3b,0x0,0x0,0x0,0x0,0x0,0x0,0x3b,0x0,0x0,0x3,0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3b,0x0,0x0,0x0,0x0,0x0,0x0,0x3b,0x0,0x0,0x0,0x0,0x3,0x3,0x3,0x3,0x0,0x0,0x0,0x2,0x3b,0x0,0x0,0x0,0x0,0x0,0x3b,}; } final private JJCalls[] jj_2_rtns = new JJCalls[16]; @@ -5691,7 +5700,7 @@ public class ADQLParser implements ADQLParserConstants { token = new Token(); jj_ntk = -1; jj_gen = 0; - for(int i = 0; i < 97; i++) + for(int i = 0; i < 98; i++) jj_la1[i] = -1; for(int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); @@ -5713,7 +5722,7 @@ public class ADQLParser implements ADQLParserConstants { token = new Token(); jj_ntk = -1; jj_gen = 0; - for(int i = 0; i < 97; i++) + for(int i = 0; i < 98; i++) jj_la1[i] = -1; for(int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); @@ -5726,7 +5735,7 @@ public class ADQLParser implements ADQLParserConstants { token = new Token(); jj_ntk = -1; jj_gen = 0; - for(int i = 0; i < 97; i++) + for(int i = 0; i < 98; i++) jj_la1[i] = -1; for(int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); @@ -5739,7 +5748,7 @@ public class ADQLParser implements ADQLParserConstants { token = new Token(); jj_ntk = -1; jj_gen = 0; - for(int i = 0; i < 97; i++) + for(int i = 0; i < 98; i++) jj_la1[i] = -1; for(int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); @@ -5751,7 +5760,7 @@ public class ADQLParser implements ADQLParserConstants { token = new Token(); jj_ntk = -1; jj_gen = 0; - for(int i = 0; i < 97; i++) + for(int i = 0; i < 98; i++) jj_la1[i] = -1; for(int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); @@ -5763,7 +5772,7 @@ public class ADQLParser implements ADQLParserConstants { token = new Token(); jj_ntk = -1; jj_gen = 0; - for(int i = 0; i < 97; i++) + for(int i = 0; i < 98; i++) jj_la1[i] = -1; for(int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); @@ -5902,7 +5911,7 @@ public class ADQLParser implements ADQLParserConstants { la1tokens[jj_kind] = true; jj_kind = -1; } - for(int i = 0; i < 97; i++){ + for(int i = 0; i < 98; i++){ if (jj_la1[i] == jj_gen){ for(int j = 0; j < 32; j++){ if ((jj_la1_0[i] & (1 << j)) != 0){ diff --git a/src/adql/parser/ADQLParserTokenManager.java b/src/adql/parser/ADQLParserTokenManager.java index 1544161..7396225 100644 --- a/src/adql/parser/ADQLParserTokenManager.java +++ b/src/adql/parser/ADQLParserTokenManager.java @@ -1,3 +1,4 @@ +/* ADQLParserTokenManager.java */ /* Generated By:JavaCC: Do not edit this line. ADQLParserTokenManager.java */ package adql.parser; import java.util.Stack; @@ -20,23 +21,20 @@ import adql.translator.PostgreSQLTranslator; import adql.translator.TranslationException; /** Token Manager. */ -public class ADQLParserTokenManager implements ADQLParserConstants -{ +@SuppressWarnings("unused")public class ADQLParserTokenManager implements ADQLParserConstants { /** Debug output. */ public java.io.PrintStream debugStream = System.out; /** Set debug output. */ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } -private final int jjStopStringLiteralDfa_3(int pos, long active0, long active1) -{ +private final int jjStopStringLiteralDfa_3(int pos, long active0, long active1){ switch (pos) { default : return -1; } } -private final int jjStartNfa_3(int pos, long active0, long active1) -{ +private final int jjStartNfa_3(int pos, long active0, long active1){ return jjMoveNfa_3(jjStopStringLiteralDfa_3(pos, active0, active1), pos + 1); } private int jjStopAtPos(int pos, int kind) @@ -45,8 +43,7 @@ private int jjStopAtPos(int pos, int kind) jjmatchedPos = pos; return pos + 1; } -private int jjMoveStringLiteralDfa0_3() -{ +private int jjMoveStringLiteralDfa0_3(){ switch(curChar) { case 34: @@ -148,8 +145,7 @@ private int jjMoveNfa_3(int startState, int curPos) catch(java.io.IOException e) { return curPos; } } } -private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) -{ +private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1){ switch (pos) { case 0: @@ -333,12 +329,10 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) return -1; } } -private final int jjStartNfa_0(int pos, long active0, long active1) -{ +private final int jjStartNfa_0(int pos, long active0, long active1){ return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1); } -private int jjMoveStringLiteralDfa0_0() -{ +private int jjMoveStringLiteralDfa0_0(){ switch(curChar) { case 34: @@ -437,8 +431,7 @@ private int jjMoveStringLiteralDfa0_0() return jjMoveNfa_0(0, 0); } } -private int jjMoveStringLiteralDfa1_0(long active0, long active1) -{ +private int jjMoveStringLiteralDfa1_0(long active0, long active1){ try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(0, active0, active1); @@ -530,8 +523,7 @@ private int jjMoveStringLiteralDfa1_0(long active0, long active1) } return jjStartNfa_0(0, active0, active1); } -private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1) -{ +private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(0, old0, old1); try { curChar = input_stream.readChar(); } @@ -643,8 +635,7 @@ private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long a } return jjStartNfa_0(1, active0, active1); } -private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1) -{ +private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(1, old0, old1); try { curChar = input_stream.readChar(); } @@ -738,8 +729,7 @@ private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long a } return jjStartNfa_0(2, active0, active1); } -private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1) -{ +private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(2, old0, old1); try { curChar = input_stream.readChar(); } @@ -818,8 +808,7 @@ private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long a } return jjStartNfa_0(3, active0, active1); } -private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1) -{ +private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(3, old0, old1); try { curChar = input_stream.readChar(); } @@ -878,8 +867,7 @@ private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long a } return jjStartNfa_0(4, active0, active1); } -private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long active1) -{ +private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(4, old0, old1); try { curChar = input_stream.readChar(); } @@ -936,8 +924,7 @@ private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long a } return jjStartNfa_0(5, active0, active1); } -private int jjMoveStringLiteralDfa7_0(long old0, long active0, long old1, long active1) -{ +private int jjMoveStringLiteralDfa7_0(long old0, long active0, long old1, long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(5, old0, old1); try { curChar = input_stream.readChar(); } @@ -981,8 +968,7 @@ private int jjMoveStringLiteralDfa7_0(long old0, long active0, long old1, long a } return jjStartNfa_0(6, active0, active1); } -private int jjMoveStringLiteralDfa8_0(long old0, long active0, long old1, long active1) -{ +private int jjMoveStringLiteralDfa8_0(long old0, long active0, long old1, long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(6, old0, old1); try { curChar = input_stream.readChar(); } @@ -1000,8 +986,7 @@ private int jjMoveStringLiteralDfa8_0(long old0, long active0, long old1, long a } return jjStartNfa_0(7, active0, 0L); } -private int jjMoveStringLiteralDfa9_0(long old0, long active0) -{ +private int jjMoveStringLiteralDfa9_0(long old0, long active0){ if (((active0 &= old0)) == 0L) return jjStartNfa_0(7, old0, 0L); try { curChar = input_stream.readChar(); } @@ -1053,31 +1038,31 @@ private int jjMoveNfa_0(int startState, int curPos) break; if (kind > 97) kind = 97; - jjCheckNAdd(21); + { jjCheckNAdd(21); } break; case 38: if ((0x3ff000000000000L & l) != 0L) { if (kind > 100) kind = 100; - jjCheckNAdd(27); + { jjCheckNAdd(27); } } if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(23, 24); + { jjCheckNAddTwoStates(23, 24); } break; case 37: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 97) kind = 97; - jjCheckNAdd(21); + { jjCheckNAdd(21); } break; case 0: if ((0x3ff000000000000L & l) != 0L) { if (kind > 101) kind = 101; - jjCheckNAddStates(0, 6); + { jjCheckNAddStates(0, 6); } } else if ((0x100002600L & l) != 0L) { @@ -1085,9 +1070,9 @@ private int jjMoveNfa_0(int startState, int curPos) kind = 1; } else if (curChar == 46) - jjCheckNAddTwoStates(23, 27); + { jjCheckNAddTwoStates(23, 27); } else if (curChar == 45) - jjCheckNAdd(19); + { jjCheckNAdd(19); } else if (curChar == 33) jjstateSet[jjnewStateCnt++] = 5; else if (curChar == 60) @@ -1100,28 +1085,28 @@ private int jjMoveNfa_0(int startState, int curPos) break; if (kind > 97) kind = 97; - jjCheckNAdd(21); + { jjCheckNAdd(21); } break; case 16: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 97) kind = 97; - jjCheckNAdd(21); + { jjCheckNAdd(21); } break; case 13: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 97) kind = 97; - jjCheckNAdd(21); + { jjCheckNAdd(21); } break; case 10: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 97) kind = 97; - jjCheckNAdd(21); + { jjCheckNAdd(21); } break; case 1: if (curChar == 10 && kind > 1) @@ -1149,88 +1134,88 @@ private int jjMoveNfa_0(int startState, int curPos) break; case 18: if (curChar == 45) - jjCheckNAdd(19); + { jjCheckNAdd(19); } break; case 19: if (curChar != 45) break; if (kind > 88) kind = 88; - jjCheckNAdd(19); + { jjCheckNAdd(19); } break; case 22: if (curChar == 46) - jjCheckNAddTwoStates(23, 27); + { jjCheckNAddTwoStates(23, 27); } break; case 23: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(23, 24); + { jjCheckNAddTwoStates(23, 24); } break; case 25: if ((0x280000000000L & l) != 0L) - jjCheckNAdd(26); + { jjCheckNAdd(26); } break; case 26: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 99) kind = 99; - jjCheckNAdd(26); + { jjCheckNAdd(26); } break; case 27: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 100) kind = 100; - jjCheckNAdd(27); + { jjCheckNAdd(27); } break; case 28: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 101) kind = 101; - jjCheckNAddStates(0, 6); + { jjCheckNAddStates(0, 6); } break; case 29: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(29, 24); + { jjCheckNAddTwoStates(29, 24); } break; case 30: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(30, 31); + { jjCheckNAddTwoStates(30, 31); } break; case 31: if (curChar == 46) - jjCheckNAddTwoStates(32, 24); + { jjCheckNAddTwoStates(32, 24); } break; case 32: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(32, 24); + { jjCheckNAddTwoStates(32, 24); } break; case 33: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(33, 34); + { jjCheckNAddTwoStates(33, 34); } break; case 34: if (curChar != 46) break; if (kind > 100) kind = 100; - jjCheckNAdd(35); + { jjCheckNAdd(35); } break; case 35: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 100) kind = 100; - jjCheckNAdd(35); + { jjCheckNAdd(35); } break; case 36: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 101) kind = 101; - jjCheckNAdd(36); + { jjCheckNAdd(36); } break; default : break; } @@ -1248,13 +1233,13 @@ private int jjMoveNfa_0(int startState, int curPos) { if (kind > 97) kind = 97; - jjCheckNAdd(21); + { jjCheckNAdd(21); } } if ((0x7fffffe07fffffeL & l) != 0L) { if (kind > 97) kind = 97; - jjCheckNAddTwoStates(20, 21); + { jjCheckNAddTwoStates(20, 21); } } if ((0x8000000080000L & l) != 0L) jjstateSet[jjnewStateCnt++] = 11; @@ -1264,13 +1249,13 @@ private int jjMoveNfa_0(int startState, int curPos) { if (kind > 97) kind = 97; - jjCheckNAdd(21); + { jjCheckNAdd(21); } } if ((0x7fffffe07fffffeL & l) != 0L) { if (kind > 97) kind = 97; - jjCheckNAddTwoStates(20, 21); + { jjCheckNAddTwoStates(20, 21); } } break; case 0: @@ -1278,7 +1263,7 @@ private int jjMoveNfa_0(int startState, int curPos) { if (kind > 97) kind = 97; - jjCheckNAddTwoStates(20, 21); + { jjCheckNAddTwoStates(20, 21); } } if ((0x200000002L & l) != 0L) jjstateSet[jjnewStateCnt++] = 16; @@ -1290,13 +1275,13 @@ private int jjMoveNfa_0(int startState, int curPos) { if (kind > 97) kind = 97; - jjCheckNAdd(21); + { jjCheckNAdd(21); } } if ((0x7fffffe07fffffeL & l) != 0L) { if (kind > 97) kind = 97; - jjCheckNAddTwoStates(20, 21); + { jjCheckNAddTwoStates(20, 21); } } if ((0x10000000100000L & l) != 0L) jjstateSet[jjnewStateCnt++] = 10; @@ -1306,13 +1291,13 @@ private int jjMoveNfa_0(int startState, int curPos) { if (kind > 97) kind = 97; - jjCheckNAdd(21); + { jjCheckNAdd(21); } } if ((0x7fffffe07fffffeL & l) != 0L) { if (kind > 97) kind = 97; - jjCheckNAddTwoStates(20, 21); + { jjCheckNAddTwoStates(20, 21); } } if ((0x100000001000L & l) != 0L) jjstateSet[jjnewStateCnt++] = 15; @@ -1322,13 +1307,13 @@ private int jjMoveNfa_0(int startState, int curPos) { if (kind > 97) kind = 97; - jjCheckNAdd(21); + { jjCheckNAdd(21); } } if ((0x7fffffe07fffffeL & l) != 0L) { if (kind > 97) kind = 97; - jjCheckNAddTwoStates(20, 21); + { jjCheckNAddTwoStates(20, 21); } } if ((0x20000000200L & l) != 0L) jjstateSet[jjnewStateCnt++] = 12; @@ -1338,13 +1323,13 @@ private int jjMoveNfa_0(int startState, int curPos) { if (kind > 97) kind = 97; - jjCheckNAdd(21); + { jjCheckNAdd(21); } } if ((0x7fffffe07fffffeL & l) != 0L) { if (kind > 97) kind = 97; - jjCheckNAddTwoStates(20, 21); + { jjCheckNAddTwoStates(20, 21); } } if ((0x20000000200L & l) != 0L) jjstateSet[jjnewStateCnt++] = 9; @@ -1378,18 +1363,18 @@ private int jjMoveNfa_0(int startState, int curPos) break; if (kind > 97) kind = 97; - jjCheckNAddTwoStates(20, 21); + { jjCheckNAddTwoStates(20, 21); } break; case 21: if ((0x7fffffe87fffffeL & l) == 0L) break; if (kind > 97) kind = 97; - jjCheckNAdd(21); + { jjCheckNAdd(21); } break; case 24: if ((0x2000000020L & l) != 0L) - jjAddStates(7, 8); + { jjAddStates(7, 8); } break; default : break; } @@ -1420,20 +1405,17 @@ private int jjMoveNfa_0(int startState, int curPos) catch(java.io.IOException e) { return curPos; } } } -private final int jjStopStringLiteralDfa_2(int pos, long active0, long active1) -{ +private final int jjStopStringLiteralDfa_2(int pos, long active0, long active1){ switch (pos) { default : return -1; } } -private final int jjStartNfa_2(int pos, long active0, long active1) -{ +private final int jjStartNfa_2(int pos, long active0, long active1){ return jjMoveNfa_2(jjStopStringLiteralDfa_2(pos, active0, active1), pos + 1); } -private int jjMoveStringLiteralDfa0_2() -{ +private int jjMoveStringLiteralDfa0_2(){ switch(curChar) { case 39: @@ -1625,81 +1607,6 @@ 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, }; - -/** Lexer state names. */ -public static final String[] lexStateNames = { - "DEFAULT", - "WithinComment", - "WithinString", - "WithinDelimitedId", -}; - -/** Lex State array. */ -public static final int[] jjnewLexState = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 0, -1, 2, -1, 0, 3, -1, 0, -1, -1, -1, - -1, -1, -1, -}; -static final long[] jjtoToken = { - 0xfffffffffffffffdL, 0x3b20ffffffL, -}; -static final long[] jjtoSkip = { - 0x2L, 0x2000000L, -}; -static final long[] jjtoMore = { - 0x0L, 0xdd000000L, -}; -protected SimpleCharStream input_stream; -private final int[] jjrounds = new int[37]; -private final int[] jjstateSet = new int[74]; -protected char curChar; -/** Constructor. */ -public ADQLParserTokenManager(SimpleCharStream stream){ - if (SimpleCharStream.staticFlag) - throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); - input_stream = stream; -} - -/** Constructor. */ -public ADQLParserTokenManager(SimpleCharStream stream, int lexState){ - this(stream); - SwitchTo(lexState); -} - -/** Reinitialise parser. */ -public void ReInit(SimpleCharStream stream) -{ - jjmatchedPos = jjnewStateCnt = 0; - curLexState = defaultLexState; - input_stream = stream; - ReInitRounds(); -} -private void ReInitRounds() -{ - int i; - jjround = 0x80000001; - for (i = 37; i-- > 0;) - jjrounds[i] = 0x80000000; -} - -/** Reinitialise parser. */ -public void ReInit(SimpleCharStream stream, int lexState) -{ - ReInit(stream); - SwitchTo(lexState); -} - -/** Switch to specified lex state. */ -public void SwitchTo(int lexState) -{ - if (lexState >= 4 || lexState < 0) - throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); - else - curLexState = lexState; -} - protected Token jjFillToken() { final Token t; @@ -1747,6 +1654,7 @@ public Token getNextToken() catch(java.io.IOException e) { jjmatchedKind = 0; + jjmatchedPos = -1; matchedToken = jjFillToken(); return matchedToken; } @@ -1858,4 +1766,84 @@ private void jjCheckNAddStates(int start, int end) } while (start++ != end); } + /** Constructor. */ + public ADQLParserTokenManager(SimpleCharStream stream){ + + if (SimpleCharStream.staticFlag) + throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); + + input_stream = stream; + } + + /** Constructor. */ + public ADQLParserTokenManager (SimpleCharStream stream, int lexState){ + ReInit(stream); + SwitchTo(lexState); + } + + /** Reinitialise parser. */ + public void ReInit(SimpleCharStream stream) + { + jjmatchedPos = jjnewStateCnt = 0; + curLexState = defaultLexState; + input_stream = stream; + ReInitRounds(); + } + + private void ReInitRounds() + { + int i; + jjround = 0x80000001; + for (i = 37; i-- > 0;) + jjrounds[i] = 0x80000000; + } + + /** Reinitialise parser. */ + public void ReInit(SimpleCharStream stream, int lexState) + { + ReInit(stream); + SwitchTo(lexState); + } + + /** Switch to specified lex state. */ + public void SwitchTo(int lexState) + { + if (lexState >= 4 || lexState < 0) + throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); + else + curLexState = lexState; + } + +/** Lexer state names. */ +public static final String[] lexStateNames = { + "DEFAULT", + "WithinComment", + "WithinString", + "WithinDelimitedId", +}; + +/** Lex State array. */ +public static final int[] jjnewLexState = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 0, -1, 2, -1, 0, 3, -1, 0, -1, -1, -1, + -1, -1, -1, +}; +static final long[] jjtoToken = { + 0xfffffffffffffffdL, 0x3b20ffffffL, +}; +static final long[] jjtoSkip = { + 0x2L, 0x2000000L, +}; +static final long[] jjtoMore = { + 0x0L, 0xdd000000L, +}; + protected SimpleCharStream input_stream; + + private final int[] jjrounds = new int[37]; + private final int[] jjstateSet = new int[2 * 37]; + + + protected char curChar; } diff --git a/src/adql/parser/adqlGrammar.jj b/src/adql/parser/adqlGrammar.jj index 68a9ada..9cf57a2 100644 --- a/src/adql/parser/adqlGrammar.jj +++ b/src/adql/parser/adqlGrammar.jj @@ -26,7 +26,7 @@ * 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 (04/2016) +* Version: 1.4 (07/2016) */ /* ########### */ @@ -89,7 +89,7 @@ import adql.translator.TranslationException; * @see ADQLQueryFactory * * @author Grégory Mantelet (CDS;ARI) - gmantele@ari.uni-heidelberg.de -* @version 1.4 (04/2016) +* @version 1.4 (07/2016) */ public class ADQLParser { @@ -802,7 +802,7 @@ SelectItem SelectItem(): {IdentifierItems identifiers = new IdentifierItems(true ) | - (op=ValueExpression()(<AS> label=Identifier())?) + (op=ValueExpression()[[<AS>] label=Identifier()]) ) { -- GitLab