Parser API


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.

Detailed Description


Function Documentation

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

const char* tinyap_get_grammar ( tinyap_t   ) 

access to grammar source

Referenced by TinyaP::Parser::getGrammar().

Here is the caller graph for this function:

ast_node_t tinyap_get_grammar_ast ( tinyap_t   ) 

access to grammar ast

Referenced by TinyaP::Parser::parseAsGrammar(), and TinyaP::Parser::setGrammar().

Here is the caller graph for this function:

ast_node_t tinyap_get_output ( const   tinyap_t  ) 

access to last parsing output

Referenced by TinyaP::Parser::parse(), and TinyaP::Parser::parseAsGrammar().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

unsigned int tinyap_get_source_buffer_length ( tinyap_t   ) 

access to length of text input source

Referenced by TinyaP::Parser::getSourceBufferLength().

Here is the caller graph for this function:

const char* tinyap_get_source_file ( tinyap_t   ) 

access to filename of text input source (may be NULL)

Referenced by TinyaP::Parser::getSourceFile().

Here is the caller graph for this function:

const char* tinyap_get_whitespace ( tinyap_t   ) 

access to whitespace characters list

Referenced by TinyaP::Parser::getWhitespace().

Here is the caller graph for this function:

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

Returns:
1 if parsing was successful, 0 otherwise

Referenced by TinyaP::Parser::parse().

Here is the caller graph for this function:

int tinyap_parse_as_grammar ( tinyap_t   ) 

perform parsing of configured source with configured grammar and uses the output as the new grammar

Returns:
1 if parsing was successful, 0 otherwise

Referenced by TinyaP::Parser::parseAsGrammar().

Here is the caller graph for this function:

int tinyap_parsed_ok ( const   tinyap_t  ) 

predicate "the last parsing was successful"

Returns:
1 if last parsing was successful, 0 otherwise equates to "the output was not NULL"

Referenced by TinyaP::Parser::parse(), TinyaP::Parser::parseAsGrammar(), and TinyaP::Parser::parsedOK().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

void tinyap_set_grammar_ast ( tinyap_t  ,
ast_node_t   
)

modification of grammar ast

Referenced by TinyaP::Parser::setGrammarAST().

Here is the caller graph for this function:

void tinyap_set_source_buffer ( tinyap_t  ,
const char *  ,
const unsigned  int 
)

set buffer as text input source

Referenced by TinyaP::Parser::setSourceBuffer().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

void tinyap_set_whitespace ( tinyap_t  ,
const char *   
)

modification of whitespace characters list

Referenced by TinyaP::Parser::setWhitespace().

Here is the caller graph for this function:

void tinyap_set_whitespace_regexp ( tinyap_t  ,
const char *   
)

modification of whitespace recognition regexp

Referenced by TinyaP::Parser::setWhitespaceRegexp().

Here is the caller graph for this function:


Generated on Sun May 11 14:32:44 2008 for TINYAP by  doxygen 1.5.3