ANTLRInputStream

Vacuum all input from a {@link Reader}/{@link InputStream} and then treat it like a {@code char[]} buffer. Can also pass in a {@link String} or {@code char[]} to use.

<p>If you need encoding, pass in stream/reader with correct encoding.</p>

Constructors

this
this()
Undocumented in source.
this
this(string input)

Copy data in string to a local char array

this
this(char[] data, size_t numberOfActualCharsInArray)

This is the preferred constructor for strings as no data is copied

this
this(File r)
Undocumented in source.

Members

Functions

LA
dchar LA(int i)

UTF-8 coded character mapped to UTF-32 @uml @override

LT
dchar LT(int i)
Undocumented in source. Be warned that the author may not have intended to support it.
consume
void consume()

@uml @override

getSourceName
string getSourceName()

@uml @override

getText
string getText(Interval interval)

@uml @override

index
size_t index()

@uml @override

load
void load(File r)
Undocumented in source. Be warned that the author may not have intended to support it.
mark
int mark()

mark/release do nothing; we have entire buffer @uml @override

release
void release(int marker)

@uml @override

reset
void reset()

Reset the stream so that it's in the same state it was when the object was created *except* the data array is not touched.

seek
void seek(size_t index)

consume() ahead until index_of_next_character==index; can't just set index_of_next_character=index as we must update line and charPositionInLine. If we seek backwards, just set index_of_next_character @uml @override

size
size_t size()

@uml @override

toString
string toString()

@uml @override

Variables

cp_in_buffer
size_t cp_in_buffer;

How many UCS code_points are actually in the buffer

data
char[] data;

The UTF-8 data being scanned

index_of_next_char
size_t index_of_next_char;

index of next UTF-8 character

name
string name;

What is name or source of this char stream?

Inherited Members

From CharStream

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 specified {@code interval} lies entirely within a marked range. For more information about marked ranges, see {@link IntStream#mark}.

Meta