JSON Value Parser.
More...
|
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...
|
|
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
◆ parser_states
Enumeration for the parser state machine.
- Description
- This type defines a constant for each state that the parser may assume during the process.
Enumerator |
---|
START | initial state
|
array_addItem | a new item for an array has been read
|
array_nextItem | an inter-item delimiter for an array has been read
|
error | error condition detected (pseudostate that launches an exception terminating the process)
|
false_value | a boolean false value constant has been read (pseudostate)
|
null_value | a null value constant has been read (pseudostate)
|
number_int_value | a numeric (integer) value has been read (pseudostate)
|
number_value | a numeric (float) value has been read (pseudostate)
|
property_begin | an object initial delimiter has been read
|
property_name | an object property name has been read
|
property_value | an object property delimiter has been read
|
property_next | an inter-property delimiter for an object has been read
|
string_value | a string value has been read (pseudostate)
|
true_value | a boolean true value constant has been read (pseudostate)
|
END | final state (pseudostate)
|
◆ Value_Parser()
JAULA::Parser::Value_Parser::Value_Parser |
( |
void |
| ) |
|
◆ ~Value_Parser()
JAULA::Parser::Value_Parser::~Value_Parser |
( |
void |
| ) |
|
◆ EOFError()
Analyzes the reason for an EOF condition.
- Parameters
-
lexan | Reference to the lexical analysis instance that reads from the input. |
ex | Syntax error to be thrown detailing why an EOF at this point is an error. |
- Exceptions
-
Exception | As 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().
◆ parseValue()
Value * JAULA::Parser::Value_Parser::parseValue |
( |
Lexan & |
lexan, |
|
|
unsigned int |
token |
|
) |
| |
throw | ( | Exception |
| ) | | |
|
static |
reads a single JSON value
- Parameters
-
lexan | Reference to the lexical analysis instance that reads from the input. |
token | Token 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
-
Exception | An 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: