C# Class _3PA.Lib.JsonParser

TODO: This class is too spcific and must be refactored later... for now it will do
Show file Open project: jcaillon/3P

Public Methods

Method Description
GetList ( ) : string>>>.List

Returns a List of list of key/value pairs...

JsonParser ( string data ) : System

constructor, data is the input string to tokenize call Tokenize() to do the work

PeekAtToken ( int x ) : Token

To use this lexer as an enumerator, peek at the current pos + x token of the list, returns a new TokenEof if can't find

Tokenize ( ) : void

Call this method to actually tokenize the string

Private Methods

Method Description
CreateSymbolToken ( ) : Token
CreateWhitespaceToken ( ) : Token

create a whitespace token (successions of either ' ' or '\t')

GetNext ( ) : Token

returns the next token of the string

GetTokenValue ( ) : string

Returns the current value of the token

PeekAt ( int x ) : char

Peek forward x chars

Read ( ) : void

Read to the next char, indirectly adding the current char (_data[_pos]) to the current token

ReadString ( char strChar ) : void

reads a string " "

ReadWord ( ) : void

reads a word with this format : [a-Z_&]+[\w_-]*((\.[\w_-]*)?){1,}

Method Details

GetList() public method

Returns a List of list of key/value pairs...
public GetList ( ) : string>>>.List
return string>>>.List

JsonParser() public method

constructor, data is the input string to tokenize call Tokenize() to do the work
public JsonParser ( string data ) : System
data string
return System

PeekAtToken() public method

To use this lexer as an enumerator, peek at the current pos + x token of the list, returns a new TokenEof if can't find
public PeekAtToken ( int x ) : Token
x int
return _3PA.MainFeatures.Parser.Token

Tokenize() public method

Call this method to actually tokenize the string
public Tokenize ( ) : void
return void