Commit dc766f2c authored by gmantele's avatar gmantele
Browse files

[ADQL] Fix the ADQL DEBUG mode ; now ADQLParser.setParser(boolean) is doing...

[ADQL] Fix the ADQL DEBUG mode ; now ADQLParser.setParser(boolean) is doing what it is supposed to do.
parent d4682d94
Loading
Loading
Loading
Loading
+5152 −5862

File changed.

Preview size limit exceeded, changes collapsed.

+10 −3
Original line number Diff line number Diff line
@@ -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.3 (10/2014)
*  Version: 1.4 (06/2015)
*/

							/* ########### */
@@ -35,7 +35,7 @@
options {
	STATIC = false;
	IGNORE_CASE = true;
	DEBUG_PARSER = false;
	DEBUG_PARSER = true;
}

							/* ########## */
@@ -89,7 +89,7 @@ import adql.translator.TranslationException;
* @see ADQLQueryFactory
*
* @author Grégory Mantelet (CDS;ARI) - gmantele@ari.uni-heidelberg.de
* @version 1.3 (10/2014)
* @version 1.4 (06/2015)
*/
public class ADQLParser {
	
@@ -113,6 +113,7 @@ public class ADQLParser {
	*/
	public ADQLParser(){
		this(new java.io.ByteArrayInputStream("".getBytes()));
		setDebug(false);
	}
	
	/**
@@ -158,6 +159,8 @@ public class ADQLParser {
	public ADQLParser(java.io.InputStream stream, QueryChecker checker, ADQLQueryFactory factory) {
		this(stream);
		
		setDebug(false);
		
		queryChecker = checker;
		
		if (factory != null)
@@ -233,6 +236,8 @@ public class ADQLParser {
	public ADQLParser(java.io.Reader reader, QueryChecker checker, ADQLQueryFactory factory) {
		this(reader);
		
		setDebug(false);
		
		queryChecker = checker;

		if (factory != null)
@@ -269,6 +274,8 @@ public class ADQLParser {
	public ADQLParser(ADQLParserTokenManager tm, QueryChecker checker, ADQLQueryFactory factory) {
		this(tm);
		
		setDebug(false);
		
		queryChecker = checker;

		if (factory != null)
+12 −0
Original line number Diff line number Diff line
@@ -27,6 +27,18 @@ public class TestADQLParser {
	@After
	public void tearDown() throws Exception{}
	
	@Test
	public void testDelimitedIdentifiersWithDot(){
		ADQLParser parser = new ADQLParser();
		try{
			ADQLQuery query = parser.parseQuery("SELECT * FROM \"B/avo.rad/catalog\";");
			assertEquals("B/avo.rad/catalog", query.getFrom().getTables().get(0).getTableName());
		}catch(Exception e){
			e.printStackTrace(System.err);
			fail("The ADQL query is strictly correct! No error should have occured. (see stdout for more details)");
		}
	}

	@Test
	public void test(){
		ADQLParser parser = new ADQLParser();