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 String
getText(Interval interval)
This method returns the text for a range of characters within this input stream.
-
-
-
Method Detail
-
getText
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:
NullPointerException
- ifinterval
isnull
IllegalArgumentException
- ifinterval.a < 0
, or ifinterval.b < interval.a - 1
, or ifinterval.b
lies at or past the end of the streamUnsupportedOperationException
- if the stream does not support getting the text of the specified interval
-
-