Package | org.antlr.runtime |
Class | public class ANTLRStringStream |
Implements | CharStream |
Subclasses | ANTLRFileStream |
Property | Defined 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 |
Property | Defined 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 |
Method | Defined 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 |
_charPositionInLine | property |
protected var _charPositionInLine:int = 0
The index of the character relative to the beginning of the line 0..n-1
charPositionInLine | property |
charPositionInLine:int
[read-write]Implementation
public function get charPositionInLine():int
public function set charPositionInLine(value:int):void
data | property |
protected var data:String
The data being scanned
index | property |
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
lastMarker | property |
protected var lastMarker:int
Track the last mark() call result value for use in rewind().
_line | property |
protected var _line:int = 1
line number 1..n within the input
line | property |
line:int
[read-write]Implementation
public function get line():int
public function set line(value:int):void
_lineDelimiter | property |
protected var _lineDelimiter:String
markDepth | property |
protected var markDepth:int = 0
tracks how deep mark() calls are nested
markers | property |
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
n | property |
protected var n:int
How many characters are actually in the buffer
p | property |
protected var p:int = 0
0..n-1 index into string of next char
size | property |
size:int
[read-only]Implementation
public function get size():int
_sourceName | property |
protected var _sourceName:String
sourceName | property |
sourceName:String
[read-write]Implementation
public function get sourceName():String
public function set sourceName(value:String):void
ANTLRStringStream | () | constructor |
public function ANTLRStringStream(input:String = null, lineDelimiter:String = "
")
Copy data in string to a local char array
Parametersinput:String (default = null )
|
|
lineDelimiter:String (default = "
")
|
consume | () | method |
public function consume():void
LA | () | method |
public function LA(i:int):int
Parameters
i:int |
int |
LT | () | method |
public function LT(i:int):int
Parameters
i:int |
int |
mark | () | method |
public function mark():int
Returns
int |
release | () | method |
public function release(marker:int):void
Parameters
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):void
Parameters
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.
Parametersindex:int |
substring | () | method |
public function substring(start:int, stop:int):String
Parameters
start:int |
|
stop:int |
String |