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)

@uml Copy data in string to a local char array

this
this(char[] data, int numberOfActualCharsInArray)

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

this
this(File r)
Undocumented in source.

Members

Functions

LA
int LA(int i)

@uml @override

LT
int 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
int index()

@uml @override

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

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

release
void release(int marker)

@uml @override

reset
void reset()

@uml 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(int index)

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

size
int size()

@uml @override

toString
string toString()

@uml @override

Static variables

INITIAL_BUFFER_SIZE
int INITIAL_BUFFER_SIZE;
Undocumented in source.
READ_BUFFER_SIZE
int READ_BUFFER_SIZE;
Undocumented in source.

Variables

data
char[] data;

@uml The data being scanned

n
int n;

@uml How many characters are actually in the buffer

name
string name;

@uml What is name or source of this char stream?

p
int p;

@uml 0..n-1 index into string of next char

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