Rizin
unix-like reverse engineering framework and cli tools
|
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include <errno.h>
#include <ctype.h>
Go to the source code of this file.
Classes | |
struct | mpc_state_t |
struct | mpc_err_t |
union | mpc_result_t |
struct | mpc_ast_t |
struct | mpc_ast_trav_t |
Typedefs | |
typedef void | mpc_val_t |
typedef struct mpc_parser_t | mpc_parser_t |
typedef void(* | mpc_dtor_t) (mpc_val_t *) |
typedef mpc_val_t *(* | mpc_ctor_t) (void) |
typedef mpc_val_t *(* | mpc_apply_t) (mpc_val_t *) |
typedef mpc_val_t *(* | mpc_apply_to_t) (mpc_val_t *, void *) |
typedef mpc_val_t *(* | mpc_fold_t) (int, mpc_val_t **) |
typedef int(* | mpc_check_t) (mpc_val_t **) |
typedef int(* | mpc_check_with_t) (mpc_val_t **, void *) |
typedef struct mpc_ast_t | mpc_ast_t |
typedef struct mpc_ast_trav_t | mpc_ast_trav_t |
Enumerations | |
enum | { MPC_RE_DEFAULT = 0 , MPC_RE_M = 1 , MPC_RE_S = 2 , MPC_RE_MULTILINE = 1 , MPC_RE_DOTALL = 2 } |
enum | mpc_ast_trav_order_t { mpc_ast_trav_order_pre , mpc_ast_trav_order_post } |
enum | { MPCA_LANG_DEFAULT = 0 , MPCA_LANG_PREDICTIVE = 1 , MPCA_LANG_WHITESPACE_SENSITIVE = 2 } |
typedef struct mpc_ast_trav_t mpc_ast_trav_t |
typedef struct mpc_parser_t mpc_parser_t |
anonymous enum |
anonymous enum |
enum mpc_ast_trav_order_t |
mpc_parser_t* mpc_alpha | ( | void | ) |
Definition at line 2025 of file mpc.c.
References mpc_expect(), and mpc_oneof().
Referenced by mpc_alphanum(), and mpc_ident().
mpc_parser_t* mpc_alphanum | ( | void | ) |
Definition at line 2027 of file mpc.c.
References mpc_alpha(), mpc_digit(), mpc_expect(), mpc_or(), and mpc_underscore().
Referenced by mpc_ident(), and mpc_re_escape_char().
mpc_parser_t* mpc_anchor | ( | int(*)(char, char) | f | ) |
Definition at line 1677 of file mpc.c.
References f, mpc_expect(), MPC_TYPE_ANCHOR, mpc_undefined(), and p.
Referenced by mpc_boundary(), and mpc_boundary_newline().
mpc_parser_t* mpc_and | ( | int | n, |
mpc_fold_t | f, | ||
... | |||
) |
Definition at line 1948 of file mpc.c.
References f, i, malloc(), MPC_TYPE_AND, mpc_undefined(), n, and p.
Referenced by mpc_between(), mpc_endwith(), mpc_escape(), mpc_ident(), mpc_re_escape_char(), mpc_re_mode(), mpc_real(), mpc_startwith(), mpc_strip(), mpc_stripl(), mpc_stripr(), mpc_tok(), mpc_tok_between(), mpc_whole(), mpca_grammar_st(), mpca_lang_st(), mpca_state(), mpcf_re_and(), and mpcf_re_escape().
mpc_parser_t* mpc_any | ( | void | ) |
Definition at line 1741 of file mpc.c.
References mpc_expect(), MPC_TYPE_ANY, mpc_undefined(), and p.
Referenced by mpc_char_lit(), mpc_escape(), and mpcf_re_escape().
mpc_parser_t* mpc_apply | ( | mpc_parser_t * | a, |
mpc_apply_t | f | ||
) |
Definition at line 1798 of file mpc.c.
References a, f, MPC_TYPE_APPLY, mpc_undefined(), and p.
Referenced by mpc_blank(), mpc_float(), mpc_hex(), mpc_int(), mpc_oct(), mpc_re_mode(), mpca_root(), mpcaf_fold_regex(), mpcaf_grammar_char(), and mpcaf_grammar_string().
mpc_parser_t* mpc_apply_to | ( | mpc_parser_t * | a, |
mpc_apply_to_t | f, | ||
void * | x | ||
) |
Definition at line 1806 of file mpc.c.
References a, f, MPC_TYPE_APPLY_TO, mpc_undefined(), p, and x.
Referenced by mpc_re_mode(), mpca_add_tag(), mpca_grammar_st(), mpca_lang_st(), and mpca_tag().
Definition at line 2974 of file mpc.c.
References a, r, and realloc().
Referenced by mpc_ast_add_root(), mpc_ast_build(), and mpcf_fold_ast().
Definition at line 2946 of file mpc.c.
References a, mpc_ast_add_child(), mpc_ast_new(), NULL, and r.
Referenced by mpca_root().
Definition at line 2928 of file mpc.c.
References a, i, mpc_ast_add_child(), mpc_ast_new(), n, and test-lz4-versions::tag.
void mpc_ast_delete | ( | mpc_ast_t * | a | ) |
Definition at line 2886 of file mpc.c.
References a, free(), i, and NULL.
Referenced by main(), mpc_optimise_unretained(), mpca_and(), mpca_count(), mpca_not(), and mpca_total().
Definition at line 3060 of file mpc.c.
References mpc_ast_get_child_lb(), and test-lz4-versions::tag.
Definition at line 3064 of file mpc.c.
References mpc_ast_t::children, mpc_ast_t::children_num, i, NULL, test-lz4-versions::tag, and mpc_ast_t::tag.
Referenced by mpc_ast_get_child().
Definition at line 3044 of file mpc.c.
References mpc_ast_get_index_lb(), and test-lz4-versions::tag.
Definition at line 3048 of file mpc.c.
References mpc_ast_t::children, mpc_ast_t::children_num, i, test-lz4-versions::tag, and mpc_ast_t::tag.
Referenced by mpc_ast_get_index().
Definition at line 2910 of file mpc.c.
References a, malloc(), mpc_state_new(), NULL, and test-lz4-versions::tag.
Referenced by mpc_ast_add_root(), mpc_ast_build(), mpcf_fold_ast(), mpcf_input_str_ast(), and mpcf_str_ast().
void mpc_ast_print | ( | mpc_ast_t * | a | ) |
Definition at line 3036 of file mpc.c.
References a, and mpc_ast_print_depth().
Referenced by main().
void mpc_ast_print_to | ( | mpc_ast_t * | a, |
FILE * | fp | ||
) |
Definition at line 3040 of file mpc.c.
References a, and mpc_ast_print_depth().
Referenced by main().
mpc_ast_t* mpc_ast_state | ( | mpc_ast_t * | a, |
mpc_state_t | s | ||
) |
void mpc_ast_traverse_free | ( | mpc_ast_trav_t ** | trav | ) |
mpc_ast_t* mpc_ast_traverse_next | ( | mpc_ast_trav_t ** | trav | ) |
Definition at line 3118 of file mpc.c.
References mpc_ast_t::children, mpc_ast_trav_t::curr_child, mpc_ast_trav_t::curr_node, free(), malloc(), mpc_ast_trav_order_post, mpc_ast_trav_order_pre, NULL, mpc_ast_trav_t::order, and mpc_ast_trav_t::parent.
mpc_ast_trav_t* mpc_ast_traverse_start | ( | mpc_ast_t * | ast, |
mpc_ast_trav_order_t | order | ||
) |
Definition at line 3076 of file mpc.c.
References mpc_ast_t::children, mpc_ast_t::children_num, mpc_ast_trav_t::curr_child, mpc_ast_trav_t::curr_node, malloc(), mpc_ast_trav_order_post, mpc_ast_trav_order_pre, NULL, mpc_ast_trav_t::order, and mpc_ast_trav_t::parent.
mpc_parser_t* mpc_between | ( | mpc_parser_t * | a, |
mpc_dtor_t | ad, | ||
const char * | o, | ||
const char * | c | ||
) |
Definition at line 2093 of file mpc.c.
References a, c, free(), mpc_and(), mpc_string(), and mpcf_snd_free().
Referenced by mpc_braces(), mpc_brackets(), mpc_char_lit(), mpc_parens(), mpc_regex_lit(), mpc_squares(), and mpc_string_lit().
mpc_parser_t* mpc_blank | ( | void | ) |
Definition at line 2010 of file mpc.c.
References mpc_apply(), mpc_expect(), mpc_whitespaces(), and mpcf_free().
Referenced by mpc_strip(), mpc_stripl(), mpc_stripr(), and mpc_tok().
mpc_parser_t* mpc_boundary | ( | void | ) |
Definition at line 2005 of file mpc.c.
References mpc_anchor(), mpc_boundary_anchor(), and mpc_expect().
Referenced by mpc_re_escape_char().
mpc_parser_t* mpc_boundary_newline | ( | void | ) |
Definition at line 2006 of file mpc.c.
References mpc_anchor(), mpc_boundary_newline_anchor(), and mpc_expect().
Referenced by mpcf_re_escape().
mpc_parser_t* mpc_braces | ( | mpc_parser_t * | a, |
mpc_dtor_t | ad | ||
) |
Definition at line 2100 of file mpc.c.
References a, and mpc_between().
mpc_parser_t* mpc_brackets | ( | mpc_parser_t * | a, |
mpc_dtor_t | ad | ||
) |
Definition at line 2101 of file mpc.c.
References a, and mpc_between().
Referenced by mpc_re_mode().
mpc_parser_t* mpc_char | ( | char | c | ) |
Definition at line 1747 of file mpc.c.
References c, mpc_expectf(), MPC_TYPE_SINGLE, mpc_undefined(), and p.
Referenced by mpc_escape(), mpc_newline(), mpc_re_escape_char(), mpc_re_mode(), mpc_real(), mpc_tab(), mpc_underscore(), mpcaf_grammar_char(), and mpcf_re_escape().
mpc_parser_t* mpc_char_lit | ( | void | ) |
Definition at line 2056 of file mpc.c.
References free(), mpc_any(), mpc_between(), mpc_escape(), mpc_expect(), and mpc_or().
Referenced by mpca_grammar_st(), and mpca_lang_st().
mpc_parser_t* mpc_check | ( | mpc_parser_t * | a, |
mpc_dtor_t | da, | ||
mpc_check_t | f, | ||
const char * | e | ||
) |
Definition at line 1815 of file mpc.c.
References a, e, f, malloc(), MPC_TYPE_CHECK, mpc_undefined(), and p.
Referenced by mpc_checkf().
mpc_parser_t* mpc_check_with | ( | mpc_parser_t * | a, |
mpc_dtor_t | da, | ||
mpc_check_with_t | f, | ||
void * | x, | ||
const char * | e | ||
) |
Definition at line 1826 of file mpc.c.
References a, e, f, malloc(), MPC_TYPE_CHECK_WITH, mpc_undefined(), p, and x.
Referenced by mpc_check_withf().
mpc_parser_t* mpc_check_withf | ( | mpc_parser_t * | a, |
mpc_dtor_t | da, | ||
mpc_check_with_t | f, | ||
void * | x, | ||
const char * | fmt, | ||
... | |||
) |
Definition at line 1854 of file mpc.c.
References a, f, free(), malloc(), mpc_check_with(), p, vsprintf, and x.
mpc_parser_t* mpc_checkf | ( | mpc_parser_t * | a, |
mpc_dtor_t | da, | ||
mpc_check_t | f, | ||
const char * | fmt, | ||
... | |||
) |
Definition at line 1838 of file mpc.c.
References a, f, free(), malloc(), mpc_check(), p, and vsprintf.
void mpc_cleanup | ( | int | n, |
... | |||
) |
Definition at line 1596 of file mpc.c.
References free(), i, list(), malloc(), mpc_delete(), mpc_undefine(), and n.
Referenced by main(), mpc_re_mode(), mpca_grammar_st(), and mpca_lang_st().
mpc_parser_t* mpc_copy | ( | mpc_parser_t * | a | ) |
Definition at line 1488 of file mpc.c.
References a, i, malloc(), MPC_TYPE_AND, MPC_TYPE_APPLY, MPC_TYPE_APPLY_TO, MPC_TYPE_CHECK, MPC_TYPE_CHECK_WITH, MPC_TYPE_COUNT, MPC_TYPE_EXPECT, MPC_TYPE_FAIL, MPC_TYPE_MANY, MPC_TYPE_MANY1, MPC_TYPE_MAYBE, MPC_TYPE_NONEOF, MPC_TYPE_NOT, MPC_TYPE_ONEOF, MPC_TYPE_OR, MPC_TYPE_PREDICT, MPC_TYPE_STRING, mpc_undefined(), and p.
mpc_parser_t* mpc_count | ( | int | n, |
mpc_fold_t | f, | ||
mpc_parser_t * | a, | ||
mpc_dtor_t | da | ||
) |
Definition at line 1918 of file mpc.c.
References a, f, MPC_TYPE_COUNT, mpc_undefined(), n, and p.
Referenced by mpca_count(), and mpcf_re_repeat().
mpc_parser_t* mpc_define | ( | mpc_parser_t * | p, |
mpc_parser_t * | a | ||
) |
Definition at line 1580 of file mpc.c.
References a, mpc_parser_t::data, free(), mpc_failf(), p, and mpc_parser_t::type.
Referenced by mpc_re_mode(), mpca_grammar_st(), mpca_lang_st(), and mpca_stmt_list_apply_to().
void mpc_delete | ( | mpc_parser_t * | p | ) |
Definition at line 1453 of file mpc.c.
References free(), MPC_TYPE_UNDEFINED, mpc_undefine_unretained(), and p.
Referenced by mpc_cleanup(), mpc_optimise_unretained(), and mpc_re_mode().
mpc_parser_t* mpc_digit | ( | void | ) |
Definition at line 2016 of file mpc.c.
References mpc_expect(), and mpc_oneof().
Referenced by mpc_alphanum(), mpc_digits(), and mpc_re_escape_char().
mpc_parser_t* mpc_digits | ( | void | ) |
Definition at line 2019 of file mpc.c.
References mpc_digit(), mpc_expect(), mpc_many1(), and mpcf_strfold().
Referenced by mpc_int(), mpc_real(), mpca_grammar_st(), and mpca_lang_st().
mpc_parser_t* mpc_endwith | ( | mpc_parser_t * | a, |
mpc_dtor_t | da | ||
) |
mpc_parser_t* mpc_eoi | ( | void | ) |
Definition at line 1983 of file mpc.c.
References mpc_expect(), MPC_TYPE_EOI, mpc_undefined(), and p.
Referenced by mpc_endwith(), mpc_re_escape_char(), mpc_whole(), and mpcf_re_escape().
void mpc_err_delete | ( | mpc_err_t * | e | ) |
Definition at line 575 of file mpc.c.
Referenced by main(), mpc_re_mode(), mpc_test_fail(), mpc_test_pass(), and mpca_grammar_st().
void mpc_err_print | ( | mpc_err_t * | e | ) |
Definition at line 584 of file mpc.c.
References mpc_err_print_to(), and x.
Referenced by main(), and mpc_test_pass().
void mpc_err_print_to | ( | mpc_err_t * | e, |
FILE * | f | ||
) |
Definition at line 588 of file mpc.c.
References f, free(), mpc_err_string(), cmd_descs_generate::str, and x.
Referenced by mpc_err_print().
char* mpc_err_string | ( | mpc_err_t * | e | ) |
Definition at line 630 of file mpc.c.
References calloc(), i, max, mpc_err_char_unescape(), mpc_err_string_cat(), pos, realloc(), and x.
Referenced by mpc_err_print_to(), mpc_re_mode(), and mpca_grammar_st().
mpc_parser_t* mpc_escape | ( | void | ) |
Definition at line 2014 of file mpc.c.
References free(), mpc_and(), mpc_any(), mpc_char(), and mpcf_strfold().
Referenced by mpc_char_lit(), mpc_re_mode(), mpc_regex_lit(), and mpc_string_lit().
mpc_parser_t* mpc_expect | ( | mpc_parser_t * | a, |
const char * | e | ||
) |
Definition at line 1690 of file mpc.c.
References a, malloc(), MPC_TYPE_EXPECT, mpc_undefined(), and p.
Referenced by mpc_alpha(), mpc_alphanum(), mpc_anchor(), mpc_any(), mpc_blank(), mpc_boundary(), mpc_boundary_newline(), mpc_char_lit(), mpc_digit(), mpc_digits(), mpc_eoi(), mpc_float(), mpc_hex(), mpc_hexdigit(), mpc_hexdigits(), mpc_int(), mpc_lower(), mpc_newline(), mpc_number(), mpc_oct(), mpc_octdigit(), mpc_octdigits(), mpc_real(), mpc_regex_lit(), mpc_soi(), mpc_string_lit(), mpc_tab(), mpc_underscore(), mpc_upper(), mpc_whitespace(), mpc_whitespaces(), mpca_stmt_list_apply_to(), and mpcf_re_escape().
mpc_parser_t* mpc_expectf | ( | mpc_parser_t * | a, |
const char * | fmt, | ||
... | |||
) |
Definition at line 1719 of file mpc.c.
References a, malloc(), MPC_TYPE_EXPECT, mpc_undefined(), p, realloc(), and vsprintf.
Referenced by mpc_char(), mpc_noneof(), mpc_oneof(), mpc_range(), mpc_satisfy(), and mpc_string().
mpc_parser_t* mpc_fail | ( | const char * | m | ) |
Definition at line 1616 of file mpc.c.
References regress::m, malloc(), MPC_TYPE_FAIL, mpc_undefined(), and p.
Referenced by mpcf_re_range().
mpc_parser_t* mpc_failf | ( | const char * | fmt, |
... | |||
) |
Definition at line 1644 of file mpc.c.
References malloc(), MPC_TYPE_FAIL, mpc_undefined(), p, realloc(), and vsprintf.
Referenced by mpc_define(), mpc_re_mode(), mpca_grammar_find_parser(), and mpca_grammar_st().
mpc_parser_t* mpc_float | ( | void | ) |
Definition at line 2052 of file mpc.c.
References mpc_apply(), mpc_expect(), mpc_real(), and mpcf_float().
mpc_parser_t* mpc_hex | ( | void | ) |
Definition at line 2030 of file mpc.c.
References mpc_apply(), mpc_expect(), mpc_hexdigits(), and mpcf_hex().
Referenced by mpc_number().
mpc_parser_t* mpc_hexdigit | ( | void | ) |
Definition at line 2017 of file mpc.c.
References mpc_expect(), and mpc_oneof().
Referenced by mpc_hexdigits().
mpc_parser_t* mpc_hexdigits | ( | void | ) |
Definition at line 2020 of file mpc.c.
References mpc_expect(), mpc_hexdigit(), mpc_many1(), and mpcf_strfold().
Referenced by mpc_hex().
mpc_parser_t* mpc_ident | ( | void | ) |
Definition at line 2070 of file mpc.c.
References free(), mpc_alpha(), mpc_alphanum(), mpc_and(), mpc_many(), mpc_or(), mpc_underscore(), and mpcf_strfold().
Referenced by mpca_grammar_st(), and mpca_lang_st().
mpc_parser_t* mpc_int | ( | void | ) |
Definition at line 2029 of file mpc.c.
References mpc_apply(), mpc_digits(), mpc_expect(), and mpcf_int().
Referenced by mpc_number(), mpc_re_mode(), mpca_grammar_st(), and mpca_lang_st().
mpc_parser_t* mpc_lift | ( | mpc_ctor_t | f | ) |
Definition at line 1670 of file mpc.c.
References MPC_TYPE_LIFT, mpc_undefined(), and p.
Referenced by mpc_re_escape_char(), mpcf_re_and(), and mpcf_re_escape().
mpc_parser_t* mpc_lift_val | ( | mpc_val_t * | x | ) |
Definition at line 1663 of file mpc.c.
References MPC_TYPE_LIFT_VAL, mpc_undefined(), p, and x.
Referenced by mpca_grammar_st(), and mpca_lang_st().
mpc_parser_t* mpc_lower | ( | void | ) |
mpc_parser_t* mpc_many | ( | mpc_fold_t | f, |
mpc_parser_t * | a | ||
) |
Definition at line 1902 of file mpc.c.
References a, f, MPC_TYPE_MANY, mpc_undefined(), and p.
Referenced by mpc_ident(), mpc_re_mode(), mpc_regex_lit(), mpc_string_lit(), mpc_whitespaces(), mpca_grammar_st(), mpca_lang_st(), mpca_many(), and mpcf_re_repeat().
mpc_parser_t* mpc_many1 | ( | mpc_fold_t | f, |
mpc_parser_t * | a | ||
) |
Definition at line 1910 of file mpc.c.
References a, f, MPC_TYPE_MANY1, mpc_undefined(), and p.
Referenced by mpc_digits(), mpc_hexdigits(), mpc_octdigits(), mpca_grammar_st(), mpca_lang_st(), mpca_many1(), and mpcf_re_repeat().
mpc_parser_t* mpc_maybe | ( | mpc_parser_t * | a | ) |
Definition at line 1898 of file mpc.c.
References a, mpc_maybe_lift(), and mpcf_ctor_null().
Referenced by mpc_re_mode(), mpca_grammar_st(), mpca_lang_st(), and mpca_maybe().
mpc_parser_t* mpc_maybe_lift | ( | mpc_parser_t * | a, |
mpc_ctor_t | lf | ||
) |
Definition at line 1890 of file mpc.c.
References a, MPC_TYPE_MAYBE, mpc_undefined(), and p.
Referenced by mpc_maybe(), mpc_real(), and mpcf_re_repeat().
mpc_parser_t* mpc_new | ( | const char * | name | ) |
Definition at line 1480 of file mpc.c.
References mpc_undefined(), p, and realloc().
Referenced by main(), mpc_re_mode(), mpca_grammar_st(), and mpca_lang_st().
mpc_parser_t* mpc_newline | ( | void | ) |
Definition at line 2012 of file mpc.c.
References mpc_char(), and mpc_expect().
Referenced by mpcf_re_escape().
mpc_parser_t* mpc_noneof | ( | const char * | s | ) |
Definition at line 1770 of file mpc.c.
References malloc(), mpc_expectf(), MPC_TYPE_NONEOF, mpc_undefined(), p, and s.
Referenced by mpc_re_mode(), mpc_regex_lit(), mpc_string_lit(), mpcf_re_escape(), and mpcf_re_range().
mpc_parser_t* mpc_not | ( | mpc_parser_t * | a, |
mpc_dtor_t | da | ||
) |
Definition at line 1886 of file mpc.c.
References a, mpc_not_lift(), and mpcf_ctor_null().
Referenced by mpca_not().
mpc_parser_t* mpc_not_lift | ( | mpc_parser_t * | a, |
mpc_dtor_t | da, | ||
mpc_ctor_t | lf | ||
) |
Definition at line 1877 of file mpc.c.
References a, MPC_TYPE_NOT, mpc_undefined(), and p.
Referenced by mpc_not(), and mpc_re_escape_char().
int mpc_nparse | ( | const char * | filename, |
const char * | string, | ||
size_t | length, | ||
mpc_parser_t * | p, | ||
mpc_result_t * | r | ||
) |
Definition at line 1329 of file mpc.c.
References i, length, mpc_input_delete(), mpc_input_new_nstring(), mpc_parse_input(), p, r, and x.
mpc_parser_t* mpc_number | ( | void | ) |
mpc_parser_t* mpc_oct | ( | void | ) |
Definition at line 2031 of file mpc.c.
References mpc_apply(), mpc_expect(), mpc_octdigits(), and mpcf_oct().
Referenced by mpc_number().
mpc_parser_t* mpc_octdigit | ( | void | ) |
Definition at line 2018 of file mpc.c.
References mpc_expect(), and mpc_oneof().
Referenced by mpc_octdigits().
mpc_parser_t* mpc_octdigits | ( | void | ) |
Definition at line 2021 of file mpc.c.
References mpc_expect(), mpc_many1(), mpc_octdigit(), and mpcf_strfold().
Referenced by mpc_oct().
mpc_parser_t* mpc_oneof | ( | const char * | s | ) |
Definition at line 1762 of file mpc.c.
References malloc(), mpc_expectf(), MPC_TYPE_ONEOF, mpc_undefined(), p, and s.
Referenced by mpc_alpha(), mpc_digit(), mpc_hexdigit(), mpc_lower(), mpc_octdigit(), mpc_real(), mpc_upper(), mpc_whitespace(), mpca_grammar_st(), mpca_lang_st(), and mpcf_re_range().
void mpc_optimise | ( | mpc_parser_t * | p | ) |
Definition at line 4064 of file mpc.c.
References mpc_optimise_unretained(), and p.
Referenced by mpc_re_mode(), mpca_grammar_st(), mpca_lang_st(), and mpca_stmt_list_apply_to().
mpc_parser_t* mpc_or | ( | int | n, |
... | |||
) |
Definition at line 1928 of file mpc.c.
References i, malloc(), MPC_TYPE_OR, mpc_undefined(), n, and p.
Referenced by mpc_alphanum(), mpc_char_lit(), mpc_ident(), mpc_number(), mpc_re_mode(), mpc_regex_lit(), mpc_string_lit(), mpca_grammar_st(), mpca_lang_st(), mpcf_re_escape(), and mpcf_re_or().
mpc_parser_t* mpc_parens | ( | mpc_parser_t * | a, |
mpc_dtor_t | ad | ||
) |
Definition at line 2099 of file mpc.c.
References a, and mpc_between().
Referenced by mpc_re_mode().
int mpc_parse | ( | const char * | filename, |
const char * | string, | ||
mpc_parser_t * | p, | ||
mpc_result_t * | r | ||
) |
Definition at line 1321 of file mpc.c.
References i, mpc_input_delete(), mpc_input_new_string(), mpc_parse_input(), p, r, and x.
Referenced by mpc_re_mode(), mpc_test_fail(), mpc_test_pass(), and mpca_grammar_st().
int mpc_parse_contents | ( | const char * | filename, |
mpc_parser_t * | p, | ||
mpc_result_t * | r | ||
) |
Definition at line 1353 of file mpc.c.
References f, benchmark::FILE, mpc_err_file(), mpc_parse_file(), NULL, p, and r.
Referenced by main().
int mpc_parse_file | ( | const char * | filename, |
FILE * | file, | ||
mpc_parser_t * | p, | ||
mpc_result_t * | r | ||
) |
Definition at line 1337 of file mpc.c.
References i, mpc_input_delete(), mpc_input_new_file(), mpc_parse_input(), p, r, and x.
Referenced by mpc_parse_contents().
int mpc_parse_pipe | ( | const char * | filename, |
FILE * | pipe, | ||
mpc_parser_t * | p, | ||
mpc_result_t * | r | ||
) |
Definition at line 1345 of file mpc.c.
References i, mpc_input_delete(), mpc_input_new_pipe(), mpc_parse_input(), p, pipe, r, and x.
Referenced by main().
mpc_parser_t* mpc_pass | ( | void | ) |
Definition at line 1610 of file mpc.c.
References MPC_TYPE_PASS, mpc_undefined(), and p.
Referenced by mpc_re_mode(), mpca_grammar_st(), mpca_lang_st(), and mpcaf_grammar_and().
mpc_parser_t* mpc_predictive | ( | mpc_parser_t * | a | ) |
Definition at line 1870 of file mpc.c.
References a, MPC_TYPE_PREDICT, mpc_undefined(), and p.
Referenced by mpc_re_mode(), mpca_grammar_st(), mpca_lang_st(), and mpca_stmt_list_apply_to().
void mpc_print | ( | mpc_parser_t * | p | ) |
Definition at line 2811 of file mpc.c.
References mpc_print_unretained(), p, and printf().
mpc_parser_t* mpc_range | ( | char | s, |
char | e | ||
) |
Definition at line 1754 of file mpc.c.
References e, mpc_expectf(), MPC_TYPE_RANGE, mpc_undefined(), p, and s.
mpc_parser_t* mpc_re | ( | const char * | re | ) |
mpc_parser_t* mpc_re_mode | ( | const char * | re, |
int | mode | ||
) |
Definition at line 2357 of file mpc.c.
References free(), mpc_and(), mpc_apply(), mpc_apply_to(), mpc_brackets(), mpc_char(), mpc_cleanup(), mpc_define(), mpc_delete(), mpc_err_delete(), mpc_err_string(), mpc_escape(), mpc_failf(), mpc_int(), mpc_many(), mpc_maybe(), mpc_new(), mpc_noneof(), mpc_optimise(), mpc_or(), mpc_parens(), mpc_parse(), mpc_pass(), mpc_predictive(), mpc_squares(), mpc_whole(), mpcf_re_and(), mpcf_re_escape(), mpcf_re_or(), mpcf_re_range(), mpcf_re_repeat(), mpcf_snd_free(), mpcf_strfold(), and r.
Referenced by mpc_re(), and mpcaf_fold_regex().
mpc_parser_t* mpc_real | ( | void | ) |
Definition at line 2034 of file mpc.c.
References free(), mpc_and(), mpc_char(), mpc_digits(), mpc_expect(), mpc_maybe_lift(), mpc_oneof(), mpcf_ctor_str(), and mpcf_strfold().
Referenced by mpc_float().
mpc_parser_t* mpc_regex_lit | ( | void | ) |
Definition at line 2065 of file mpc.c.
References free(), mpc_between(), mpc_escape(), mpc_expect(), mpc_many(), mpc_noneof(), mpc_or(), and mpcf_strfold().
Referenced by mpca_grammar_st(), and mpca_lang_st().
mpc_parser_t* mpc_satisfy | ( | int(*)(char) | f | ) |
Definition at line 1779 of file mpc.c.
References f, mpc_expectf(), MPC_TYPE_SATISFY, mpc_undefined(), and p.
mpc_parser_t* mpc_soi | ( | void | ) |
Definition at line 1977 of file mpc.c.
References mpc_expect(), MPC_TYPE_SOI, mpc_undefined(), and p.
Referenced by mpc_re_escape_char(), mpc_startwith(), mpc_whole(), and mpcf_re_escape().
mpc_parser_t* mpc_squares | ( | mpc_parser_t * | a, |
mpc_dtor_t | ad | ||
) |
Definition at line 2102 of file mpc.c.
References a, and mpc_between().
Referenced by mpc_re_mode().
mpc_parser_t* mpc_startwith | ( | mpc_parser_t * | a | ) |
Definition at line 2081 of file mpc.c.
References a, mpc_and(), mpc_soi(), mpcf_dtor_null(), and mpcf_snd().
mpc_parser_t* mpc_state | ( | void | ) |
Definition at line 1684 of file mpc.c.
References MPC_TYPE_STATE, mpc_undefined(), and p.
Referenced by mpca_state().
void mpc_stats | ( | mpc_parser_t * | p | ) |
Definition at line 3889 of file mpc.c.
References mpc_nodecount_unretained(), p, and printf().
mpc_parser_t* mpc_string | ( | const char * | s | ) |
Definition at line 1786 of file mpc.c.
References malloc(), mpc_expectf(), MPC_TYPE_STRING, mpc_undefined(), p, and s.
Referenced by mpc_between(), mpc_sym(), and mpcaf_grammar_string().
mpc_parser_t* mpc_string_lit | ( | void | ) |
Definition at line 2060 of file mpc.c.
References free(), mpc_between(), mpc_escape(), mpc_expect(), mpc_many(), mpc_noneof(), mpc_or(), and mpcf_strfold().
Referenced by mpca_grammar_st(), and mpca_lang_st().
mpc_parser_t* mpc_strip | ( | mpc_parser_t * | a | ) |
Definition at line 2087 of file mpc.c.
References a, mpc_and(), mpc_blank(), mpcf_dtor_null(), and mpcf_snd().
Referenced by mpc_total().
mpc_parser_t* mpc_stripl | ( | mpc_parser_t * | a | ) |
Definition at line 2085 of file mpc.c.
References a, mpc_and(), mpc_blank(), mpcf_dtor_null(), and mpcf_snd().
mpc_parser_t* mpc_stripr | ( | mpc_parser_t * | a | ) |
Definition at line 2086 of file mpc.c.
References a, mpc_and(), mpc_blank(), mpcf_dtor_null(), and mpcf_fst().
mpc_parser_t* mpc_sym | ( | const char * | s | ) |
Definition at line 2089 of file mpc.c.
References mpc_string(), mpc_tok(), and s.
Referenced by mpc_tok_between(), mpca_grammar_st(), and mpca_lang_st().
mpc_parser_t* mpc_tab | ( | void | ) |
int mpc_test_fail | ( | mpc_parser_t * | p, |
const char * | s, | ||
const void * | d, | ||
int(*)(const void *, const void *) | tester, | ||
mpc_dtor_t | destructor, | ||
void(*)(const void *) | printer | ||
) |
int mpc_test_pass | ( | mpc_parser_t * | p, |
const char * | s, | ||
const void * | d, | ||
int(*)(const void *, const void *) | tester, | ||
mpc_dtor_t | destructor, | ||
void(*)(const void *) | printer | ||
) |
Definition at line 2854 of file mpc.c.
References d, mpc_err_delete(), mpc_err_print(), mpc_parse(), p, printf(), r, and s.
mpc_parser_t* mpc_tok | ( | mpc_parser_t * | a | ) |
Definition at line 2088 of file mpc.c.
References a, mpc_and(), mpc_blank(), mpcf_dtor_null(), and mpcf_fst().
Referenced by mpc_sym(), mpc_tok_between(), mpca_grammar_st(), mpca_lang_st(), mpcaf_fold_regex(), mpcaf_grammar_char(), and mpcaf_grammar_string().
mpc_parser_t* mpc_tok_between | ( | mpc_parser_t * | a, |
mpc_dtor_t | ad, | ||
const char * | o, | ||
const char * | c | ||
) |
Definition at line 2104 of file mpc.c.
References a, c, free(), mpc_and(), mpc_sym(), mpc_tok(), and mpcf_snd_free().
Referenced by mpc_tok_braces(), mpc_tok_brackets(), mpc_tok_parens(), and mpc_tok_squares().
mpc_parser_t* mpc_tok_braces | ( | mpc_parser_t * | a, |
mpc_dtor_t | ad | ||
) |
Definition at line 2111 of file mpc.c.
References a, and mpc_tok_between().
Referenced by mpca_grammar_st(), and mpca_lang_st().
mpc_parser_t* mpc_tok_brackets | ( | mpc_parser_t * | a, |
mpc_dtor_t | ad | ||
) |
Definition at line 2112 of file mpc.c.
References a, and mpc_tok_between().
Referenced by mpca_grammar_st(), and mpca_lang_st().
mpc_parser_t* mpc_tok_parens | ( | mpc_parser_t * | a, |
mpc_dtor_t | ad | ||
) |
Definition at line 2110 of file mpc.c.
References a, and mpc_tok_between().
Referenced by mpca_grammar_st(), and mpca_lang_st().
mpc_parser_t* mpc_tok_squares | ( | mpc_parser_t * | a, |
mpc_dtor_t | ad | ||
) |
mpc_parser_t* mpc_total | ( | mpc_parser_t * | a, |
mpc_dtor_t | da | ||
) |
Definition at line 2091 of file mpc.c.
References a, mpc_strip(), and mpc_whole().
Referenced by mpca_grammar_st(), mpca_lang_st(), and mpca_total().
mpc_parser_t* mpc_undefine | ( | mpc_parser_t * | p | ) |
Definition at line 1574 of file mpc.c.
References MPC_TYPE_UNDEFINED, mpc_undefine_unretained(), and p.
Referenced by mpc_cleanup().
mpc_parser_t* mpc_underscore | ( | void | ) |
Definition at line 2026 of file mpc.c.
References mpc_char(), and mpc_expect().
Referenced by mpc_alphanum(), and mpc_ident().
mpc_parser_t* mpc_upper | ( | void | ) |
mpc_parser_t* mpc_whitespace | ( | void | ) |
Definition at line 2008 of file mpc.c.
References mpc_expect(), and mpc_oneof().
Referenced by mpc_re_escape_char(), and mpc_whitespaces().
mpc_parser_t* mpc_whitespaces | ( | void | ) |
Definition at line 2009 of file mpc.c.
References mpc_expect(), mpc_many(), mpc_whitespace(), and mpcf_strfold().
Referenced by mpc_blank().
mpc_parser_t* mpc_whole | ( | mpc_parser_t * | a, |
mpc_dtor_t | da | ||
) |
Definition at line 2083 of file mpc.c.
References a, mpc_and(), mpc_eoi(), mpc_soi(), mpcf_dtor_null(), and mpcf_snd().
Referenced by mpc_re_mode(), and mpc_total().
mpc_parser_t* mpca_add_tag | ( | mpc_parser_t * | a, |
const char * | t | ||
) |
Definition at line 3273 of file mpc.c.
References a, mpc_apply_to(), and mpc_ast_add_tag().
Referenced by mpcaf_grammar_id().
mpc_parser_t* mpca_and | ( | int | n, |
... | |||
) |
Definition at line 3308 of file mpc.c.
References i, malloc(), mpc_ast_delete(), MPC_TYPE_AND, mpc_undefined(), mpcf_fold_ast(), n, and p.
Referenced by mpcaf_grammar_and().
mpc_parser_t* mpca_count | ( | int | n, |
mpc_parser_t * | a | ||
) |
Definition at line 3285 of file mpc.c.
References a, mpc_ast_delete(), mpc_count(), mpcf_fold_ast(), and n.
Referenced by mpcaf_grammar_repeat().
mpc_parser_t* mpca_grammar | ( | int | flags, |
const char * | grammar, | ||
... | |||
) |
Definition at line 3588 of file mpc.c.
References flags, mpca_grammar_st_t::flags, free(), mpca_grammar_st(), NULL, mpca_grammar_st_t::parsers, mpca_grammar_st_t::parsers_num, and mpca_grammar_st_t::va.
Definition at line 3790 of file mpc.c.
References err, flags, mpca_grammar_st_t::flags, free(), i, mpc_input_delete(), mpc_input_new_string(), mpca_lang_st(), NULL, mpca_grammar_st_t::parsers, mpca_grammar_st_t::parsers_num, and mpca_grammar_st_t::va.
Referenced by main().
Definition at line 3813 of file mpc.c.
References err, f, benchmark::FILE, flags, mpca_grammar_st_t::flags, free(), i, mpc_err_file(), mpc_input_delete(), mpc_input_new_file(), mpca_lang_st(), NULL, mpca_grammar_st_t::parsers, mpca_grammar_st_t::parsers_num, and mpca_grammar_st_t::va.
Definition at line 3746 of file mpc.c.
References err, f, flags, mpca_grammar_st_t::flags, free(), i, mpc_input_delete(), mpc_input_new_file(), mpca_lang_st(), NULL, mpca_grammar_st_t::parsers, mpca_grammar_st_t::parsers_num, and mpca_grammar_st_t::va.
Definition at line 3768 of file mpc.c.
References err, flags, mpca_grammar_st_t::flags, free(), i, mpc_input_delete(), mpc_input_new_pipe(), mpca_lang_st(), NULL, p, mpca_grammar_st_t::parsers, mpca_grammar_st_t::parsers_num, and mpca_grammar_st_t::va.
mpc_parser_t* mpca_many | ( | mpc_parser_t * | a | ) |
Definition at line 3283 of file mpc.c.
References a, mpc_many(), and mpcf_fold_ast().
Referenced by mpcaf_grammar_repeat().
mpc_parser_t* mpca_many1 | ( | mpc_parser_t * | a | ) |
Definition at line 3284 of file mpc.c.
References a, mpc_many1(), and mpcf_fold_ast().
Referenced by mpcaf_grammar_repeat().
mpc_parser_t* mpca_maybe | ( | mpc_parser_t * | a | ) |
Definition at line 3282 of file mpc.c.
References a, and mpc_maybe().
Referenced by mpcaf_grammar_repeat().
mpc_parser_t* mpca_not | ( | mpc_parser_t * | a | ) |
Definition at line 3281 of file mpc.c.
References a, mpc_ast_delete(), and mpc_not().
Referenced by mpcaf_grammar_repeat().
mpc_parser_t* mpca_or | ( | int | n, |
... | |||
) |
Definition at line 3287 of file mpc.c.
References i, malloc(), MPC_TYPE_OR, mpc_undefined(), n, and p.
Referenced by mpcaf_grammar_or().
mpc_parser_t* mpca_root | ( | mpc_parser_t * | a | ) |
Definition at line 3277 of file mpc.c.
References a, mpc_apply(), and mpc_ast_add_root().
Referenced by mpcaf_grammar_id().
mpc_parser_t* mpca_state | ( | mpc_parser_t * | a | ) |
Definition at line 3265 of file mpc.c.
References a, free(), mpc_and(), mpc_state(), and mpcf_state_ast().
Referenced by mpcaf_fold_regex(), mpcaf_grammar_char(), mpcaf_grammar_id(), and mpcaf_grammar_string().
mpc_parser_t* mpca_tag | ( | mpc_parser_t * | a, |
const char * | t | ||
) |
Definition at line 3269 of file mpc.c.
References a, mpc_apply_to(), and mpc_ast_tag().
Referenced by mpcaf_fold_regex(), mpcaf_grammar_char(), and mpcaf_grammar_string().
mpc_parser_t* mpca_total | ( | mpc_parser_t * | a | ) |
mpc_val_t* mpcf_ctor_null | ( | void | ) |
mpc_val_t* mpcf_ctor_str | ( | void | ) |
Definition at line 2431 of file mpc.c.
References calloc().
Referenced by mpc_optimise_unretained(), mpc_re_escape_char(), mpc_real(), mpcf_re_and(), mpcf_re_escape(), and mpcf_re_repeat().
void mpcf_dtor_null | ( | mpc_val_t * | x | ) |
Definition at line 2428 of file mpc.c.
References x.
Referenced by mpc_startwith(), mpc_strip(), mpc_stripl(), mpc_stripr(), mpc_tok(), and mpc_whole().
Definition at line 2576 of file mpc.c.
References free(), mpc_escape_input_c, mpc_escape_output_c, mpcf_escape_new(), and x.
Definition at line 2612 of file mpc.c.
References free(), mpc_escape_input_raw_cchar, mpc_escape_output_raw_cchar, mpcf_escape_new(), and x.
Definition at line 2588 of file mpc.c.
References free(), mpc_escape_input_raw_re, mpc_escape_output_raw_re, mpcf_escape_new(), and x.
Definition at line 2600 of file mpc.c.
References free(), mpc_escape_input_raw_cstr, mpc_escape_output_raw_cstr, mpcf_escape_new(), and x.
Definition at line 3212 of file mpc.c.
References mpc_ast_t::children_num, i, mpc_ast_add_child(), mpc_ast_add_root_tag(), mpc_ast_delete_no_children(), mpc_ast_new(), n, NULL, r, and test-lz4-versions::tag.
Referenced by mpc_optimise_unretained(), mpca_and(), mpca_count(), mpca_many(), and mpca_many1().
Definition at line 2432 of file mpc.c.
References free(), NULL, and x.
Referenced by mpc_blank(), and mpc_parse_apply().
Definition at line 2625 of file mpc.c.
References n.
Referenced by mpc_endwith(), mpc_parse_fold(), mpc_stripr(), mpc_tok(), and mpcf_re_escape().
Definition at line 2637 of file mpc.c.
References mpcf_nth_free(), and n.
Referenced by mpc_parse_fold().
Definition at line 2626 of file mpc.c.
References n.
Referenced by mpc_parse_fold(), mpc_re_escape_char(), mpc_startwith(), mpc_strip(), mpc_stripl(), mpc_whole(), and mpcf_re_escape().
Definition at line 2638 of file mpc.c.
References mpcf_nth_free(), and n.
Referenced by mpc_between(), mpc_parse_fold(), mpc_re_mode(), mpc_tok_between(), mpca_grammar_st(), and mpca_lang_st().
Definition at line 3256 of file mpc.c.
References a, free(), mpc_ast_state(), n, and s.
Referenced by mpc_parse_fold(), and mpca_state().
Definition at line 3250 of file mpc.c.
References a, c, free(), and mpc_ast_new().
Referenced by mpc_parse_apply(), mpcaf_fold_regex(), mpcaf_grammar_char(), and mpcaf_grammar_string().
Definition at line 2648 of file mpc.c.
References calloc(), free(), i, n, and realloc().
Referenced by mpc_digits(), mpc_escape(), mpc_hexdigits(), mpc_ident(), mpc_octdigits(), mpc_optimise_unretained(), mpc_parse_fold(), mpc_re_mode(), mpc_real(), mpc_regex_lit(), mpc_string_lit(), mpc_whitespaces(), mpca_grammar_st(), mpca_lang_st(), mpcf_re_and(), and mpcf_re_repeat().
Definition at line 2639 of file mpc.c.
References mpcf_nth_free(), and n.
Referenced by mpc_parse_fold().
Definition at line 2582 of file mpc.c.
References free(), mpc_escape_input_c, mpc_escape_output_c, mpcf_unescape_new(), and x.
Referenced by mpcaf_grammar_char(), and mpcaf_grammar_string().
Definition at line 2618 of file mpc.c.
References free(), mpc_escape_input_raw_cchar, mpc_escape_output_raw_cchar, mpcf_unescape_new(), and x.
Definition at line 2594 of file mpc.c.
References free(), mpc_escape_input_raw_re, mpc_escape_output_raw_re, mpcf_unescape_new(), and x.
Referenced by mpcaf_fold_regex().
Definition at line 2606 of file mpc.c.
References free(), mpc_escape_input_raw_cstr, mpc_escape_output_raw_cstr, mpcf_unescape_new(), and x.