C# Класс Fanx.Serial.Tokenizer

Tokenizer inputs a stream of Unicode characters and outputs tokens for the Fantom serialization grammar.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
m_in Fan.Sys.InStream
m_line int
m_type int
m_val object

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

Метод Описание
Tokenizer ( InStream @in ) : System.Text

Construct for specified input stream.

err ( string msg ) : System.Exception
next ( ) : int

Read the next token from the stream. The token is available via the 'type' and 'val' fields. The line of the current token is available in 'line' field. Return the 'type' field or -1 if at end of stream.

reset ( int type, object val, int line ) : int

Reset the current token state.

undo ( int type, object val, int line ) : void

Pushback a token which will be the next read.

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

Метод Описание
Tokenizer ( ) : System.Text
ch ( ) : int

Parse a char literal token (as Long literal).

consume ( ) : void
doNext ( ) : int

Read the next token, set the 'val' field but return type without worrying setting the 'type' field.

escape ( ) : char

Parse an escapse sequence which starts with a \

hex ( ) : int

Process hex int/long literal starting with 0x

hex ( int c ) : int
id ( ) : int

Parse an identifier: alpha (alpha|number)*

number ( bool neg ) : int

Parse a number literal token.

skipCommentML ( ) : Token

Skip a multi line /* comment. Note unlike C/Java, slash/star comments can be nested.

skipCommentSL ( ) : Token

Skip a single line // comment

str ( ) : int

Parse a string literal token.

uri ( ) : int

Parse a uri literal token.

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

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

Construct for specified input stream.
public Tokenizer ( InStream @in ) : System.Text
@in Fan.Sys.InStream
Результат System.Text

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

public err ( string msg ) : System.Exception
msg string
Результат System.Exception

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

Read the next token from the stream. The token is available via the 'type' and 'val' fields. The line of the current token is available in 'line' field. Return the 'type' field or -1 if at end of stream.
public next ( ) : int
Результат int

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

Reset the current token state.
public reset ( int type, object val, int line ) : int
type int
val object
line int
Результат int

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

Pushback a token which will be the next read.
public undo ( int type, object val, int line ) : void
type int
val object
line int
Результат void

Описание свойств

m_in публичное свойство

public InStream,Fan.Sys m_in
Результат Fan.Sys.InStream

m_line публичное свойство

public int m_line
Результат int

m_type публичное свойство

public int m_type
Результат int

m_val публичное свойство

public object m_val
Результат object