jx_parse.h
Go to the documentation of this file.
/*
Copyright (C) 2022 The University of Notre Dame
This software is distributed under the GNU General Public License.
See the file COPYING for details.
*/
#ifndef JX_PARSE_H
#define JX_PARSE_H
#include "jx.h"
#include "link.h"
#include <stdbool.h>
#include <stdio.h>
struct jx_parser;
/* Sets module-wide flag for static parse mode */
void jx_parse_set_static_mode( bool mode );
struct jx * jx_parse_string( const char *str );
struct jx * jx_parse_string_and_length( const char *str, int length );
struct jx * jx_parse_stream( FILE *file );
struct jx * jx_parse_file( const char *name );
struct jx * jx_parse_link( struct link *l, time_t stoptime );
struct jx *jx_parse_cmd_args(struct jx *jx_args, char *args_file);
int jx_parse_cmd_define(struct jx *jx_args, char *define_stmt);
struct jx_parser *jx_parser_create(bool strict_mode);
void jx_parser_read_stream( struct jx_parser *p, FILE *file );
void jx_parser_read_string( struct jx_parser *p, const char *str );
void jx_parser_read_string_and_length( struct jx_parser *p, const char *str, int length );
void jx_parser_read_link( struct jx_parser *p, struct link *l, time_t stoptime );
struct jx * jx_parser_yield( struct jx_parser *p );
struct jx * jx_parse( struct jx_parser *p );
int jx_parser_errors( struct jx_parser *p );
const char *jx_parser_error_string( struct jx_parser *p );
void jx_parser_delete( struct jx_parser *p );
/* Private function used by jx_print to put parens in the right place. */
int jx_operator_precedence( jx_operator_t op );
#endif
jx.h
JSON Expressions (JX) library.
jx_parse_string_and_length
struct jx * jx_parse_string_and_length(const char *str, int length)
Parse a JSON string to a JX expression.
jx_parser_errors
int jx_parser_errors(struct jx_parser *p)
Return number of parse errors.
jx_parser_delete
void jx_parser_delete(struct jx_parser *p)
Delete a parser.
jx_parse
struct jx * jx_parse(struct jx_parser *p)
Parse a JX expression.
jx_parse_string
struct jx * jx_parse_string(const char *str)
Parse a JSON string to a JX expression.
jx_parser_read_stream
void jx_parser_read_stream(struct jx_parser *p, FILE *file)
Attach parser to a file.
jx_parse_stream
struct jx * jx_parse_stream(FILE *file)
Parse a standard IO stream to a JX expression.
jx_parser_read_link
void jx_parser_read_link(struct jx_parser *p, struct link *l, time_t stoptime)
Attach parser to a link.
jx_parser_error_string
const char * jx_parser_error_string(struct jx_parser *p)
Return text of first parse error encountered.
jx_parser_create
struct jx_parser * jx_parser_create(bool strict_mode)
Create a JX parser object.
jx_parse_file
struct jx * jx_parse_file(const char *name)
Parse a file to a JX expression.
jx_parser_yield
struct jx * jx_parser_yield(struct jx_parser *p)
Parse and return a single value.
jx_parser_read_string_and_length
void jx_parser_read_string_and_length(struct jx_parser *p, const char *str, int length)
Attach parser to a raw string with known length.
jx_parse_link
struct jx * jx_parse_link(struct link *l, time_t stoptime)
Parse a network link to a JX expression.
jx_parser_read_string
void jx_parser_read_string(struct jx_parser *p, const char *str)
Attach parser to a null-terminate string.
jx_parse_cmd_args
struct jx * jx_parse_cmd_args(struct jx *jx_args, char *args_file)
Parse a jx argument file from a commandline option.
jx_parse_cmd_define
int jx_parse_cmd_define(struct jx *jx_args, char *define_stmt)
Parse a jx define statement from a commandline option.
link.h
A high level TCP connection library.
jx
JX value representing any expression type.
Definition jx.h:117