OSDN Git Service

Merged gcj-eclipse branch to trunk.
[pf3gnuchains/gcc-fork.git] / libjava / classpath / gnu / java / util / regex / RETokenEnd.java
index 00efdb6..294e320 100644 (file)
@@ -45,6 +45,12 @@ final class RETokenEnd extends REToken {
   private String newline;
   private boolean check_java_line_terminators;
 
+  /**
+   * Indicates whether this token is a real one generated at compile time,
+   * or a fake one temporarily added by RE#getMatchImpl.
+   */
+  private boolean fake = false;
+
   RETokenEnd(int subIndex,String newline) { 
     super(subIndex);
     this.newline = newline;
@@ -57,10 +63,19 @@ final class RETokenEnd extends REToken {
     this.check_java_line_terminators = b;
   }
 
+  void setFake(boolean fake) {
+    this.fake = fake;
+  }
+
   int getMaximumLength() {
     return 0;
   }
 
+  boolean match(CharIndexed input, REMatch mymatch) {
+    if (!fake) return super.match(input, mymatch);
+    return super.matchFake(input, mymatch);
+  }
+
     REMatch matchThis(CharIndexed input, REMatch mymatch) {
        char ch = input.charAt(mymatch.index);
        if (ch == CharIndexed.OUT_OF_BOUNDS)