Java.target.apidocs.org.antlr.v4.runtime.ANTLRInputStream.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of antlr4-perf-testsuite Show documentation
Show all versions of antlr4-perf-testsuite Show documentation
The ANTLR 4 grammar compiler.
ANTLRInputStream (ANTLR 4 Runtime (Optimized) 4.7.3 API)
org.antlr.v4.runtime
Class ANTLRInputStream
- java.lang.Object
-
- org.antlr.v4.runtime.ANTLRInputStream
-
- All Implemented Interfaces:
- CharStream, IntStream, UnicodeCharStream
- Direct Known Subclasses:
- ANTLRFileStream
Deprecated.
as of 4.7 Please use CharStreams
interface.
@Deprecated
public class ANTLRInputStream
extends Object
implements UnicodeCharStream, CharStream
Vacuum all input from a Reader
/InputStream
and then treat it
like a char[]
buffer. Can also pass in a String
or
char[]
to use.
If you need encoding, pass in stream/reader with correct encoding.
-
-
Field Summary
Fields
Modifier and Type
Field and Description
protected char[]
data
Deprecated.
The data being scanned
static int
INITIAL_BUFFER_SIZE
Deprecated.
protected int
n
Deprecated.
How many characters are actually in the buffer
String
name
Deprecated.
What is name or source of this char stream?
protected int
p
Deprecated.
0..n-1 index into string of next char
static int
READ_BUFFER_SIZE
Deprecated.
-
Fields inherited from interface org.antlr.v4.runtime.IntStream
EOF, UNKNOWN_SOURCE_NAME
-
Constructor Summary
Constructors
Constructor and Description
ANTLRInputStream()
Deprecated.
ANTLRInputStream(char[] data,
int numberOfActualCharsInArray)
Deprecated.
This is the preferred constructor for strings as no data is copied
ANTLRInputStream(InputStream input)
Deprecated.
ANTLRInputStream(InputStream input,
int initialSize)
Deprecated.
ANTLRInputStream(InputStream input,
int initialSize,
int readChunkSize)
Deprecated.
ANTLRInputStream(Reader r)
Deprecated.
ANTLRInputStream(Reader r,
int initialSize)
Deprecated.
ANTLRInputStream(Reader r,
int initialSize,
int readChunkSize)
Deprecated.
ANTLRInputStream(String input)
Deprecated.
Copy data in string to a local char array
-
Method Summary
Methods
Modifier and Type
Method and Description
void
consume()
Deprecated.
Consumes the current symbol in the stream.
String
getSourceName()
Deprecated.
Gets the name of the underlying symbol source.
String
getText(Interval interval)
Deprecated.
This method returns the text for a range of characters within this input
stream.
int
index()
Deprecated.
Return the current input symbol index 0..n where n indicates the
last symbol has been read.
int
LA(int i)
Deprecated.
Gets the value of the symbol at offset i
from the current
position.
void
load(Reader r,
int size,
int readChunkSize)
Deprecated.
int
LT(int i)
Deprecated.
int
mark()
Deprecated.
mark/release do nothing; we have entire buffer
void
release(int marker)
Deprecated.
This method releases a marked range created by a call to
mark()
.
void
reset()
Deprecated.
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.
void
seek(int index)
Deprecated.
consume() ahead until p==index; can't just set p=index as we must
update line and charPositionInLine.
int
size()
Deprecated.
Returns the total number of symbols in the stream, including a single EOF
symbol.
boolean
supportsUnicodeCodePoints()
Deprecated.
Determines if the current stream supports Unicode code points.
String
toString()
Deprecated.
-
-
Field Detail
-
READ_BUFFER_SIZE
public static final int READ_BUFFER_SIZE
Deprecated.
- See Also:
- Constant Field Values
-
INITIAL_BUFFER_SIZE
public static final int INITIAL_BUFFER_SIZE
Deprecated.
- See Also:
- Constant Field Values
-
data
protected char[] data
Deprecated.
The data being scanned
-
n
protected int n
Deprecated.
How many characters are actually in the buffer
-
p
protected int p
Deprecated.
0..n-1 index into string of next char
-
name
public String name
Deprecated.
What is name or source of this char stream?
-
Constructor Detail
-
ANTLRInputStream
public ANTLRInputStream()
Deprecated.
-
ANTLRInputStream
public ANTLRInputStream(String input)
Deprecated.
Copy data in string to a local char array
-
ANTLRInputStream
public ANTLRInputStream(char[] data,
int numberOfActualCharsInArray)
Deprecated.
This is the preferred constructor for strings as no data is copied
-
ANTLRInputStream
public ANTLRInputStream(Reader r)
throws IOException
Deprecated.
- Throws:
IOException
-
ANTLRInputStream
public ANTLRInputStream(Reader r,
int initialSize)
throws IOException
Deprecated.
- Throws:
IOException
-
ANTLRInputStream
public ANTLRInputStream(Reader r,
int initialSize,
int readChunkSize)
throws IOException
Deprecated.
- Throws:
IOException
-
ANTLRInputStream
public ANTLRInputStream(InputStream input)
throws IOException
Deprecated.
- Throws:
IOException
-
ANTLRInputStream
public ANTLRInputStream(InputStream input,
int initialSize)
throws IOException
Deprecated.
- Throws:
IOException
-
ANTLRInputStream
public ANTLRInputStream(InputStream input,
int initialSize,
int readChunkSize)
throws IOException
Deprecated.
- Throws:
IOException
-
Method Detail
-
load
public void load(Reader r,
int size,
int readChunkSize)
throws IOException
Deprecated.
- Throws:
IOException
-
reset
public void reset()
Deprecated.
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.
-
consume
public void consume()
Deprecated.
Description copied from interface: IntStream
Consumes the current symbol in the stream. This method has the following
effects:
- Forward movement: The value of
index()
before calling this method is less than the value of index()
after calling this method.
- Ordered lookahead: The value of
LA(1)
before
calling this method becomes the value of LA(-1)
after calling
this method.
Note that calling this method does not guarantee that index()
is
incremented by exactly 1, as that would preclude the ability to implement
filtering streams (e.g. CommonTokenStream
which distinguishes
between "on-channel" and "off-channel" tokens).
-
LA
public int LA(int i)
Deprecated.
Description copied from interface: IntStream
Gets the value of the symbol at offset i
from the current
position. When i==1
, this method returns the value of the current
symbol in the stream (which is the next symbol to be consumed). When
i==-1
, this method returns the value of the previously read
symbol in the stream. It is not valid to call this method with
i==0
, but the specific behavior is unspecified because this
method is frequently called from performance-critical code.
This method is guaranteed to succeed if any of the following are true:
i>0
i==-1
and index()
returns a value greater
than the value of index()
after the stream was constructed
and LA(1)
was called in that order. Specifying the current
index()
relative to the index after the stream was created
allows for filtering implementations that do not return every symbol
from the underlying source. Specifying the call to LA(1)
allows for lazily initialized streams.
LA(i)
refers to a symbol consumed within a marked region
that has not yet been released.
If i
represents a position at or beyond the end of the stream,
this method returns IntStream.EOF
.
The return value is unspecified if i<0
and fewer than -i
calls to consume()
have occurred from the beginning of
the stream before calling this method.
-
LT
public int LT(int i)
Deprecated.
-
index
public int index()
Deprecated.
Return the current input symbol index 0..n where n indicates the
last symbol has been read. The index is the index of char to
be returned from LA(1).
-
size
public int size()
Deprecated.
Description copied from interface: IntStream
Returns the total number of symbols in the stream, including a single EOF
symbol.
-
mark
public int mark()
Deprecated.
mark/release do nothing; we have entire buffer
-
release
public void release(int marker)
Deprecated.
Description copied from interface: IntStream
This method releases a marked range created by a call to
mark()
. Calls to release()
must appear in the
reverse order of the corresponding calls to mark()
. If a mark is
released twice, or if marks are not released in reverse order of the
corresponding calls to mark()
, the behavior is unspecified.
For more information and an example, see IntStream.mark()
.
- Specified by:
release
in interface IntStream
- Parameters:
marker
- A marker returned by a call to mark()
.- See Also:
IntStream.mark()
-
seek
public void seek(int index)
Deprecated.
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
-
getText
public String getText(Interval interval)
Deprecated.
Description copied from interface: CharStream
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()
.
- Specified by:
getText
in interface CharStream
- Parameters:
interval
- an interval within the stream
- Returns:
- the text of the specified interval
-
getSourceName
public String getSourceName()
Deprecated.
Description copied from interface: IntStream
Gets the name of the underlying symbol source. This method returns a
non-null, non-empty string. If such a name is not known, this method
returns IntStream.UNKNOWN_SOURCE_NAME
.
- Specified by:
getSourceName
in interface IntStream
-
supportsUnicodeCodePoints
public boolean supportsUnicodeCodePoints()
Deprecated.
Determines if the current stream supports Unicode code points.
- Specified by:
supportsUnicodeCodePoints
in interface UnicodeCharStream
- Returns:
true
if the current input stream supports Unicode code
points; otherwise, false
if the current input stream returns
UTF-16 code units for code points above U+FFFF.
Copyright © 1992–2019 Tunnel Vision Laboratories, LLC. All rights reserved.