Packageorg.antlr.runtime
Classpublic class ANTLRStringStream
ImplementsCharStream
SubclassesANTLRFileStream



Public Properties
 PropertyDefined by
  charPositionInLine : int
ANTLRStringStream
  index : int
[read-only] Return the current input symbol index 0..n where n indicates the last symbol has been read.
ANTLRStringStream
  line : int
ANTLRStringStream
  size : int
[read-only]
ANTLRStringStream
  sourceName : String
ANTLRStringStream
Protected Properties
 PropertyDefined by
  _charPositionInLine : int = 0
The index of the character relative to the beginning of the line 0..n-1
ANTLRStringStream
  data : String
The data being scanned
ANTLRStringStream
  lastMarker : int
Track the last mark() call result value for use in rewind().
ANTLRStringStream
  _line : int = 1
line number 1..n within the input
ANTLRStringStream
  _lineDelimiter : String
ANTLRStringStream
  markDepth : int = 0
tracks how deep mark() calls are nested
ANTLRStringStream
  markers : Array
A list of CharStreamState objects that tracks the stream state values line, charPositionInLine, and p that can change as you move through the input stream.
ANTLRStringStream
  n : int
How many characters are actually in the buffer
ANTLRStringStream
  p : int = 0
0..n-1 index into string of next char
ANTLRStringStream
  _sourceName : String
ANTLRStringStream
Public Methods
 MethodDefined by
  
ANTLRStringStream(input:String = null, lineDelimiter:String = " ")
Copy data in string to a local char array
ANTLRStringStream
  
consume():void
ANTLRStringStream
  
LA(i:int):int
ANTLRStringStream
  
LT(i:int):int
ANTLRStringStream
  
mark():int
ANTLRStringStream
  
release(marker:int):void
ANTLRStringStream
  
reset():void
Reset the stream so that it's in the same state it was when the object was created xceptthe data array is not touched.
ANTLRStringStream
  
rewind():void
ANTLRStringStream
  
rewindTo(m:int):void
ANTLRStringStream
  
seek(index:int):void
consume() ahead until p==index; can't just set p=index as we must update line and charPositionInLine.
ANTLRStringStream
  
substring(start:int, stop:int):String
ANTLRStringStream
Property detail
_charPositionInLineproperty
protected var _charPositionInLine:int = 0

The index of the character relative to the beginning of the line 0..n-1

charPositionInLineproperty 
charPositionInLine:int  [read-write]Implementation
    public function get charPositionInLine():int
    public function set charPositionInLine(value:int):void
dataproperty 
protected var data:String

The data being scanned

indexproperty 
index:int  [read-only]

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

Implementation
    public function get index():int
lastMarkerproperty 
protected var lastMarker:int

Track the last mark() call result value for use in rewind().

_lineproperty 
protected var _line:int = 1

line number 1..n within the input

lineproperty 
line:int  [read-write]Implementation
    public function get line():int
    public function set line(value:int):void
_lineDelimiterproperty 
protected var _lineDelimiter:String
markDepthproperty 
protected var markDepth:int = 0

tracks how deep mark() calls are nested

markersproperty 
protected var markers:Array

A list of CharStreamState objects that tracks the stream state values line, charPositionInLine, and p that can change as you move through the input stream. Indexed from 1..markDepth. A null is kept

nproperty 
protected var n:int

How many characters are actually in the buffer

pproperty 
protected var p:int = 0

0..n-1 index into string of next char

sizeproperty 
size:int  [read-only]Implementation
    public function get size():int
_sourceNameproperty 
protected var _sourceName:String
sourceNameproperty 
sourceName:String  [read-write]Implementation
    public function get sourceName():String
    public function set sourceName(value:String):void
Constructor detail
ANTLRStringStream()constructor
public function ANTLRStringStream(input:String = null, lineDelimiter:String = " ")

Copy data in string to a local char array

Parameters
input:String (default = null)
 
lineDelimiter:String (default = " ")
Method detail
consume()method
public function consume():void
LA()method 
public function LA(i:int):intParameters
i:int

Returns
int
LT()method 
public function LT(i:int):intParameters
i:int

Returns
int
mark()method 
public function mark():int

Returns
int
release()method 
public function release(marker:int):voidParameters
marker:int
reset()method 
public function reset():void

Reset the stream so that it's in the same state it was when the object was created xceptthe data array is not touched.

rewind()method 
public function rewind():void
rewindTo()method 
public function rewindTo(m:int):voidParameters
m:int
seek()method 
public function seek(index:int):void

consume() ahead until p==index; can't just set p=index as we must update line and charPositionInLine.

Parameters
index:int
substring()method 
public function substring(start:int, stop:int):StringParameters
start:int
 
stop:int

Returns
String