C# Class Antlr4.Runtime.AntlrInputStream

Vacuum all input from a Reader/InputStream and then treat it like a char[] buffer.
Vacuum all input from a Reader/InputStream and then treat it like a char[] buffer. Can also pass in a string or char[] to use. If you need encoding, pass in stream/reader with correct encoding.
Inheritance: ICharStream
显示文件 Open project: antlr/antlr4 Class Usage Examples

Public Properties

Property Type Description
name string

Protected Properties

Property Type Description
data char[]
n int
p int

Public Methods

Method Description
AntlrInputStream ( ) : System
AntlrInputStream ( Stream input ) : System
AntlrInputStream ( Stream input, int initialSize ) : System
AntlrInputStream ( Stream input, int initialSize, int readChunkSize ) : System
AntlrInputStream ( TextReader r ) : System
AntlrInputStream ( TextReader r, int initialSize ) : System
AntlrInputStream ( TextReader r, int initialSize, int readChunkSize ) : System
AntlrInputStream ( char data, int numberOfActualCharsInArray ) : System

This is the preferred constructor for strings as no data is copied

AntlrInputStream ( string input ) : System

Copy data in string to a local char array

Consume ( ) : void
GetText ( Interval interval ) : string
LA ( int i ) : int
Load ( TextReader r, int size, int readChunkSize ) : void
Lt ( int i ) : int
Mark ( ) : int

mark/release do nothing; we have entire buffer

Release ( int marker ) : void
Reset ( ) : void

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

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

Seek ( int index ) : void

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

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

ToString ( ) : string

Method Details

AntlrInputStream() public method

public AntlrInputStream ( ) : System
return System

AntlrInputStream() public method

public AntlrInputStream ( Stream input ) : System
input Stream
return System

AntlrInputStream() public method

public AntlrInputStream ( Stream input, int initialSize ) : System
input Stream
initialSize int
return System

AntlrInputStream() public method

public AntlrInputStream ( Stream input, int initialSize, int readChunkSize ) : System
input Stream
initialSize int
readChunkSize int
return System

AntlrInputStream() public method

public AntlrInputStream ( TextReader r ) : System
r System.IO.TextReader
return System

AntlrInputStream() public method

public AntlrInputStream ( TextReader r, int initialSize ) : System
r System.IO.TextReader
initialSize int
return System

AntlrInputStream() public method

public AntlrInputStream ( TextReader r, int initialSize, int readChunkSize ) : System
r System.IO.TextReader
initialSize int
readChunkSize int
return System

AntlrInputStream() public method

This is the preferred constructor for strings as no data is copied
public AntlrInputStream ( char data, int numberOfActualCharsInArray ) : System
data char
numberOfActualCharsInArray int
return System

AntlrInputStream() public method

Copy data in string to a local char array
public AntlrInputStream ( string input ) : System
input string
return System

Consume() public method

public Consume ( ) : void
return void

GetText() public method

public GetText ( Interval interval ) : string
interval Antlr4.Runtime.Misc.Interval
return string

LA() public method

public LA ( int i ) : int
i int
return int

Load() public method

public Load ( TextReader r, int size, int readChunkSize ) : void
r System.IO.TextReader
size int
readChunkSize int
return void

Lt() public method

public Lt ( int i ) : int
i int
return int

Mark() public method

mark/release do nothing; we have entire buffer
public Mark ( ) : int
return int

Release() public method

public Release ( int marker ) : void
marker int
return void

Reset() public method

Reset the stream so that it's in the same state it was when the object was created *except* the data array is not touched.
Reset the stream so that it's in the same state it was when the object was created *except* the data array is not touched.
public Reset ( ) : void
return void

Seek() public method

consume() ahead until p==index; can't just set p=index as we must update line and charPositionInLine.
consume() ahead until p==index; can't just set p=index as we must update line and charPositionInLine. If we seek backwards, just set p
public Seek ( int index ) : void
index int
return void

ToString() public method

public ToString ( ) : string
return string

Property Details

data protected_oe property

The data being scanned
protected char[] data
return char[]

n protected_oe property

How many characters are actually in the buffer
protected int n
return int

name public_oe property

What is name or source of this char stream?
public string name
return string

p protected_oe property

0..n-1 index into string of next char
protected int p
return int