![]() |
This is Unofficial EPICS BASE Doxygen Site
|
#include "yajl_common.h"
Go to the source code of this file.
Typedefs | |
typedef struct yajl_lexer_t * | yajl_lexer |
Functions | |
yajl_lexer | yajl_lex_alloc (yajl_alloc_funcs *alloc, unsigned int allowComments, unsigned int validateUTF8) |
void | yajl_lex_free (yajl_lexer lexer) |
yajl_tok | yajl_lex_lex (yajl_lexer lexer, const unsigned char *jsonText, size_t jsonTextLen, size_t *offset, const unsigned char **outBuf, size_t *outLen) |
yajl_tok | yajl_lex_peek (yajl_lexer lexer, const unsigned char *jsonText, size_t jsonTextLen, size_t offset) |
const char * | yajl_lex_error_to_string (yajl_lex_error error) |
yajl_lex_error | yajl_lex_get_error (yajl_lexer lexer) |
size_t | yajl_lex_current_offset (yajl_lexer lexer) |
size_t | yajl_lex_current_line (yajl_lexer lexer) |
size_t | yajl_lex_current_char (yajl_lexer lexer) |
typedef struct yajl_lexer_t* yajl_lexer |
Definition at line 48 of file yajl_lex.h.
enum yajl_lex_error |
Definition at line 91 of file yajl_lex.h.
enum yajl_tok |
Definition at line 22 of file yajl_lex.h.
yajl_lexer yajl_lex_alloc | ( | yajl_alloc_funcs * | alloc, |
unsigned int | allowComments, | ||
unsigned int | validateUTF8 | ||
) |
Definition at line 104 of file yajl_lex.c.
size_t yajl_lex_current_char | ( | yajl_lexer | lexer | ) |
get the number of chars lexed by this lexer instance since the last
or
Definition at line 744 of file yajl_lex.c.
size_t yajl_lex_current_line | ( | yajl_lexer | lexer | ) |
get the number of lines lexed by this lexer instance
Definition at line 739 of file yajl_lex.c.
size_t yajl_lex_current_offset | ( | yajl_lexer | lexer | ) |
get the current offset into the most recently lexed json string.
const char* yajl_lex_error_to_string | ( | yajl_lex_error | error | ) |
Definition at line 695 of file yajl_lex.c.
void yajl_lex_free | ( | yajl_lexer | lexer | ) |
Definition at line 121 of file yajl_lex.c.
yajl_lex_error yajl_lex_get_error | ( | yajl_lexer | lexer | ) |
allows access to more specific information about the lexical error when yajl_lex_lex returns yajl_tok_error.
Definition at line 733 of file yajl_lex.c.
yajl_tok yajl_lex_lex | ( | yajl_lexer | lexer, |
const unsigned char * | jsonText, | ||
size_t | jsonTextLen, | ||
size_t * | offset, | ||
const unsigned char ** | outBuf, | ||
size_t * | outLen | ||
) |
run/continue a lex. "offset" is an input/output parameter. It should be initialized to zero for a new chunk of target text, and upon subsetquent calls with the same target text should passed with the value of the previous invocation.
the client may be interested in the value of offset when an error is returned from the lexer. This allows the client to render useful n * error messages.
When you pass the next chunk of data, context should be reinitialized to zero.
Finally, the output buffer is usually just a pointer into the jsonText, however in cases where the entity being lexed spans multiple chunks, the lexer will buffer the entity and the data returned will be a pointer into that buffer.
This behavior is abstracted from client code except for the performance implications which require that the client choose a reasonable chunk size to get adequate performance.
Definition at line 503 of file yajl_lex.c.
yajl_tok yajl_lex_peek | ( | yajl_lexer | lexer, |
const unsigned char * | jsonText, | ||
size_t | jsonTextLen, | ||
size_t | offset | ||
) |
have a peek at the next token, but don't move the lexer forward
Definition at line 749 of file yajl_lex.c.