18 package com.mysql.clusterj.jdbc.antlr;
20 import org.antlr.runtime.RecognitionException;
21 import org.antlr.runtime.BaseRecognizer;
23 import java.util.List;
24 import java.util.ArrayList;
31 private List<RecognitionException> exceptions;
32 private String[] tokenNames;
33 private StringBuilder errorBuffer;
36 super(recognizerErrorDelegate);
37 exceptions =
new ArrayList<RecognitionException>();
49 if (this.tokenNames == null)
50 this.tokenNames = tokenNames;
56 errorBuffer.append(msg);
57 errorBuffer.append(
"--------------------\n");
62 return !exceptions.isEmpty();
67 if (errorBuffer == null) {
68 errorBuffer =
new StringBuilder();
69 for (RecognitionException e : exceptions) {
70 super.displayRecognitionError(tokenNames, e);
73 return errorBuffer.toString();