Packageorg.antlr.runtime
Interfacepublic interface CharStream extends IntStream
ImplementorsANTLRStringStream

A source of characters for an ANTLR lexer



Public Properties
 PropertyDefined by
  charPositionInLine : int
The index of the character relative to the beginning of the line 0..n-1
CharStream
 Inheritedindex : 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
 Inheritedsize : int
Only makes sense for streams that buffer everything up probably, but might be useful to display the entire stream or for testing.
IntStream
 InheritedsourceName : 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
Public Methods
 MethodDefined by
 Inherited
consume():void
IntStream
 Inherited
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
 Inherited
mark():int
Tell the stream to start buffering if it hasn't already.
IntStream
 Inherited
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
 Inherited
rewind():void
Rewind to the input position of the last marker.
IntStream
 Inherited
rewindTo(marker:int):void
Reset the stream so that next call to index would return marker.
IntStream
 Inherited
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
Property detail
charPositionInLineproperty
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
lineproperty 
line:int  [read-write]

ANTLR tracks the line information automatically

Implementation
    public function get line():int
    public function set line(value:int):void
Method detail
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.

Parameters
i:int

Returns
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.

Parameters
start:int
 
stop:int

Returns
String