Top Description Fields Methods
org.antlr.v4.runtime

public Interface CharStream

extends IntStream
Known Direct Subinterfaces
org.antlr.v4.runtime.UnicodeCharStream
Known Direct Implementers
org.antlr.v4.runtime.CodePointCharStream, org.antlr.v4.runtime.UnbufferedCharStream, org.antlr.v4.runtime.ANTLRInputStream
Imports
org.antlr.v4.runtime.misc.Interval, .NotNull

A source of characters for an ANTLR lexer.

Field Summary

Inherited from org.antlr.v4.runtime.IntStream:
EOFUNKNOWN_SOURCE_NAME

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the text of the specified interval
getText
(Interval
an interval within the stream
interval
)

This method returns the text for a range of characters within this input stream.

Inherited from org.antlr.v4.runtime.IntStream:
consumegetSourceNameindexLAmarkreleaseseeksize

Method Detail

getTextback to summary
public 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 specified interval lies entirely within a marked range. For more information about marked ranges, see IntStream#mark.

Parameters
interval:Interval

an interval within the stream

Returns:String

the text of the specified interval

Annotations
@NotNull
Exceptions
NullPointerException:
if interval is null
IllegalArgumentException:
if interval.a < 0, or if interval.b < interval.a - 1, or if interval.b lies at or past the end of the stream
UnsupportedOperationException:
if the stream does not support getting the text of the specified interval