JAULA::Lexan Class Reference
[JAULA: JSON lexical analysis]

Lexical Analysis implementation. More...

#include <jaula_lexan.h>


Public Member Functions

Lexan_Error const * getErrorReport (void) const
 Retrieves details for the last error detected.
std::string const & getTokenData (void) const
 Retrieves last token associated data.
 Lexan (std::istream &in_stream, bool comments_allowed=false)
 Constructor.
virtual void LexerError (const char *detail)
 Error report.
virtual int yylex ()
 Retrieves tokens from the input.
virtual ~Lexan ()
 Destructor.

Private Attributes

bool commented
 Flag for extending language to accept # comments.
Lexan_ErrorpErrorReport
 Pointer to the last exception detected.
std::string tokenData
 Container for the token associated data.


Detailed Description

Lexical Analysis implementation.

This class implements the lexical analysis for JSON as specified by RFC 4627.
Author:
Kombo Morongo <morongo666@gmail.com>

Constructor & Destructor Documentation

JAULA::Lexan::Lexan ( std::istream &  in_stream,
bool  comments_allowed = false 
)

Constructor.

Parameters:
in_stream stream for the input data to analyze
comments_allowed flag to extend basic format and allow for hash symbol '#' starting comments in input.
Description
Creates a lexical analysis instance for the specified input stream.

virtual JAULA::Lexan::~Lexan (  )  [virtual]

Destructor.


Member Function Documentation

Lexan_Error const* JAULA::Lexan::getErrorReport ( void   )  const

Retrieves details for the last error detected.

Returns:
a pointer to an instance containing the details for the last error detected during the lexical analysis process or a null pointer in case no error have ocurred during the lexical analysis so far.

std::string const& JAULA::Lexan::getTokenData ( void   )  const

Retrieves last token associated data.

Returns:
the data associated for the last token returned from yylex() in case there is such kind of data (token corresponds to a property name or a single value) or undefined otherwise.

virtual void JAULA::Lexan::LexerError ( const char *  detail  )  [virtual]

Error report.

Parameters:
detail Text for the error received
Description
This method is a callback used by the analysis routines to indicate an error condition.
Its current implementation consists of generating the exception instance to be retrieved by getErrorReport().

virtual int JAULA::Lexan::yylex (  )  [virtual]

Retrieves tokens from the input.

Returns:
the code for a token read or 0 if the end of data has been reached.

Referenced by JAULA::Parser::parseStream().


Field Documentation

bool JAULA::Lexan::commented [private]

Flag for extending language to accept # comments.

Pointer to the last exception detected.

std::string JAULA::Lexan::tokenData [private]

Container for the token associated data.


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


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