22 package com.mysql.clusterj.jdbc.antlr;
25 import java.io.FileInputStream;
26 import java.io.IOException;
27 import java.io.InputStreamReader;
29 import org.antlr.runtime.ANTLRStringStream;
30 import org.antlr.runtime.CharStream;
34 transient private String fileName;
50 this.fileName = file.getName();
55 public int LA(
final int i) {
62 if ((p + idx - 1) < 0) {
63 return CharStream.EOF;
67 if ((p + idx - 1) >=
n) {
68 return CharStream.EOF;
70 return Character.toUpperCase(data[p + idx - 1]);
85 private void load(
final File file,
final String encoding)
throws IOException {
89 final int size = (int) file.length();
90 InputStreamReader isr;
92 if (encoding != null) {
93 isr =
new InputStreamReader(fis, encoding);
95 isr =
new InputStreamReader(fis);
98 data =
new char[
size];
99 super.n = isr.read(data);
105 public String getSourceName() {