Functions | |
void | tinyap_init () |
initialize the tinyap environment. | |
tinyap_t | tinyap_new () |
create a new parser with default context. create a parser with "explicit" metagrammar dialect, " \r\t\n" whitespaces, and input from stdin. | |
const char * | tinyap_get_whitespace (tinyap_t) |
access to whitespace characters list | |
void | tinyap_set_whitespace (tinyap_t, const char *) |
modification of whitespace characters list | |
void | tinyap_set_whitespace_regexp (tinyap_t, const char *) |
modification of whitespace recognition regexp | |
const char * | tinyap_get_grammar (tinyap_t) |
access to grammar source | |
void | tinyap_set_grammar (tinyap_t, const char *) |
modification of grammar source (any filename, or "explicit" or "CamelCasing") | |
ast_node_t | tinyap_get_grammar_ast (tinyap_t) |
access to grammar ast | |
void | tinyap_set_grammar_ast (tinyap_t, ast_node_t) |
modification of grammar ast | |
const char * | tinyap_get_source_file (tinyap_t) |
access to filename of text input source (may be NULL) | |
const char * | tinyap_get_source_buffer (tinyap_t) |
access to buffer of text input source (i.e. contents of file or configured memory buffer) | |
unsigned int | tinyap_get_source_buffer_length (tinyap_t) |
access to length of text input source | |
void | tinyap_set_source_file (tinyap_t, const char *) |
set named file as text input CAUTION : if source filename is "-" or "stdin", standard input will be read until closed, and the function will block meanwhile. | |
void | tinyap_set_source_buffer (tinyap_t, const char *, const unsigned int) |
set buffer as text input source | |
int | tinyap_parse (tinyap_t) |
perform parsing of configured source with configured grammar | |
int | tinyap_parse_as_grammar (tinyap_t) |
perform parsing of configured source with configured grammar and uses the output as the new grammar | |
int | tinyap_parsed_ok (const tinyap_t) |
predicate "the last parsing was successful" | |
ast_node_t | tinyap_get_output (const tinyap_t) |
access to last parsing output | |
int | tinyap_get_error_col (const tinyap_t) |
get the column where the parsing error occured in source text (offsets start at 1) | |
int | tinyap_get_error_row (const tinyap_t) |
get the line where the parsing error occured in source text (offsets start at 1) | |
const char * | tinyap_get_error (const tinyap_t) |
get the source text around the parsing error, and a cursor indicating the column where the error occured | |
void | tinyap_delete (tinyap_t) |
delete an instance of a parser | |
void | tinyap_plug (tinyap_t parser, const char *plugin, const char *plug) |
plug (NT plugin) at head of (Alt) element of rule (* plug (Alt)). Plugs must have this form. | |
void | tinyap_plug_node (tinyap_t parser, ast_node_t pin, const char *plugin, const char *plug) |
plug pin at head of (Alt) element of rule (* plug (Alt)). Plugs must have this form. | |
void | tinyap_append_grammar (tinyap_t parser, ast_node_t supp) |
append this grammar to the existing grammar. |
void tinyap_append_grammar | ( | tinyap_t | parser, | |
ast_node_t | supp | |||
) |
append this grammar to the existing grammar.
void tinyap_delete | ( | tinyap_t | ) |
delete an instance of a parser
const char* tinyap_get_error | ( | const | tinyap_t | ) |
get the source text around the parsing error, and a cursor indicating the column where the error occured
Referenced by TinyaP::Parser::getError().
int tinyap_get_error_col | ( | const | tinyap_t | ) |
get the column where the parsing error occured in source text (offsets start at 1)
Referenced by TinyaP::Parser::getErrorCol().
int tinyap_get_error_row | ( | const | tinyap_t | ) |
get the line where the parsing error occured in source text (offsets start at 1)
Referenced by TinyaP::Parser::getErrorRow().
const char* tinyap_get_grammar | ( | tinyap_t | ) |
access to grammar source
Referenced by TinyaP::Parser::getGrammar().
ast_node_t tinyap_get_grammar_ast | ( | tinyap_t | ) |
access to grammar ast
Referenced by TinyaP::Parser::parseAsGrammar(), and TinyaP::Parser::setGrammar().
ast_node_t tinyap_get_output | ( | const | tinyap_t | ) |
access to last parsing output
Referenced by TinyaP::Parser::parse(), and TinyaP::Parser::parseAsGrammar().
const char* tinyap_get_source_buffer | ( | tinyap_t | ) |
access to buffer of text input source (i.e. contents of file or configured memory buffer)
Referenced by TinyaP::Parser::getSourceBuffer().
unsigned int tinyap_get_source_buffer_length | ( | tinyap_t | ) |
access to length of text input source
Referenced by TinyaP::Parser::getSourceBufferLength().
const char* tinyap_get_source_file | ( | tinyap_t | ) |
access to filename of text input source (may be NULL)
Referenced by TinyaP::Parser::getSourceFile().
const char* tinyap_get_whitespace | ( | tinyap_t | ) |
access to whitespace characters list
Referenced by TinyaP::Parser::getWhitespace().
void tinyap_init | ( | ) |
initialize the tinyap environment.
tinyap_t tinyap_new | ( | ) |
create a new parser with default context. create a parser with "explicit" metagrammar dialect, " \r\t\n" whitespaces, and input from stdin.
int tinyap_parse | ( | tinyap_t | ) |
perform parsing of configured source with configured grammar
Referenced by TinyaP::Parser::parse().
int tinyap_parse_as_grammar | ( | tinyap_t | ) |
perform parsing of configured source with configured grammar and uses the output as the new grammar
Referenced by TinyaP::Parser::parseAsGrammar().
int tinyap_parsed_ok | ( | const | tinyap_t | ) |
predicate "the last parsing was successful"
Referenced by TinyaP::Parser::parse(), TinyaP::Parser::parseAsGrammar(), and TinyaP::Parser::parsedOK().
void tinyap_plug | ( | tinyap_t | parser, | |
const char * | plugin, | |||
const char * | plug | |||
) |
plug (NT plugin) at head of (Alt) element of rule (* plug (Alt)). Plugs must have this form.
void tinyap_plug_node | ( | tinyap_t | parser, | |
ast_node_t | pin, | |||
const char * | plugin, | |||
const char * | plug | |||
) |
plug pin at head of (Alt) element of rule (* plug (Alt)). Plugs must have this form.
void tinyap_set_grammar | ( | tinyap_t | , | |
const char * | ||||
) |
modification of grammar source (any filename, or "explicit" or "CamelCasing")
Referenced by TinyaP::Parser::setGrammar().
void tinyap_set_grammar_ast | ( | tinyap_t | , | |
ast_node_t | ||||
) |
modification of grammar ast
Referenced by TinyaP::Parser::setGrammarAST().
void tinyap_set_source_buffer | ( | tinyap_t | , | |
const char * | , | |||
const unsigned | int | |||
) |
set buffer as text input source
Referenced by TinyaP::Parser::setSourceBuffer().
void tinyap_set_source_file | ( | tinyap_t | , | |
const char * | ||||
) |
set named file as text input CAUTION : if source filename is "-" or "stdin", standard input will be read until closed, and the function will block meanwhile.
Referenced by TinyaP::Parser::setSourceFile().
void tinyap_set_whitespace | ( | tinyap_t | , | |
const char * | ||||
) |
modification of whitespace characters list
Referenced by TinyaP::Parser::setWhitespace().
void tinyap_set_whitespace_regexp | ( | tinyap_t | , | |
const char * | ||||
) |
modification of whitespace recognition regexp
Referenced by TinyaP::Parser::setWhitespaceRegexp().