00001 /* 00002 Copyright (C) 2015- The University of Notre Dame 00003 This software is distributed under the GNU General Public License. 00004 See the file COPYING for details. 00005 */ 00006 00007 #ifndef JX_PARSE_H 00008 #define JX_PARSE_H 00009 00020 #include "jx.h" 00021 #include "link.h" 00022 00023 #include <stdbool.h> 00024 #include <stdio.h> 00025 00026 struct jx_parser; 00027 00029 struct jx * jx_parse_string( const char *str ); 00030 00032 struct jx * jx_parse_stream( FILE *file ); 00033 00035 struct jx * jx_parse_file( const char *name ); 00036 00038 struct jx * jx_parse_link( struct link *l, time_t stoptime ); 00039 00047 struct jx *jx_parse_cmd_args(struct jx *jx_args, char *args_file); 00048 00055 int jx_parse_cmd_define(struct jx *jx_args, char *define_stmt); 00056 00058 struct jx_parser *jx_parser_create(bool strict_mode); 00059 00061 void jx_parser_read_stream( struct jx_parser *p, FILE *file ); 00062 00064 void jx_parser_read_string( struct jx_parser *p, const char *str ); 00065 00067 void jx_parser_read_link( struct jx_parser *p, struct link *l, time_t stoptime ); 00068 00070 struct jx * jx_parser_yield( struct jx_parser *p ); 00071 00073 struct jx * jx_parse( struct jx_parser *p ); 00074 00076 int jx_parser_errors( struct jx_parser *p ); 00077 00079 const char *jx_parser_error_string( struct jx_parser *p ); 00080 00082 void jx_parser_delete( struct jx_parser *p ); 00083 00084 /* Private function used by jx_print to put parens in the right place. */ 00085 int jx_operator_precedence( jx_operator_t op ); 00086 00087 00088 #endif