Typedefs | Functions
rpadbex.h File Reference

The public interface to BNF productions database API. More...

Go to the source code of this file.

Typedefs

typedef struct rpadbex_s rpadbex_t
 Database of BNF productions (The BNF schema)
typedef long rparule_t
 Unique BNF rule identifier.

Functions

const char * rpa_dbex_version ()
 Return the version string of the RPA library.
rpadbex_trpa_dbex_create (void)
 Create an object of type rpadbex_t.
void rpa_dbex_destroy (rpadbex_t *dbex)
 Destroy an object of type rpadbex_t, created by rpa_dbex_create.
long rpa_dbex_lasterror (rpadbex_t *dbex)
 Return the error code of the last occurred error.
long rpa_dbex_lasterrorinfo (rpadbex_t *dbex, rpa_errinfo_t *errinfo)
 Get error information for the last occurred error.
int rpa_dbex_open (rpadbex_t *dbex)
 Open the BNF productions database.
void rpa_dbex_close (rpadbex_t *dbex)
 Close the BNF productions database.
int rpa_dbex_compile (rpadbex_t *dbex)
 Compile the BNF productions database to byte code.
long rpa_dbex_load (rpadbex_t *dbex, const char *buffer, unsigned long size)
 Load BNF production(s) into the database.
long rpa_dbex_load_s (rpadbex_t *dbex, const char *buffer)
 Load BNF production(s) into the database. Same as rpa_dbex_load, but the buffer is NULL terminated string.
rvm_asmins_t * rpa_dbex_executable (rpadbex_t *dbex)
 Return a pointer to the executable code segment.
long rpa_dbex_executableoffset (rpadbex_t *dbex, rparule_t rid)
 Return the offset of the executable byte code for the specified rule.
rparule_t rpa_dbex_lookup (rpadbex_t *dbex, const char *name, unsigned int namesize)
 Lookup BNF production ID in the database.
rparule_t rpa_dbex_lookup_s (rpadbex_t *dbex, const char *name)
 Lookup BNF production ID in the database.
const char * rpa_dbex_name (rpadbex_t *dbex, rparule_t rid)
 Return the name of the specified rule ID.
rparule_t rpa_dbex_first (rpadbex_t *dbex)
 Return the first production ID in the database.
rparule_t rpa_dbex_last (rpadbex_t *dbex)
 Return the last production ID.
rparule_t rpa_dbex_next (rpadbex_t *dbex, rparule_t rid)
 Return the next production ID.
rparule_t rpa_dbex_prev (rpadbex_t *dbex, rparule_t rid)
 Return the previous production ID.
long rpa_dbex_strlen (rpadbex_t *dbex, rparule_t rid)
 Returns the string length of the specified BNF production.
long rpa_dbex_strncpy (rpadbex_t *dbex, char *dest, rparule_t rid, unsigned long size)
 Copy the string of the specified BNF production to the destination buffer.
long rpa_dbex_cfgset (rpadbex_t *dbex, unsigned long cfg, unsigned long val)
 Set a configuration value for the dbex object.
long rpa_dbex_cfgget (rpadbex_t *dbex, unsigned long cfg)
 Get a configuration value for the dbex object.
int rpa_dbex_dumptree (rpadbex_t *dbex, rparule_t rid)
 Print a BNF production in a tree format.
int rpa_dbex_dumpcode (rpadbex_t *dbex, rparule_t rid)
 Dump the compiled byte code for the specified production ID.
int rpa_dbex_dumprecords (rpadbex_t *dbex)
 Print the AST of the parsed BNF productions.
int rpa_dbex_dumpproductions (rpadbex_t *dbex)
 Print the content of BNF productions database.
int rpa_dbex_dumpinfo (rpadbex_t *dbex)
 Print debug information about the state of the BNF productions database.
int rpa_dbex_dumpuids (rpadbex_t *dbex)
 Print the production user IDs in a format suitable to be included in source code.

Detailed Description

The public interface to BNF productions database API.

Synopsis

The following APIs are used to Create, Compile, Enumerate, etc. BNF productions.