C# Class Jurassic.Library.JSONParser

Converts a series of JSON tokens into a JSON object.
Afficher le fichier Open project: paulbartrum/jurassic Class Usage Examples

Méthodes publiques

Méthode Description
JSONParser ( ScriptEngine engine, JSONLexer lexer ) : System

Creates a JSONParser instance with the given lexer supplying the tokens.

Parse ( ) : object

Parses the JSON text (optionally applying the reviver function) and returns the resulting value.

Private Methods

Méthode Description
Consume ( ) : void

Discards the current token and reads the next one.

Expect ( Jurassic.Compiler.Token token ) : void

Indicates that the next token is identical to the given one. Throws an exception if this is not the case. Consumes the token.

ExpectIdentifier ( ) : string

Indicates that the next token should be an identifier. Throws an exception if this is not the case. Consumes the token.

ParseArrayLiteral ( ) : ArrayInstance

Parses an array literal (e.g. "[1, 2]").

ParseObjectLiteral ( ) : ObjectInstance

Parses an object literal (e.g. "{a: 5}").

ParseValue ( ) : object

Parses a value.

Method Details

JSONParser() public méthode

Creates a JSONParser instance with the given lexer supplying the tokens.
public JSONParser ( ScriptEngine engine, JSONLexer lexer ) : System
engine ScriptEngine The associated script engine.
lexer JSONLexer The lexical analyser that provides the tokens.
Résultat System

Parse() public méthode

Parses the JSON text (optionally applying the reviver function) and returns the resulting value.
public Parse ( ) : object
Résultat object