APG
… an ABNF Parser Generator
|
Functions for collecting parsing statistics. More...
Go to the source code of this file.
Data Structures | |
struct | node_stat |
Holds the statistics for a single node. More... | |
struct | stats |
The totality of all node statistics. More... | |
struct | stats_ctx |
The statistics object context. More... | |
Functions | |
void * | vpStatsCtor (void *vpParserCtx) |
The statistics object constructor. More... | |
void | vStatsHit (void *vpCtx, const opcode *spOp, aint uiState) |
Collects the statistics for a single node hit. More... | |
void | vStatsToHtml (void *vpCtx, const char *cpMode, const char *cpFileName) |
Generates an HTML page displaying the node hit statistics. More... | |
void | vStatsToAscii (void *vpCtx, const char *cpMode, const char *cpFileName) |
Display the statistics in ASCII format. More... | |
Functions for collecting parsing statistics.
As the parser traverses the syntax tree, these functions collect detailed counts of the tree node hits. Hit counts are kept for each individual operator node type and each hit type (ID_MATCH, ID_NOMATCH). For the rule name (RNM) and User-Defined Terminal (UDT) nodes, the hit counts are further refined by rule/UDT name.
Definition in file stats.c.
void* vpStatsCtor | ( | void * | vpParserCtx | ) |
The statistics object constructor.
vpParserCtx | Pointer to the parent parser's context. If not valid the application will silently exit with a BAD_CONTEXT exit code. |
void vStatsHit | ( | void * | vpCtx, |
const opcode * | spOp, | ||
aint | uiState | ||
) |
Collects the statistics for a single node hit.
This function is called only by the parent parser via the macro STATS_HIT.
vpCtx | Pointer to a valid statistics context returned from vpStatsCtor() If not valid the application will silently exit with a BAD_CONTEXT exit code. |
spOp | Pointer to the opcode of the current node. |
uiState | The node state (ID_MATCH or ID_NOMATCH) |
void vStatsToAscii | ( | void * | vpCtx, |
const char * | cpMode, | ||
const char * | cpFileName | ||
) |
Display the statistics in ASCII format.
vpCtx | Pointer to a valid statistics context returned from vpStatsCtor() If not valid the application will silently exit with a BAD_CONTEXT exit code. |
cpMode | Name of the display mode.
|
cpFileName | Name of the file to write the HTML page to. If NULL, writes to stdout. |
void vStatsToHtml | ( | void * | vpCtx, |
const char * | cpMode, | ||
const char * | cpFileName | ||
) |
Generates an HTML page displaying the node hit statistics.
vpCtx | Pointer to a valid statistics context returned from vpStatsCtor() If not valid the application will silently exit with a BAD_CONTEXT exit code. |
cpMode | Name of the display mode.
|
cpFileName | Name of the file to write the HTML page to. If NULL, writes to stdout. |