Package org.antlr.v4.runtime
Class CodePointCharStream.CodePoint8BitCharStream
- java.lang.Object
-
- org.antlr.v4.runtime.CodePointCharStream
-
- org.antlr.v4.runtime.CodePointCharStream.CodePoint8BitCharStream
-
- All Implemented Interfaces:
CharStream
,IntStream
- Enclosing class:
- CodePointCharStream
private static final class CodePointCharStream.CodePoint8BitCharStream extends CodePointCharStream
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
byteArray
-
Fields inherited from class org.antlr.v4.runtime.CodePointCharStream
name, position, size
-
Fields inherited from interface org.antlr.v4.runtime.IntStream
EOF, UNKNOWN_SOURCE_NAME
-
-
Constructor Summary
Constructors Modifier Constructor Description private
CodePoint8BitCharStream(int position, int remaining, java.lang.String name, byte[] byteArray, int arrayOffset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.lang.Object
getInternalStorage()
java.lang.String
getText(Interval interval)
Return the UTF-16 encoded string for the given intervalint
LA(int i)
Gets the value of the symbol at offseti
from the current position.-
Methods inherited from class org.antlr.v4.runtime.CodePointCharStream
consume, fromBuffer, fromBuffer, getSourceName, index, mark, release, seek, size, toString
-
-
-
-
Method Detail
-
getText
public java.lang.String getText(Interval interval)
Return the UTF-16 encoded string for the given interval- Parameters:
interval
- an interval within the stream- Returns:
- the text of the specified interval
-
LA
public int LA(int i)
Description copied from interface:IntStream
Gets the value of the symbol at offseti
from the current position. Wheni==1
, this method returns the value of the current symbol in the stream (which is the next symbol to be consumed). Wheni==-1
, this method returns the value of the previously read symbol in the stream. It is not valid to call this method withi==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
andindex()
returns a value greater than the value ofindex()
after the stream was constructed andLA(1)
was called in that order. Specifying the currentindex()
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 toLA(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 returnsIntStream.EOF
.The return value is unspecified if
i<0
and fewer than-i
calls toconsume()
have occurred from the beginning of the stream before calling this method.
-
getInternalStorage
java.lang.Object getInternalStorage()
- Specified by:
getInternalStorage
in classCodePointCharStream
-
-