C# Класс ProjNet.Converters.WellKnownText.IO.StreamTokenizer

The StreamTokenizer class takes an input stream and parses it into "tokens", allowing the tokens to be read one at a time. The parsing process is controlled by a table and a number of flags that can be set to various states. The stream tokenizer can recognize identifiers, numbers, quoted strings, and various comment style
This is a crude c# implementation of Java's StreamTokenizer class.
Показать файл Открыть проект

Открытые методы

Метод Описание
GetNumericValue ( ) : double

If the current token is a number, this field contains the value of that number.

If the current token is a number, this field contains the value of that number. The current token is a number when the value of the ttype field is TT_NUMBER.

GetStringValue ( ) : string

If the current token is a word token, this field contains a string giving the characters of the word token.

GetTokenType ( ) : TokenType

Gets the token type of the current token.

NextToken ( ) : TokenType

Returns the next token.

NextToken ( bool ignoreWhitespace ) : TokenType

Returns the next token.

StreamTokenizer ( TextReader reader, bool ignoreWhitespace ) : System

Initializes a new instance of the StreamTokenizer class.

Приватные методы

Метод Описание
GetType ( char character ) : TokenType

Determines a characters type (e.g. number, symbols, character).

NextNonWhitespaceToken ( ) : TokenType

Returns next token that is not whitespace.

NextTokenAny ( ) : TokenType

Описание методов

GetNumericValue() публичный Метод

If the current token is a number, this field contains the value of that number.
If the current token is a number, this field contains the value of that number. The current token is a number when the value of the ttype field is TT_NUMBER.
Current token is not a number in a valid format.
public GetNumericValue ( ) : double
Результат double

GetStringValue() публичный Метод

If the current token is a word token, this field contains a string giving the characters of the word token.
public GetStringValue ( ) : string
Результат string

GetTokenType() публичный Метод

Gets the token type of the current token.
public GetTokenType ( ) : TokenType
Результат TokenType

NextToken() публичный Метод

Returns the next token.
public NextToken ( ) : TokenType
Результат TokenType

NextToken() публичный Метод

Returns the next token.
public NextToken ( bool ignoreWhitespace ) : TokenType
ignoreWhitespace bool Determines is whitespace is ignored. True if whitespace is to be ignored.
Результат TokenType

StreamTokenizer() публичный Метод

Initializes a new instance of the StreamTokenizer class.
public StreamTokenizer ( TextReader reader, bool ignoreWhitespace ) : System
reader TextReader A TextReader with some text to read.
ignoreWhitespace bool Flag indicating whether whitespace should be ignored.
Результат System