jaula API Reference  version 1.4.0
JAULA::Parser::Value_Parser Class Reference

JSON Value Parser. More...

Public Member Functions

 Value_Parser (void)
 Constructor. More...
 
 ~Value_Parser (void)
 Destructor. More...
 

Static Public Member Functions

static ValueparseValue (Lexan &lexan, unsigned int token) throw (Exception)
 reads a single JSON value More...
 

Private Types

enum  parser_states {
  START, array_addItem, array_nextItem, error,
  false_value, null_value, number_int_value, number_value,
  property_begin, property_name, property_value, property_next,
  string_value, true_value, END
}
 Enumeration for the parser state machine. More...
 

Static Private Member Functions

static void EOFError (Lexan &lexan, Syntax_Error const &ex) throw (Exception)
 Analyzes the reason for an EOF condition. More...
 

Detailed Description

JSON Value Parser.

Parses a value from the input stream.
Author
Kombo Morongo moron.nosp@m.go66.nosp@m.6@gma.nosp@m.il.c.nosp@m.om

Constructor & Destructor Documentation

JAULA::Parser::Value_Parser::Value_Parser ( void  )

Constructor.

JAULA::Parser::Value_Parser::~Value_Parser ( void  )

Destructor.

Member Function Documentation

void JAULA::Parser::Value_Parser::EOFError ( Lexan lexan,
Syntax_Error const &  ex 
)
throw (Exception
)
staticprivate

Analyzes the reason for an EOF condition.

Parameters
lexanReference to the lexical analysis instance that reads from the input.
exSyntax error to be thrown detailing why an EOF at this point is an error.
Exceptions
ExceptionAs a result of the execution of this method an exception is thrown with the data conatined in the input parameter or with a JAULA::LEXAN_ERROR type if the EOF is due to an error in the lexical analysis phase.
Description
This method is to be launched whenever an unexpected end of file is encountered. Its implementation includes analyzing if the EOF condition is real or a side effect from a lexical analysis error and chooses to send the Lexan::LexerError Exception or the one received in the input parameter based on this.

References JAULA::Exception::addOrigin().

Value * JAULA::Parser::Value_Parser::parseValue ( Lexan lexan,
unsigned int  token 
)
throw (Exception
)
static

reads a single JSON value

Parameters
lexanReference to the lexical analysis instance that reads from the input.
tokenToken read from the upper level.
  • If this token does not belong to an starting value token, an error condition will arise.
Returns
a pointer to memory taken from the heap containing the value read. If this value belongs to a complex type, all the items that it contains have been recursively parsed.
Exceptions
ExceptionAn exception will be thrown as soon as a lexical or syntax error is found analyzing the stream. The result of printing the exception retrurned through a stream is a human readable text explaining the error found and an approximation of the error line where it occurred.
Description
This method fully reads a whole value from the input or until a syntax or lexical error is found. Upon execution input stream is positioned so that a new token or EOF can be read from the input.

References JAULA::Exception::addOrigin(), and JAULA::Value_String::getData().


The documentation for this class was generated from the following files:


Back to JAULA Project Documentation Page.

Go to JAULA Project Home Page.


Copyright (c) 2007, 2008, 2009 Kombo Morongo.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

API Reference Generated for jaula by

doxygen

jaula project hosted by

SourceForge.net Logo