Package | org.antlr.runtime |
Interface | public interface CharStream extends IntStream |
Implementors | ANTLRStringStream |
Property | Defined by | ||
---|---|---|---|
charPositionInLine : int The index of the character relative to the beginning of the line 0..n-1
| CharStream | ||
![]() | index : int Return the current input symbol index 0..n where n indicates the
last symbol has been read.
| IntStream | |
line : int ANTLR tracks the line information automatically
| CharStream | ||
![]() | size : int Only makes sense for streams that buffer everything up probably, but
might be useful to display the entire stream or for testing.
| IntStream | |
![]() | sourceName : String Where are you getting symbols from? Normally, implementations will
pass the buck all the way to the lexer who can ask its input stream
for the file name or whatever.
| IntStream |
Method | Defined by | ||
---|---|---|---|
![]() |
consume():void
| IntStream | |
![]() |
LA(i:int):int
Get int at current input pointer + i ahead where i=1 is next int.
| IntStream | |
LT(i:int):int
Get the ith character of lookahead.
| CharStream | ||
![]() |
mark():int
Tell the stream to start buffering if it hasn't already.
| IntStream | |
![]() |
release(marker:int):void
You may want to commit to a backtrack but don't want to force the
stream to keep bookkeeping objects around for a marker that is
no longer necessary.
| IntStream | |
![]() |
rewind():void
Rewind to the input position of the last marker.
| IntStream | |
![]() |
rewindTo(marker:int):void
Reset the stream so that next call to index would return marker.
| IntStream | |
![]() |
seek(index:int):void
Set the input cursor to the position indicated by index.
| IntStream | |
substring(start:int, stop:int):String
For infinite streams, you don't need this; primarily I'm providing
a useful interface for action code.
| CharStream |
charPositionInLine | property |
charPositionInLine:int
[read-write]The index of the character relative to the beginning of the line 0..n-1
Implementation public function get charPositionInLine():int
public function set charPositionInLine(value:int):void
line | property |
line:int
[read-write]ANTLR tracks the line information automatically
Implementation public function get line():int
public function set line(value:int):void
LT | () | method |
public function LT(i:int):int
Get the ith character of lookahead. This is the same usually as LA(i). This will be used for labels in the generated lexer code. I'd prefer to return a char here type-wise, but it's probably better to be 32-bit clean and be consistent with LA.
Parametersi:int |
int |
substring | () | method |
public function substring(start:int, stop:int):String
For infinite streams, you don't need this; primarily I'm providing a useful interface for action code. Just make sure actions don't use this on streams that don't support it.
Parametersstart:int |
|
stop:int |
String |