Package org.antlr.v4.runtime
Interface CharStream
-
- All Superinterfaces:
IntStream
- All Known Implementing Classes:
ANTLRFileStream
,ANTLRInputStream
,CodePointCharStream
,UnbufferedCharStream
public interface CharStream extends IntStream
A source of characters for an ANTLR lexer.
-
-
Field Summary
-
Fields inherited from interface org.antlr.v4.runtime.IntStream
EOF, UNKNOWN_SOURCE_NAME
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getText(Interval interval)
This method returns the text for a range of characters within this input stream.
-
-
-
Method Detail
-
getText
java.lang.String getText(Interval interval)
This method returns the text for a range of characters within this input stream. This method is guaranteed to not throw an exception if the specifiedinterval
lies entirely within a marked range. For more information about marked ranges, seeIntStream.mark()
.- Parameters:
interval
- an interval within the stream- Returns:
- the text of the specified interval
- Throws:
java.lang.NullPointerException
- ifinterval
isnull
java.lang.IllegalArgumentException
- ifinterval.a < 0
, or ifinterval.b < interval.a - 1
, or ifinterval.b
lies at or past the end of the streamjava.lang.UnsupportedOperationException
- if the stream does not support getting the text of the specified interval
-
-