Package org.antlr.v4.runtime

Examples of org.antlr.v4.runtime.CharStream.release()


  @Test(expected = IllegalStateException.class)
  public void testMarkReleaseOutOfOrder() {
    CharStream input = createStream("");
    int m1 = input.mark();
    int m2 = input.mark();
    input.release(m1);
  }

  /**
   * The {@link IntStream} interface does not specify the behavior when a mark
   * is released twice, but {@link UnbufferedCharStream} handles this case by
View Full Code Here


   */
  @Test(expected = IllegalStateException.class)
  public void testMarkReleasedTwice() {
    CharStream input = createStream("");
    int m1 = input.mark();
    input.release(m1);
    input.release(m1);
  }

  /**
   * The {@link IntStream} interface does not specify the behavior when a mark
View Full Code Here

  @Test(expected = IllegalStateException.class)
  public void testMarkReleasedTwice() {
    CharStream input = createStream("");
    int m1 = input.mark();
    input.release(m1);
    input.release(m1);
  }

  /**
   * The {@link IntStream} interface does not specify the behavior when a mark
   * is released twice, but {@link UnbufferedCharStream} handles this case by
View Full Code Here

  @Test(expected = IllegalStateException.class)
  public void testNestedMarkReleasedTwice() {
    CharStream input = createStream("");
    int m1 = input.mark();
    int m2 = input.mark();
    input.release(m2);
    input.release(m2);
  }

  /**
   * It is not valid to pass a mark to {@link IntStream#seek}, but
View Full Code Here

  public void testNestedMarkReleasedTwice() {
    CharStream input = createStream("");
    int m1 = input.mark();
    int m2 = input.mark();
    input.release(m2);
    input.release(m2);
  }

  /**
   * It is not valid to pass a mark to {@link IntStream#seek}, but
   * {@link UnbufferedCharStream} creates marks in such a way that this
View Full Code Here

    assertEquals('d', input.LA(-1));

    input.seek(2);
    assertEquals('b', input.LA(-1));

    input.release(m1);
    input.seek(3);
    assertEquals('c', input.LA(-1));
    // this special case is not required by the IntStream interface, but
    // UnbufferedCharStream allows it so we have to make sure the resulting
    // state is consistent
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.