Method | Description | |
---|---|---|
ObjDecoder ( |
Construct for input stream.
|
|
decode ( string s ) : object | ||
readObj ( ) : object |
Read an object from the stream.
|
Method | Description | |
---|---|---|
complexAdd ( |
||
complexSet ( object obj, |
||
consume ( ) : void |
Consume the current token.
|
|
consume ( int type, string expected ) : void |
Check that the current token matches the specified type, and then consume it.
|
|
consumeId ( string expected ) : string |
Consume the current token as a identifier.
|
|
consumeStr ( string expected ) : string |
Consume the current token as a string literal.
|
|
endOfStmt ( int lastLine ) : void |
Statements can be terminated with a semicolon, end of line or } end of block.
|
|
err ( string msg ) : System.Exception |
Create exception based on tokenizers current line.
|
|
err ( string msg, int line ) : System.Exception |
Create error reporting exception.
|
|
err ( string msg, int line, System ex ) : System.Exception | ||
isEndOfStmt ( int lastLine ) : bool |
Is current token part of the next statement?
|
|
readCollection ( |
collection := list | map
|
|
readComplex ( int line, |
complex := type [fields] fields := "{" field (eos field)* "}" field := name "=" obj
|
|
readComplexAdd ( |
||
readComplexFields ( |
||
readComplexSet ( |
||
readHeader ( ) : void |
header := [using]*
|
|
readList ( |
list := "[" obj ("," obj)* "]"
|
|
readMap ( |
map := "[" mapPair ("," mapPair)* "]" mapPair := obj ":" + obj
|
|
readObj ( |
obj := literal | simple | complex
|
|
readSimple ( int line, |
simple := type "(" str ")"
|
|
readSimpleType ( ) : |
qname := [podName "::"] typeName
|
|
readType ( ) : |
type := listSig | mapSig1 | mapSig2 | qname listSig := type "[]" mapSig1 := type ":" type mapSig2 := "[" type ":" type "]" Note: the mapSig2 with brackets is handled by the method succinctly named readMapTypeOrCollection().
|
|
readType ( bool lbracket ) : |
||
readTypeOrSlotLiteral ( int line, |
typeLiteral := type "#" slotLiteral := type "#" id
|
|
readUsing ( ) : Using |
using := usingPod | usingType | usingAs usingPod := "using" podName usingType := "using" podName::typeName usingAs := "using" podName::typeName "as" name
|
|
toListOfType ( |
Figure out the type of the list: 1) if t was explicit then use it 2) if we have field typed as a list, then use its definition 3) if inferred is false, then drop back to list of Obj 4) If inferred is true then return null and we'll infer the common type
|
|
toMapType ( |
Figure out the map type: 1) if t was explicit then use it (check that it was a map type) 2) if we have field typed as a map , then use its definition 3) if inferred is false, then drop back to Obj:Obj 4) If inferred is true then return null and we'll infer the common key/val types
|
|
verify ( int type, string expected ) : void |
Check that the current token matches the specified type, but do not consume it.
|
public ObjDecoder ( |
||
@in | ||
options | ||
return | System.Collections |