Argo  1.0
A C++ library for handling JSON.
Public Member Functions | List of all members
argo::lexer Class Reference

A lexical analyser for JSON messages. More...

#include <lexer.hpp>

Public Member Functions

 lexer (reader &r, size_t max_token_length)
 
virtual ~lexer ()
 
const tokennext ()
 
void put_back_last ()
 

Detailed Description

A lexical analyser for JSON messages.

A lexical analyser for JSON messages. Lexemes are generated from source that matches the RFC but note that doesn't mean those lexemes can always be represented as basic C++ types.

Definition at line 41 of file lexer.hpp.

Constructor & Destructor Documentation

lexer::lexer ( reader r,
size_t  max_token_length 
)

New lexer that will read tokens of up to the maximum specified length from the supplied reader.

Definition at line 32 of file lexer.cpp.

lexer::~lexer ( )
virtual

Destructor.

Definition at line 40 of file lexer.cpp.

Member Function Documentation

const token & lexer::next ( )

Read the next token.

Exceptions
json_parser_exceptionif a syntax error is encountered or if the token length exceeds the maximum.
json_io_exceptionin the event of a IO error error of some type when reading the message.

Definition at line 340 of file lexer.cpp.

void lexer::put_back_last ( )

Put back the last token that was read such that a subsequent call to next() will return that token rather than attempting to read a new one from the input.

Definition at line 354 of file lexer.cpp.


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