APG
… an ABNF Parser Generator
|
Private header for the SABNF parser. More...
Go to the source code of this file.
Data Structures | |
struct | parser_init |
The initialization information generated by APG. More... | |
struct | init_hdr |
Header for the parser initialization data. More... | |
struct | rule |
Data structure for a single rule. More... | |
struct | udt |
Data structure for a single UDT. More... | |
struct | op_alt |
Data structure for a single ALT opcode. More... | |
struct | op_cat |
Data structure for a single CAT opcode. More... | |
struct | op_rep |
Data structure for a single REP opcode. More... | |
struct | op_rnm |
Data structure for a single RNM opcode. More... | |
struct | op_trg |
Data structure for a single TRG opcode. More... | |
struct | op_tls |
Data structure for a single TLS opcode. More... | |
struct | op_tbs |
Data structure for a single TBS opcode. More... | |
struct | op_udt |
Data structure for a single UDT opcode. More... | |
struct | op_and |
Data structure for a single AND opcode. More... | |
struct | op_not |
Data structure for a single NOT opcode. More... | |
struct | op_bkr |
Data structure for a single BKR opcode. More... | |
struct | op_bka |
Data structure for a single BKA opcode. More... | |
struct | op_bkn |
Data structure for a single BKN opcode. More... | |
struct | op_abg |
Data structure for a single ABG opcode. More... | |
struct | op_aen |
Data structure for a single AEN opcode. More... | |
struct | op_gen |
General opcode. Only holds the opcode ID and PPPT map pointer. More... | |
union | opcode_tag |
A union of all possible node type opcode data structures. More... | |
struct | parser_tag |
The parser object's context. Holds the parser's state. Opaque to user. More... | |
Typedefs | |
typedef void(* | pfn_op) (struct parser_tag *spCtx, const union opcode_tag *spOp) |
Prototype for the node operation functions. More... | |
Functions | |
void * | vpParserAllocCtor (exception *spException, void *vpParserInit, abool bAllocateTables) |
The parser constructor. More... | |
aint | uiGetAcharTable (parser_init *spHdr, achar *acpAcharTable) |
Extract the alphabet character table from the initialization data. More... | |
abool | bGetParserInitData (parser_init *spHdr, luint *luipParserInit) |
Re-size the initialization data to the required integer size. More... | |
void | vGetChildListTable (init_hdr *spHdr, aint *uipList) |
Extract the child index list from the initialization data. More... | |
void | vTranslateRules (parser *spCtx, rule *spRules, opcode *spOpcodes, luint *luipData) |
Translate the initialization data for the rules into the internal rules format. More... | |
void | vTranslateUdts (parser *spCtx, udt *spUdts, luint *luipData) |
Translate the initialization data for the UDTs into the internal UDT format. More... | |
void | vTranslateOpcodes (parser *spCtx, rule *spRules, udt *spUdts, opcode *spOpcodes, luint *luipData) |
Translate the initialization data for the opcodes into the internal opcode format. More... | |
uint8_t | ucGetMapVal (const uint8_t *ucpMap, luint luiOffset, luint luiChar) |
Private header for the SABNF parser.
The declarations here are used internally by the parser. Some of the APG utilities and helper objects will use this "inside" information but the user should rarely need this header for an application.
Definition in file parserp.h.
pfn_op |
abool bGetParserInitData | ( | parser_init * | spParserInit, |
luint * | luipParserInit | ||
) |
Re-size the initialization data to the required integer size.
Definition at line 80 of file parser-get-init.c.
aint uiGetAcharTable | ( | parser_init * | spParserInit, |
achar * | acpAcharTable | ||
) |
Extract the alphabet character table from the initialization data.
Definition at line 43 of file parser-get-init.c.
Extract the child index list from the initialization data.
Definition at line 130 of file parser-get-init.c.
The parser constructor.
The generator can generate the parser's initialization data in one of two ways.
spException | Pointer to a valid exception structure initialized with vExCtor() or XCTOR(). If not valid, the application will silently exit with a BAD_CONTEXT exit code. |
vpParserInit | Pointer to the initialization data. |
bAllocateTables | If true, memory is allocated to copy the initialization data into the parser'scontext. If false, no memory allocation and copying is done. |
void vTranslateOpcodes | ( | parser * | spCtx, |
rule * | spRules, | ||
udt * | spUdts, | ||
opcode * | spOpcodes, | ||
luint * | luipData | ||
) |
Translate the initialization data for the opcodes into the internal opcode format.
Definition at line 76 of file parser-translate-init.c.
Translate the initialization data for the rules into the internal rules format.
Definition at line 43 of file parser-translate-init.c.
Translate the initialization data for the UDTs into the internal UDT format.
Definition at line 60 of file parser-translate-init.c.