jaula_parse.h
/*
* jaula_parse.h : JSON Analysis User Library Acronym
* JSON data parser
*
* Copyright (C) 2007, 2008, 2009 Kombo Morongo <morongo666@gmail.com>
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
* svn info:
* $Author: morongo $
* $HeadURL: https://jaula.svn.sourceforge.net/svnroot/jaula/tags/jaula-1.4.0/jaula/jaula_parse.h $
* $Id: jaula_parse.h 45 2009-01-11 16:17:03Z morongo $
* $Revision: 45 $
*/
#ifndef _JAULA_PARSE_H_
#define _JAULA_PARSE_H_
#include <jaula/jaula_lexan.h>
#include <jaula/jaula_syntax_error.h>
#include <jaula/jaula_value_complex.h>
namespace JAULA
{ // namespace JAULA
class Parser
{ // class Parser
public:
Parser(void);
~Parser(void);
static Value_Complex *parseStream(std::istream &inpStream
, bool comments_allowed = false
, bool full_read = true
) throw(Exception);
private:
class Value_Parser
{ // class Value_Parser
public:
Value_Parser(void);
~Value_Parser(void);
static Value *parseValue(Lexan &lexan, unsigned int token)
throw(Exception);
private:
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
}; //enum parser_states
static void EOFError(Lexan &lexan, Syntax_Error const &ex)
throw(Exception);
}; // class Value_Parser
}; // class Parser
} // namespace JAULA
#endif
// EOF $Id: jaula_parse.h 45 2009-01-11 16:17:03Z morongo $
JAULA::Exception
Base class for error handling exceptions.
Definition jaula_exception.h:54
JAULA::Lexan
Lexical Analysis implementation.
Definition jaula_lexan.h:84
JAULA::Parser::Value_Parser::parser_states
parser_states
Enumeration for the parser state machine.
Definition jaula_parse.h:180
JAULA::Parser::Value_Parser::property_begin
@ property_begin
Definition jaula_parse.h:201
JAULA::Parser::Value_Parser::property_next
@ property_next
Definition jaula_parse.h:207
JAULA::Parser::Value_Parser::number_value
@ number_value
Definition jaula_parse.h:199
JAULA::Parser::Value_Parser::array_addItem
@ array_addItem
Definition jaula_parse.h:184
JAULA::Parser::Value_Parser::string_value
@ string_value
Definition jaula_parse.h:209
JAULA::Parser::Value_Parser::true_value
@ true_value
Definition jaula_parse.h:211
JAULA::Parser::Value_Parser::null_value
@ null_value
Definition jaula_parse.h:195
JAULA::Parser::Value_Parser::property_name
@ property_name
Definition jaula_parse.h:203
JAULA::Parser::Value_Parser::END
@ END
Definition jaula_parse.h:213
JAULA::Parser::Value_Parser::property_value
@ property_value
Definition jaula_parse.h:205
JAULA::Parser::Value_Parser::START
@ START
Definition jaula_parse.h:182
JAULA::Parser::Value_Parser::array_nextItem
@ array_nextItem
Definition jaula_parse.h:186
JAULA::Parser::Value_Parser::error
@ error
Definition jaula_parse.h:191
JAULA::Parser::Value_Parser::false_value
@ false_value
Definition jaula_parse.h:193
JAULA::Parser::Value_Parser::number_int_value
@ number_int_value
Definition jaula_parse.h:197
JAULA::Parser::Value_Parser::EOFError
static void EOFError(Lexan &lexan, Syntax_Error const &ex)
Analyzes the reason for an EOF condition.
Definition jaula_parse.cc:562
JAULA::Parser::Value_Parser::parseValue
static Value * parseValue(Lexan &lexan, unsigned int token)
reads a single JSON value
Definition jaula_parse.cc:117
JAULA::Parser::Value_Parser::Value_Parser
Value_Parser(void)
Constructor.
Definition jaula_parse.cc:111
JAULA::Parser::Value_Parser::~Value_Parser
~Value_Parser(void)
Destructor.
Definition jaula_parse.cc:114
JAULA::Parser::parseStream
static Value_Complex * parseStream(std::istream &inpStream, bool comments_allowed=false, bool full_read=true)
Parses JSON data from a stream.
Definition jaula_parse.cc:72
JAULA::Parser::Parser
Parser(void)
Constructor.
Definition jaula_parse.cc:66
JAULA::Parser::~Parser
~Parser(void)
Destructor.
Definition jaula_parse.cc:69
JAULA::Syntax_Error
class for syntax exceptions
Definition jaula_syntax_error.h:53
JAULA::Value_Complex
Base class for handling complex values.
Definition jaula_value_complex.h:53
JAULA::Value
Base class for handling values.
Definition jaula_value.h:53
JAULA
Namespace for all library definitions.
Definition jaula.h:439

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".

SourceForge.net