C# Class Microsoft.Scripting.Runtime.TokenizerBuffer

Mostra file Open project: jschementi/iron Class Usage Examples

Public Methods

Method Description
Back ( ) : void
DiscardToken ( ) : void

Marks token start. It means the buffer can drop the current token. Can be called even if no token has been read yet.

GetChar ( int offset ) : char
GetCharRelative ( int disp ) : char
GetTokenSubstring ( int offset ) : string
GetTokenSubstring ( int offset, int length ) : string
Initialize ( TextReader reader, SourceLocation initialLocation, int initialCapacity, bool multiEolns ) : void
IsEoln ( int current ) : bool
MarkMultiLineTokenEnd ( ) : void

Marks token end. Enables to read the current token.

MarkMultiLineTokenEnd ( int disp ) : void
MarkSingleLineTokenEnd ( ) : void
MarkSingleLineTokenEnd ( int disp ) : void
MarkTokenEnd ( bool isMultiLine ) : void
Peek ( ) : int
Read ( int ch ) : bool
Read ( string str ) : bool
Read ( ) : int
ReadEolnOpt ( int current ) : int
ReadLine ( ) : int

Reads till the end of line and returns the character that stopped the reading. The returned character is not skipped.

Seek ( int offset ) : void

Sets the current position inside current token or one character behind it.

SeekRelative ( int disp ) : void

Sets the current position inside current token or one character behind it. A relative displacement with respect to the current position in the token is specified.

TokenizerBuffer ( TextReader reader, SourceLocation initialLocation, int initialCapacity, bool multiEolns ) : System

Private Methods

Method Description
CheckInvariants ( ) : void
ClearInvalidChars ( ) : void
DumpToken ( ) : void
GetTokenEndMultiEolns ( ) : SourceLocation
GetTokenEndSingleEoln ( ) : SourceLocation
GetTokenString ( ) : string
RefillBuffer ( ) : void
ResizeInternal ( char &array, int newSize, int start, int count ) : void

Resizes an array to a speficied new size and copies a portion of the original array into its beginning.

Method Details

Back() public method

public Back ( ) : void
return void

DiscardToken() public method

Marks token start. It means the buffer can drop the current token. Can be called even if no token has been read yet.
public DiscardToken ( ) : void
return void

GetChar() public method

public GetChar ( int offset ) : char
offset int
return char

GetCharRelative() public method

public GetCharRelative ( int disp ) : char
disp int
return char

GetTokenSubstring() public method

public GetTokenSubstring ( int offset ) : string
offset int
return string

GetTokenSubstring() public method

public GetTokenSubstring ( int offset, int length ) : string
offset int
length int
return string

Initialize() public method

public Initialize ( TextReader reader, SourceLocation initialLocation, int initialCapacity, bool multiEolns ) : void
reader System.IO.TextReader
initialLocation SourceLocation
initialCapacity int
multiEolns bool
return void

IsEoln() public method

public IsEoln ( int current ) : bool
current int
return bool

MarkMultiLineTokenEnd() public method

Marks token end. Enables to read the current token.
public MarkMultiLineTokenEnd ( ) : void
return void

MarkMultiLineTokenEnd() public method

public MarkMultiLineTokenEnd ( int disp ) : void
disp int
return void

MarkSingleLineTokenEnd() public method

public MarkSingleLineTokenEnd ( ) : void
return void

MarkSingleLineTokenEnd() public method

public MarkSingleLineTokenEnd ( int disp ) : void
disp int
return void

MarkTokenEnd() public method

public MarkTokenEnd ( bool isMultiLine ) : void
isMultiLine bool
return void

Peek() public method

public Peek ( ) : int
return int

Read() public method

public Read ( int ch ) : bool
ch int
return bool

Read() public method

public Read ( string str ) : bool
str string
return bool

Read() public method

public Read ( ) : int
return int

ReadEolnOpt() public method

public ReadEolnOpt ( int current ) : int
current int
return int

ReadLine() public method

Reads till the end of line and returns the character that stopped the reading. The returned character is not skipped.
public ReadLine ( ) : int
return int

Seek() public method

Sets the current position inside current token or one character behind it.
public Seek ( int offset ) : void
offset int
return void

SeekRelative() public method

Sets the current position inside current token or one character behind it. A relative displacement with respect to the current position in the token is specified.
public SeekRelative ( int disp ) : void
disp int
return void

TokenizerBuffer() public method

public TokenizerBuffer ( TextReader reader, SourceLocation initialLocation, int initialCapacity, bool multiEolns ) : System
reader TextReader
initialLocation SourceLocation
initialCapacity int
multiEolns bool
return System