C# 클래스 Fanx.Serial.Tokenizer

Tokenizer inputs a stream of Unicode characters and outputs tokens for the Fantom serialization grammar.
파일 보기 프로젝트 열기: xored/f4 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
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