Commit 005fc622 authored by gmantele's avatar gmantele
Browse files

[ADQL] Recompilation of the ADQLParser classes using JavaCC 6.0.

Two classes have been modified after compilation:
    - ADQLParser - a simple cast for one of the automatically generated
                   constructor.
    - ParseException - the token position has been stored for better
                       syntax error messages.
A note has been added at the top comment for both files to highlight
the modified parts and how to restore them after re-generation.
parent d399afd1
Loading
Loading
Loading
Loading

src/adql/parser/.gitignore

deleted100644 → 0
+0 −3
Original line number Diff line number Diff line
/ADQLParser.java
/ADQLParserConstants.java
/ADQLParserTokenManager.java
+15 −1
Original line number Diff line number Diff line
/* ADQLParser.java */
/* Generated By:JavaCC: Do not edit this line. ADQLParser.java */
/* Generated By:JavaCC: Do not edit this line. ADQLParser.java
 * 
 * Modified by Gregory Mantelet (ARI), March 2017
 * Modification: line 5686, from:
 * 
 *   public ADQLParser(java.io.InputStream stream){
 *     this(stream, null);
 *   }
 * 
 *   to:
 * 
 *   public ADQLParser(java.io.InputStream stream){
 *     this(stream, (String)null);
 *   }
 */
package adql.parser;

import java.io.FileReader;
+16 −11
Original line number Diff line number Diff line
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 6.0 */
/* JavaCCOptions:KEEP_LINE_COL=null
 * 
 * Modified by Grégory Mantelet (CDS), on February 2012
 * Modified by Grégory Mantelet (CDS), on March 2017
 * Modification: several small modifications.
 *               /!\ DO NOT RE-GENERATE THIS FILE /!\
 *               In case of re-generation, replace it by
 *               ParseException.java.backup (but maybe after a diff
 *               in case of significant modifications have been done
 *               by a new version of JavaCC).
 */
package adql.parser;

@@ -16,7 +22,6 @@ import adql.query.TextPosition;
 * You can modify this class to customize your error reporting
 * mechanisms so long as you retain the public fields.
 */
@SuppressWarnings("all")
public class ParseException extends Exception {

	/**
+69 −66
Original line number Diff line number Diff line
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */
/* JavaCCOptions:KEEP_LINE_COL=null */
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 6.0 */
/* JavaCCOptions:KEEP_LINE_COL=null
 * 
 * Modified by Grégory Mantelet (CDS), on March 2017
 * Modification: several small modifications.
 *               /!\ DO NOT RE-GENERATE THIS FILE /!\
 *               In case of re-generation, replace it by
 *               ParseException.java.backup (but maybe after a diff
 *               in case of significant modifications have been done
 *               by a new version of JavaCC).
 */
package adql.parser;

import adql.query.TextPosition;
@@ -13,7 +22,6 @@ import adql.query.TextPosition;
 * You can modify this class to customize your error reporting
 * mechanisms so long as you retain the public fields.
 */
@SuppressWarnings("all")
public class ParseException extends Exception {

	/**
@@ -29,11 +37,7 @@ public class ParseException extends Exception {
	 * a new object of this type with the fields "currentToken",
	 * "expectedTokenSequences", and "tokenImage" set.
	 */
	public ParseException(Token currentTokenVal,
			int[][] expectedTokenSequencesVal,
			String[] tokenImageVal
	)
	{
	public ParseException(Token currentTokenVal, int[][] expectedTokenSequencesVal, String[] tokenImageVal){
		super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal));
		currentToken = currentTokenVal;
		expectedTokenSequences = expectedTokenSequencesVal;
@@ -66,7 +70,6 @@ public class ParseException extends Exception {
		position = errorPosition;
	}


	/**
	 * This is the last token that has been consumed successfully.  If
	 * this object has been created due to a parse error, the token
@@ -127,7 +130,8 @@ public class ParseException extends Exception {
		msg.append(" Encountered \"");
		Token tok = currentToken.next;
		for(int i = 0; i < maxSize; i++){
			if (i != 0) msg.append(' ');
			if (i != 0)
				msg.append(' ');
			if (tok.kind == 0){
				msg.append(tokenImage[0]);
				break;
@@ -200,8 +204,7 @@ public class ParseException extends Exception {
		StringBuffer retval = new StringBuffer();
		char ch;
		for(int i = 0; i < str.length(); i++){
			switch (str.charAt(i))
			{
			switch(str.charAt(i)){
				case 0:
					continue;
				case '\b':
+14 −5
Original line number Diff line number Diff line
/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 5.0 */
/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 6.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package adql.parser;

@@ -7,7 +7,6 @@ package adql.parser;
 * contain only ASCII characters (without unicode processing).
 */

@SuppressWarnings("all")
public class SimpleCharStream {
	/** Whether parser is static. */
	public static final boolean staticFlag = false;
@@ -31,12 +30,13 @@ public class SimpleCharStream {
	protected int maxNextCharInd = 0;
	protected int inBuf = 0;
	protected int tabSize = 8;
	protected boolean trackLineColumn = true;

	protected void setTabSize(int i){
	public void setTabSize(int i){
		tabSize = i;
	}

	protected int getTabSize(int i){
	public int getTabSize(){
		return tabSize;
	}

@@ -183,6 +183,7 @@ public class SimpleCharStream {
	 * @deprecated
	 * @see #getEndColumn
	 */

	public int getColumn(){
		return bufcolumn[bufpos];
	}
@@ -192,6 +193,7 @@ public class SimpleCharStream {
	 * @deprecated
	 * @see #getEndLine
	 */

	public int getLine(){
		return bufline[bufpos];
	}
@@ -402,5 +404,12 @@ public class SimpleCharStream {
		column = bufcolumn[j];
	}

	boolean getTrackLineColumn(){
		return trackLineColumn;
	}

	void setTrackLineColumn(boolean tlc){
		trackLineColumn = tlc;
	}
}
/* JavaCC - OriginalChecksum=42af0fefd9dd6e805cbddca0a6f8ad37 (do not edit this line) */
/* JavaCC - OriginalChecksum=25c201ae6a86f1f10a8af29118337505 (do not edit this line) */
Loading