Package org.antlr.v4.runtime
Class CodePointCharStream.CodePoint16BitCharStream
java.lang.Object
org.antlr.v4.runtime.CodePointCharStream
org.antlr.v4.runtime.CodePointCharStream.CodePoint16BitCharStream
- All Implemented Interfaces:
CharStream
,IntStream
- Enclosing class:
CodePointCharStream
-
Field Summary
FieldsFields 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
ConstructorsModifierConstructorDescriptionprivate
CodePoint16BitCharStream
(int position, int remaining, String name, char[] charArray, int arrayOffset) -
Method Summary
Methods inherited from class org.antlr.v4.runtime.CodePointCharStream
consume, fromBuffer, fromBuffer, getSourceName, index, mark, release, seek, size, toString
-
Field Details
-
charArray
private final char[] charArray
-
-
Constructor Details
-
CodePoint16BitCharStream
private CodePoint16BitCharStream(int position, int remaining, String name, char[] charArray, int arrayOffset)
-
-
Method Details
-
getText
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
Object getInternalStorage()- Specified by:
getInternalStorage
in classCodePointCharStream
-