Module mpc::mpc_c [] [src]

Contains mpc function definitions

Functions

mpc_alpha

matches any alphabet character

mpc_alphanum

matches a any alphabet character, an underscore or a digit

mpc_anchor

Consumes no input. Successful when function f returns true. Always returns NULL.

mpc_and

attempts to run n parsers in sequence, combining results with fold function f

mpc_any

matches any individual character

mpc_apply

returns a parser that applies function f to the result of parser a

mpc_apply_to

returns a parser that applies function f to the result of parser a, taking extra input x

mpc_ast_add_child
mpc_ast_add_root
mpc_ast_add_root_tag
mpc_ast_add_tag
mpc_ast_build
mpc_ast_delete
mpc_ast_get_child
mpc_ast_get_child_lb
mpc_ast_get_index
mpc_ast_get_index_lb
mpc_ast_new
mpc_ast_print
mpc_ast_state
mpc_ast_tag
mpc_ast_traverse_free
mpc_ast_traverse_next
mpc_ast_traverse_start
mpc_between
mpc_blank

matches whitespace and frees result

mpc_boundary

matches only the boundary between words

mpc_braces
mpc_brackets
mpc_char

matches a single character c

mpc_char_lit

matches a char literal

mpc_cleanup

automatically undefine and delete parsers

mpc_copy

make a copy of the parser a

mpc_count

runs parser a exactly n times, on failure, partial results are destroyed with da, on success results are combined using fold function f

mpc_define

assign contents of parser a to parser p, delete a

mpc_digit

matches a single digit

mpc_digits

matches one or more digits

mpc_endwith

matches the end of input followed by a

mpc_eoi

matches only the start of input

mpc_err_delete

delete a *mut mpc_err_t, should be used instead of free()

mpc_err_print

print a error to stdout

mpc_err_string

get an error string of error e

mpc_escape

matches an escape sequence

mpc_expect

returns a parser that runs a and on success returns the result of a, on failure returns e

mpc_expectf

returns a parser that runs a and on success returns the result of a, on failure formatted message fmt

mpc_fail

consumes no input, always fails with message m

mpc_failf

consumes no input, always fails with formated message fmt

mpc_float

matches floating point numbers as a *mut f32

mpc_hex

matches hex digits and returns *mut i32

mpc_hexdigit

matches a single hex digit (0-9, A-F

mpc_hexdigits

matches one or more hex digits

mpc_ident

matches a valid C identifier

mpc_int

matches digits and returns *mut int

mpc_lift

consumes no input, always successful, returns the result of function f

mpc_lift_val

consumes no input, always sucessful, returns value x

mpc_lower

matches any lowercase character

mpc_many

runs parser a zero or more times, until it fails. Results are combined using fold function f

mpc_many1

runs parser a one or more times, until it fails. Results are combined using fold function f

mpc_maybe

returns a parser that runs a, if it succeeds, returns the result of a, if a doesn't succeed, it succeeds, but returns a nullptr

mpc_maybe_lift

returns a parser that runs a, if it succeeds, returns the result of a, if a doesn't succeed, it succeeds, but returns the result of lift function lf

mpc_new

construct a new parser called name

mpc_newline

matches a newline

mpc_noneof

matches none of characters s

mpc_not

returns a parser that, if a succeeds, fails and consumes no input, if a fails, it succeeds and consumes no input. destructor da is to destroy the result of a on success

mpc_not_lift

returns a parser that, if a succeeds, fails and consumes no input, if a fails, it succeeds and consumes no input and returns result of lift function lf. destructor da is to destroy the result of a on success

mpc_nparse

run a parser on length characters of some string

mpc_number

matches any digits and returns *mut i32

mpc_oct

matches octal digits and returns *mut i32

mpc_octdigit

matches a single octal digit

mpc_octdigits

matches one or more octal digits

mpc_oneof

matches one of characters s

mpc_optimise
mpc_or

attempts to run n parsers in sequence, returning the first one that succeeds

mpc_parens
mpc_parse

run a parser on some string

mpc_parse_contents

parse contents of a file filename

mpc_pass

consumes no input, always successful, returns a nullptr

mpc_predictive

runs a parser with backtracking disabled

mpc_print
mpc_range

matches a character in the range from s to e

mpc_re
mpc_real

matches floating point numbers as a string

mpc_regex_lit

matches a regex literal

mpc_satisfy

matches a character that satisfies function f

mpc_soi

matches only the end of input

mpc_squares
mpc_startwith

matches the start of input followed by a

mpc_state

consumes no input, always successful, returns copy of the parser state as *mut mpc_parser_t. the state is newly allocated and needs to be freed

mpc_stats
mpc_string

matches a string s

mpc_string_lit

matches a string literal

mpc_strip
mpc_stripl

matches input starting

mpc_stripr
mpc_sym
mpc_tab

matches a tab

mpc_test_fail
mpc_test_pass
mpc_tok
mpc_tok_between
mpc_tok_braces
mpc_tok_brackets
mpc_tok_parens
mpc_tok_squares
mpc_total
mpc_undefine

undefine a parser. use this before deleting a parser

mpc_underscore

matches an underscore

mpc_upper

matches any upper case character

mpc_whitespace

matches any whitespace character

mpc_whitespaces

matches zero or more whitespace characters

mpc_whole

matches input from start to end

mpca_add_tag
mpca_and
mpca_count
mpca_grammar
mpca_lang
mpca_lang_contents
mpca_many
mpca_many1
mpca_maybe
mpca_not
mpca_or
mpca_root
mpca_state
mpca_tag
mpca_total
mpcf_ctor_null
mpcf_ctor_str
mpcf_dtor_null
mpcf_escape
mpcf_escape_char_raw
mpcf_escape_regex
mpcf_escape_string_raw
mpcf_float
mpcf_fold_ast
mpcf_free
mpcf_fst
mpcf_fst_free
mpcf_hex
mpcf_int
mpcf_maths
mpcf_null
mpcf_oct
mpcf_snd
mpcf_snd_free
mpcf_state_ast
mpcf_str_ast
mpcf_strfold
mpcf_strtrim
mpcf_strtriml
mpcf_strtrimr
mpcf_trd
mpcf_trd_free
mpcf_unescape
mpcf_unescape_char_raw
mpcf_unescape_regex
mpcf_unescape_string_raw