aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2004-05-15 17:50:09 +0000
committerMark Wielaard <mark@gcc.gnu.org>2004-05-15 17:50:09 +0000
commitf437e359921603b19e22c44b44f6bb64c199b04f (patch)
tree75ae3d60d495fd40291164e2bc465b372a5f2946
parentdc4917425181e331c20a26437d46c79c3cb9885b (diff)
downloadgcc-f437e359921603b19e22c44b44f6bb64c199b04f.zip
gcc-f437e359921603b19e22c44b44f6bb64c199b04f.tar.gz
gcc-f437e359921603b19e22c44b44f6bb64c199b04f.tar.bz2
CharIndexedReader.java: Removed.
* gnu/regexp/CharIndexedReader.java: Removed. * gnu/regexp/REFilterReader.java: Likewise. * gnu/regexp/RETokenLookAhead.java: Likewise. * Makefile.am (ordinary_java_source_files): Remove above classes. * Makefile.in: Regenerated. From-SVN: r81890
-rw-r--r--libjava/ChangeLog8
-rw-r--r--libjava/Makefile.am3
-rw-r--r--libjava/Makefile.in17
-rw-r--r--libjava/gnu/regexp/CharIndexedReader.java142
-rw-r--r--libjava/gnu/regexp/REFilterReader.java117
-rw-r--r--libjava/gnu/regexp/RETokenLookAhead.java68
6 files changed, 14 insertions, 341 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index c9fad86..0d9c144 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,11 @@
+2004-05-15 Mark Wielaard <mark@klomp.org>
+
+ * gnu/regexp/CharIndexedReader.java: Removed.
+ * gnu/regexp/REFilterReader.java: Likewise.
+ * gnu/regexp/RETokenLookAhead.java: Likewise.
+ * Makefile.am (ordinary_java_source_files): Remove above classes.
+ * Makefile.in: Regenerated.
+
2004-05-14 Tom Tromey <tromey@redhat.com>
* gnu/awt/xlib/XGraphics.java (drawImage): Use `XOffScreenImage',
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index ef8a49d..b7383d1 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -2421,13 +2421,11 @@ gnu/java/nio/charset/UTF_8.java \
gnu/regexp/CharIndexed.java \
gnu/regexp/CharIndexedCharArray.java \
gnu/regexp/CharIndexedInputStream.java \
-gnu/regexp/CharIndexedReader.java \
gnu/regexp/CharIndexedString.java \
gnu/regexp/CharIndexedStringBuffer.java \
gnu/regexp/RE.java \
gnu/regexp/REException.java \
gnu/regexp/REFilterInputStream.java \
-gnu/regexp/REFilterReader.java \
gnu/regexp/REMatch.java \
gnu/regexp/REMatchEnumeration.java \
gnu/regexp/RESyntax.java \
@@ -2437,7 +2435,6 @@ gnu/regexp/RETokenBackRef.java \
gnu/regexp/RETokenChar.java \
gnu/regexp/RETokenEnd.java \
gnu/regexp/RETokenEndSub.java \
-gnu/regexp/RETokenLookAhead.java \
gnu/regexp/RETokenOneOf.java \
gnu/regexp/RETokenPOSIX.java \
gnu/regexp/RETokenRange.java \
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index 1afe8dc..2330a68 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -2093,13 +2093,11 @@ gnu/java/nio/charset/UTF_8.java \
gnu/regexp/CharIndexed.java \
gnu/regexp/CharIndexedCharArray.java \
gnu/regexp/CharIndexedInputStream.java \
-gnu/regexp/CharIndexedReader.java \
gnu/regexp/CharIndexedString.java \
gnu/regexp/CharIndexedStringBuffer.java \
gnu/regexp/RE.java \
gnu/regexp/REException.java \
gnu/regexp/REFilterInputStream.java \
-gnu/regexp/REFilterReader.java \
gnu/regexp/REMatch.java \
gnu/regexp/REMatchEnumeration.java \
gnu/regexp/RESyntax.java \
@@ -2109,7 +2107,6 @@ gnu/regexp/RETokenBackRef.java \
gnu/regexp/RETokenChar.java \
gnu/regexp/RETokenEnd.java \
gnu/regexp/RETokenEndSub.java \
-gnu/regexp/RETokenLookAhead.java \
gnu/regexp/RETokenOneOf.java \
gnu/regexp/RETokenPOSIX.java \
gnu/regexp/RETokenRange.java \
@@ -3018,7 +3015,7 @@ libgcj-test.spec.in libgcj.pc.in libgcj.spec.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP_ENV = --best
DIST_SUBDIRS = @DIRLTDL@ testsuite gcj include @DIRLTDL@ gcj include
DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
@@ -3444,16 +3441,14 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/javax/rmi/PortableServer.P .deps/gnu/regexp/CharIndexed.P \
.deps/gnu/regexp/CharIndexedCharArray.P \
.deps/gnu/regexp/CharIndexedInputStream.P \
-.deps/gnu/regexp/CharIndexedReader.P \
.deps/gnu/regexp/CharIndexedString.P \
.deps/gnu/regexp/CharIndexedStringBuffer.P .deps/gnu/regexp/RE.P \
.deps/gnu/regexp/REException.P .deps/gnu/regexp/REFilterInputStream.P \
-.deps/gnu/regexp/REFilterReader.P .deps/gnu/regexp/REMatch.P \
-.deps/gnu/regexp/REMatchEnumeration.P .deps/gnu/regexp/RESyntax.P \
-.deps/gnu/regexp/REToken.P .deps/gnu/regexp/RETokenAny.P \
-.deps/gnu/regexp/RETokenBackRef.P .deps/gnu/regexp/RETokenChar.P \
-.deps/gnu/regexp/RETokenEnd.P .deps/gnu/regexp/RETokenEndSub.P \
-.deps/gnu/regexp/RETokenLookAhead.P .deps/gnu/regexp/RETokenOneOf.P \
+.deps/gnu/regexp/REMatch.P .deps/gnu/regexp/REMatchEnumeration.P \
+.deps/gnu/regexp/RESyntax.P .deps/gnu/regexp/REToken.P \
+.deps/gnu/regexp/RETokenAny.P .deps/gnu/regexp/RETokenBackRef.P \
+.deps/gnu/regexp/RETokenChar.P .deps/gnu/regexp/RETokenEnd.P \
+.deps/gnu/regexp/RETokenEndSub.P .deps/gnu/regexp/RETokenOneOf.P \
.deps/gnu/regexp/RETokenPOSIX.P .deps/gnu/regexp/RETokenRange.P \
.deps/gnu/regexp/RETokenRepeated.P .deps/gnu/regexp/RETokenStart.P \
.deps/gnu/regexp/RETokenWordBoundary.P .deps/gnu/regexp/UncheckedRE.P \
diff --git a/libjava/gnu/regexp/CharIndexedReader.java b/libjava/gnu/regexp/CharIndexedReader.java
deleted file mode 100644
index aa0fa5a..0000000
--- a/libjava/gnu/regexp/CharIndexedReader.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * gnu/regexp/CharIndexedReader.java
- * Copyright (C) 2001 Lee Sau Dan
- * Based on gnu.regexp.CharIndexedInputStream by Wes Biggs
- *
- * This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package gnu.regexp;
-import java.io.Reader;
-import java.io.BufferedReader;
-import java.io.IOException;
-
-// TODO: move(x) shouldn't rely on calling next() x times
-
-class CharIndexedReader implements CharIndexed {
- private static final int BUFFER_INCREMENT = 1024;
- private static final int UNKNOWN = Integer.MAX_VALUE; // value for end
-
- private final BufferedReader br;
- // so that we don't try to reset() right away
- private int index = -1;
-
- private int bufsize = BUFFER_INCREMENT;
-
- private int end = UNKNOWN;
-
- private char cached = OUT_OF_BOUNDS;
-
- // Big enough for a \r\n pair
- // lookBehind[0] = most recent
- // lookBehind[1] = second most recent
- private char[] lookBehind = new char[] { OUT_OF_BOUNDS, OUT_OF_BOUNDS };
-
- CharIndexedReader(Reader reader, int index) {
- if (reader instanceof BufferedReader) {
- br = (BufferedReader) reader;
- } else {
- br = new BufferedReader(reader,BUFFER_INCREMENT);
- }
- next();
- if (index > 0) move(index);
- }
-
- private boolean next() {
- lookBehind[1] = lookBehind[0];
- lookBehind[0] = cached;
-
- if (end == 1) {
- cached = OUT_OF_BOUNDS;
- return false;
- }
- end--; // closer to end
-
- try {
- if (index != -1) {
- br.reset();
- }
- int i = br.read();
- br.mark(bufsize);
- if (i == -1) {
- end = 1;
- cached = OUT_OF_BOUNDS;
- return false;
- }
-
- // convert the byte read into a char
- cached = (char) i;
- index = 1;
- } catch (IOException e) {
- e.printStackTrace();
- cached = OUT_OF_BOUNDS;
- return false;
- }
- return true;
- }
-
- public char charAt(int index) {
- if (index == 0) {
- return cached;
- } else if (index >= end) {
- return OUT_OF_BOUNDS;
- } else if (index >= bufsize) {
- // Allocate more space in the buffer.
- try {
- while (bufsize <= index) bufsize += BUFFER_INCREMENT;
- br.reset();
- br.mark(bufsize);
- br.skip(index-1);
- } catch (IOException e) { }
- } else if (this.index != index) {
- try {
- br.reset();
- br.skip(index-1);
- } catch (IOException e) { }
- } else if (index == -1) {
- return lookBehind[0];
- } else if (index == -2) {
- return lookBehind[1];
- } else if (index < -2) {
- return OUT_OF_BOUNDS;
- }
-
- char ch = OUT_OF_BOUNDS;
-
- try {
- int i = br.read();
- this.index = index+1; // this.index is index of next pos relative to charAt(0)
- if (i == -1) {
- // set flag that next should fail next time?
- end = index;
- return ch;
- }
- ch = (char) i;
- } catch (IOException ie) { }
-
- return ch;
- }
-
- public boolean move(int index) {
- // move read position [index] clicks from 'charAt(0)'
- boolean retval = true;
- while (retval && (index-- > 0)) retval = next();
- return retval;
- }
-
- public boolean isValid() {
- return (cached != OUT_OF_BOUNDS);
- }
-}
diff --git a/libjava/gnu/regexp/REFilterReader.java b/libjava/gnu/regexp/REFilterReader.java
deleted file mode 100644
index 449efcc..0000000
--- a/libjava/gnu/regexp/REFilterReader.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * gnu/regexp/REFilterReader.java
- * Copyright (C) 2001 Lee Sau Dan
- * Based on gnu.regexp.REFilterInputStream by Wes Biggs
- *
- * This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package gnu.regexp;
-import java.io.FilterReader;
-import java.io.Reader;
-
-/**
- * Replaces instances of a given RE with replacement text.
- *
- * @author <A HREF="http://www.csis.hku.hk/~sdlee/">Lee Sau Dan</A>
- * @since gnu.regexp 1.1.0
- */
-
-public class REFilterReader extends FilterReader {
-
- private RE expr;
- private String replace;
- private String buffer;
- private int bufpos;
- private int offset;
- private CharIndexedReader stream;
-
- /**
- * Creates an REFilterReader. When reading from this stream,
- * occurrences of patterns matching the supplied regular expression
- * will be replaced with the supplied replacement text (the
- * metacharacters $0 through $9 may be used to refer to the full
- * match or subexpression matches.
- *
- * @param stream The Reader to be filtered.
- * @param expr The regular expression to search for.
- * @param replace The text pattern to replace matches with.
- */
- public REFilterReader(Reader stream, RE expr, String replace) {
- super(stream);
- this.stream = new CharIndexedReader(stream,0);
- this.expr = expr;
- this.replace = replace;
- }
-
- /**
- * Reads the next character from the stream per the general contract of
- * Reader.read(). Returns -1 on error or end of stream.
- */
- public int read() {
- // If we have buffered replace data, use it.
- if ((buffer != null) && (bufpos < buffer.length())) {
- return (int) buffer.charAt(bufpos++);
- }
-
- // check if input is at a valid position
- if (!stream.isValid()) return -1;
-
- REMatch mymatch = new REMatch(expr.getNumSubs(),offset,0);
- if (expr.match(stream,mymatch)) {
- mymatch.end[0] = mymatch.index;
- mymatch.finish(stream);
- stream.move(mymatch.toString().length());
- offset += mymatch.toString().length();
- buffer = mymatch.substituteInto(replace);
- bufpos = 1;
-
- if (buffer.length() > 0) {
- return buffer.charAt(0);
- }
- }
- char ch = stream.charAt(0);
- if (ch == CharIndexed.OUT_OF_BOUNDS) return -1;
- stream.move(1);
- offset++;
- return ch;
- }
-
- /**
- * Returns false. REFilterReader does not support mark() and
- * reset() methods.
- */
- public boolean markSupported() {
- return false;
- }
-
- /** Reads from the stream into the provided array. */
- public int read(char[] b, int off, int len) {
- int i;
- int ok = 0;
- while (len-- > 0) {
- i = read();
- if (i == -1) return (ok == 0) ? -1 : ok;
- b[off++] = (char) i;
- ok++;
- }
- return ok;
- }
-
- /** Reads from the stream into the provided array. */
- public int read(char[] b) {
- return read(b,0,b.length);
- }
-}
diff --git a/libjava/gnu/regexp/RETokenLookAhead.java b/libjava/gnu/regexp/RETokenLookAhead.java
deleted file mode 100644
index 74a9bfe..0000000
--- a/libjava/gnu/regexp/RETokenLookAhead.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * gnu/regexp/RETokenOneOf.java
- * Copyright (C) 1998-2001 Wes Biggs
- *
- * This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package gnu.regexp;
-
-/**
- * @since gnu.regexp 1.1.3
- * @author Shashank Bapat
- */
-final class RETokenLookAhead extends REToken
-{
- REToken re;
- boolean negative;
-
- RETokenLookAhead(REToken re, boolean negative) throws REException {
- super(0);
- this.re = re;
- this.negative = negative;
- }
-
- boolean match(CharIndexed input, REMatch mymatch)
- {
- REMatch trymatch = (REMatch)mymatch.clone();
- REMatch trymatch1 = (REMatch)mymatch.clone();
- REMatch newMatch = null;
- if (re.match(input, trymatch)) {
- if (negative) return false;
- if (next(input, trymatch1))
- newMatch = trymatch1;
- }
-
- if (newMatch != null) {
- if (negative) return false;
- //else
- mymatch.assignFrom(newMatch);
- return true;
- }
- else { // no match
- if (negative)
- return next(input, mymatch);
- //else
- return false;
- }
- }
-
- void dump(StringBuffer os) {
- os.append("(?");
- os.append(negative ? '!' : '=');
- re.dumpAll(os);
- os.append(')');
- }
-}
-