// Path: src/adql-validator/src/cds/adql/validation/ValidationException.java
// public class ValidationException extends Exception {
// 
//     public ValidationException() {
//         super();
//     }
// 
//     public ValidationException(String s) {
//         super(s);
//     }
// 
//     public ValidationException(String s, Throwable throwable) {
//         super(s, throwable);
//     }
// 
//     public ValidationException(Throwable throwable) {
//         super(throwable);
//     }
// 
// }
// 
// Path: src/adql-validator/src/cds/adql/validation/query/ValidationQuery.java
// public class ValidationQuery {
// 
//     /** Unique ID of this test in an entire validation tests set. */
//     public final UUID id;
// 
//     /** Human description of this test. */
//     public String description = null;
// 
//     /** The ADQL query to test. */
//     public String query = null;
// 
//     /** Indicate whether the query is expected to be valid or not. */
//     public boolean isValid = false;
// 
//     /** Query's ADQL version target. */
//     public ADQLVersion adqlVersion = ValidationSetParser.DEFAULT_ADQL_VERSION;
// 
//     /**
//      * Create a {@link ValidationQuery} with a generated UUID.
//      */
//     public ValidationQuery(){
//         this((UUID)null);
//     }
// 
//     /**
//      * Create a {@link ValidationQuery} with the given UUID.
//      *
//      * @param id    UUID of this validation test.
//      *              <i>If NULL, one will be automatically generated.</i>
//      */
//     public ValidationQuery(final UUID id){
//         this.id = (id == null) ? UUID.randomUUID() : id;
//     }
// 
//     /**
//      * Create a {@link ValidationQuery} with the given UUID.
//      *
//      * @param id    UUID of this validation test.
//      *              <i>If NULL, one will be automatically generated.</i>
//      */
//     public ValidationQuery(final String id){
//         this.id = (id == null || id.trim().length() == 0) ? UUID.randomUUID() : UUID.fromString(id);
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         final ValidationQuery testQuery = (ValidationQuery) o;
//         return id.equals(testQuery.id);
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(id);
//     }
// 
// }
// 
// Path: src/adql-validator/src/cds/adql/validation/query/ValidationSet.java
// public class ValidationSet {
// 
//     /** Person/Entity to contact in case of question/comment about this set. */
//     public Contact contact = null;
// 
//     /** Person/Entity who published this set. */
//     public Publisher publisher = null;
// 
//     /** Human description of this entire set.*/
//     public String description = null;
// 
//     /** Set of all Validation Tests included inside this set.
//      * <p>
//      *     It contains only unique items: no two {@link ValidationQuery}
//      *     instances have the same UUID.
//      * </p> */
//     public final Set<ValidationQuery> queries = new LinkedHashSet<>(30);
// 
// }


import cds.adql.validation.ValidationException;
import cds.adql.validation.query.ValidationQuery;
import cds.adql.validation.query.ValidationSet;
package cds.adql.validation.report;


public class RecorderListener extends VoidListener {

    int cntPass = 0;
    int cntFail = 0;

    boolean setStarted = false;
    boolean setEnded = false;
    boolean queryStarted = false;
    boolean queryEnded = false;

    final StringBuffer errors   = new StringBuffer();
    final StringBuffer failures = new StringBuffer();

    @Override
    public void clear() {
        cntPass = 0;
        cntFail = 0;

        setStarted   = false;
        setEnded     = false;
        queryStarted = false;
        queryEnded   = false;

        errors.delete(0, errors.length());
        failures.delete(0, failures.length());
    }

    @Override
// Path: src/adql-validator/src/cds/adql/validation/ValidationException.java
// public class ValidationException extends Exception {
// 
//     public ValidationException() {
//         super();
//     }
// 
//     public ValidationException(String s) {
//         super(s);
//     }
// 
//     public ValidationException(String s, Throwable throwable) {
//         super(s, throwable);
//     }
// 
//     public ValidationException(Throwable throwable) {
//         super(throwable);
//     }
// 
// }
// 
// Path: src/adql-validator/src/cds/adql/validation/query/ValidationQuery.java
// public class ValidationQuery {
// 
//     /** Unique ID of this test in an entire validation tests set. */
//     public final UUID id;
// 
//     /** Human description of this test. */
//     public String description = null;
// 
//     /** The ADQL query to test. */
//     public String query = null;
// 
//     /** Indicate whether the query is expected to be valid or not. */
//     public boolean isValid = false;
// 
//     /** Query's ADQL version target. */
//     public ADQLVersion adqlVersion = ValidationSetParser.DEFAULT_ADQL_VERSION;
// 
//     /**
//      * Create a {@link ValidationQuery} with a generated UUID.
//      */
//     public ValidationQuery(){
//         this((UUID)null);
//     }
// 
//     /**
//      * Create a {@link ValidationQuery} with the given UUID.
//      *
//      * @param id    UUID of this validation test.
//      *              <i>If NULL, one will be automatically generated.</i>
//      */
//     public ValidationQuery(final UUID id){
//         this.id = (id == null) ? UUID.randomUUID() : id;
//     }
// 
//     /**
//      * Create a {@link ValidationQuery} with the given UUID.
//      *
//      * @param id    UUID of this validation test.
//      *              <i>If NULL, one will be automatically generated.</i>
//      */
//     public ValidationQuery(final String id){
//         this.id = (id == null || id.trim().length() == 0) ? UUID.randomUUID() : UUID.fromString(id);
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         final ValidationQuery testQuery = (ValidationQuery) o;
//         return id.equals(testQuery.id);
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(id);
//     }
// 
// }
// 
// Path: src/adql-validator/src/cds/adql/validation/query/ValidationSet.java
// public class ValidationSet {
// 
//     /** Person/Entity to contact in case of question/comment about this set. */
//     public Contact contact = null;
// 
//     /** Person/Entity who published this set. */
//     public Publisher publisher = null;
// 
//     /** Human description of this entire set.*/
//     public String description = null;
// 
//     /** Set of all Validation Tests included inside this set.
//      * <p>
//      *     It contains only unique items: no two {@link ValidationQuery}
//      *     instances have the same UUID.
//      * </p> */
//     public final Set<ValidationQuery> queries = new LinkedHashSet<>(30);
// 
// }


// Path: src/adql-validator/test/cds/adql/validation/report/RecorderListener.java
import cds.adql.validation.ValidationException;
import cds.adql.validation.query.ValidationQuery;
import cds.adql.validation.query.ValidationSet;

package cds.adql.validation.report;


public class RecorderListener extends VoidListener {

    int cntPass = 0;
    int cntFail = 0;

    boolean setStarted = false;
    boolean setEnded = false;
    boolean queryStarted = false;
    boolean queryEnded = false;

    final StringBuffer errors   = new StringBuffer();
    final StringBuffer failures = new StringBuffer();

    @Override
    public void clear() {
        cntPass = 0;
        cntFail = 0;

        setStarted   = false;
        setEnded     = false;
        queryStarted = false;
        queryEnded   = false;

        errors.delete(0, errors.length());
        failures.delete(0, failures.length());
    }

    @Override
    public void error(ValidationException error) {