Search in sources :

Example 16 with Interval

use of org.antlr.v4.runtime.misc.Interval in project antlr4 by antlr.

the class TestUnbufferedCharStream method testGetTextBeforeBufferStart.

@Test(expected = UnsupportedOperationException.class)
public void testGetTextBeforeBufferStart() {
    CharStream input = createStream("xyz");
    input.consume();
    int m1 = input.mark();
    assertEquals(1, input.index());
    input.getText(new Interval(0, 1));
}
Also used : CharStream(org.antlr.v4.runtime.CharStream) UnbufferedCharStream(org.antlr.v4.runtime.UnbufferedCharStream) Interval(org.antlr.v4.runtime.misc.Interval) Test(org.junit.Test)

Aggregations

Interval (org.antlr.v4.runtime.misc.Interval)14 IntervalSet (org.antlr.v4.runtime.misc.IntervalSet)5 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)3 ATNState (org.antlr.v4.runtime.atn.ATNState)3 AtomTransition (org.antlr.v4.runtime.atn.AtomTransition)3 DecisionState (org.antlr.v4.runtime.atn.DecisionState)3 SetTransition (org.antlr.v4.runtime.atn.SetTransition)3 Transition (org.antlr.v4.runtime.atn.Transition)3 Test (org.junit.Test)3 LinkedHashMap (java.util.LinkedHashMap)2 CharStream (org.antlr.v4.runtime.CharStream)2 UnbufferedCharStream (org.antlr.v4.runtime.UnbufferedCharStream)2 RangeTransition (org.antlr.v4.runtime.atn.RangeTransition)2 IntegerList (org.antlr.v4.runtime.misc.IntegerList)2 Program (boa.compiler.ast.Program)1 Start (boa.compiler.ast.Start)1 BoaErrorListener (boa.compiler.listeners.BoaErrorListener)1 LexerErrorListener (boa.compiler.listeners.LexerErrorListener)1 ParserErrorListener (boa.compiler.listeners.ParserErrorListener)1