jaula API Reference version 1.4.0
JAULA::Lexan Class Reference

Lexical Analysis implementation. More...

#include <jaula_lexan.h>

Inheritance diagram for JAULA::Lexan:

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 moron.nosp@m.go66.nosp@m.6@gma.nosp@m.il.c.nosp@m.om

Constructor & Destructor Documentation

◆ Lexan()

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

Constructor.

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

◆ ~Lexan()

virtual JAULA::Lexan::~Lexan ( )
virtual

Destructor.

Member Function Documentation

◆ getErrorReport()

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.

◆ getTokenData()

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.

◆ LexerError()

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

Error report.

Parameters
detailText 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().

◆ yylex()

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

◆ commented

bool JAULA::Lexan::commented
private

Flag for extending language to accept # comments.

◆ pErrorReport

Lexan_Error* JAULA::Lexan::pErrorReport
private

Pointer to the last exception detected.

◆ tokenData

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