Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
|
Go to the documentation of this file.
50 #define TRACE_HEADER_APGEX 2
54 #define TRACE_HEADER_TRACE 3
131 void vTraceUp(
void* vpCtx,
const opcode* spOp,
aint uiState,
aint uiOffset,
aint uiPhraseLength);
abool bAllRules
If true, all rule nodes will be displayed.
void vTraceApgexSeparator(void *vpCtx, aint uiLastIndex)
Only called by apgex.
parser * spParserCtx
Pointer back to the parent parser's context.
int iTraceDepthMax
The maximum (possibly partial) traced node depth.
FILE * spOut
Pointer to the open output file.
aint uiThisRecord
The record index of the current record.
aint uiPhraseLength
The phrase length of a successful match.
Configuration defining the subset of nodes to display information for.
void vSetDefaultConfig(trace *spTrace)
Sets the default trace configuration on construction.
const opcode * spOpcode
Pointer to the opcode for the current node.
void vDisplayFooter(trace *spCtx)
Display the trace footer.
FILE * spOpenFile
Pointer to any other open file.
aint uiBufSize
Size of the scratch buffer.
abool * bpUdts
An array of true/false indicators for each UDT in the SABNF grammar.
aint uiThisRecord
Index of the current trace record.
aint uiMaxRecords
Maximun number of records to display.
void * vpLookaroundStack
Pointer to a stack require to keep track of when tracing in look around mode.
abool * bpOps
An array of true/false indicators for each opcode in the SABNF grammar.
trace_config sConfig
Pointer to the trace configuration.
aint uiState
The parser's state for this node (ID_ACTIVE, ID_MATCH, etc.)
int iTraceDepthMin
The minimum (possibly partial) traced node depth.
void vDisplayHeader(trace *spCtx)
Display the trace header.
void vTraceUp(void *vpCtx, const opcode *spOp, aint uiState, aint uiOffset, aint uiPhraseLength)
Called by the parser following upward traversal of a parse tree node.
uint_fast32_t aint
The APG parser's unsigned integer type.
aint uiOutputType
Output type identifier (TRACE_ASCII or TRACE_HTML)
int iTraceDepth
The partial parse tree depth (a subset possibly restricted by the configuration.)
void vTraceApgexFooter(void *vpCtx)
Only called by apgex.
aint uiTreeDepth
The actual parse tree depth.
aint uiTreeDepth
The current full parse tree depth.
void vTraceBegin(void *vpCtx)
Called by the parser to start the trace.
void vTraceDown(void *vpCtx, const opcode *spOp, aint uiOffset)
Called by the parser prior to downward traversal of a parse tree node.
abool bAllOps
If true, all UDT nodes will be displayed.
A structure to describe the type and location of a caught exception.
void * vpMem
Pointer to the memory context to use for all memory allocation.1.
void vDisplaySeparator(trace *spCtx, aint uiLastIndex)
Display a separator between trace outputs (apgex only)
void vTraceEnd(void *vpCtx)
Called by the parser to end the trace.
aint uiHeaderType
Indicates whether the trace is being done by apgex.
void vDisplayRecord(trace *spCtx, trace_record *spRec, abool bIsMatchedPppt)
Display one trace record.
The information recorded & displayed by the trace object for each node visited.
char * cpFileName
Name of the file to display the trace records to.
uint8_t abool
abool is the APG bool type.
abool * bpRules
An array of true/false indicators for each rule in the SABNF grammar.
int iTraceDepth
The current (possibly partial) traced node depth.
void vTraceApgexHeader(void *vpCtx)
Only called by apgex.
aint uiTreeDepthMax
The maximum full parse tree depth achieved.
void * vpVecFileName
Vector to allocate and re-allocate the memory for the file name.
The trace object context. Maintains the trace object's state.
aint uiFirstRecord
Number of the first record to display.
aint uiOffset
The offset into the input string for the first character of the sub-phrase being matched.
abool bCountOnly
If true, trace will only count the number of records that would have been displayed.
void vTraceApgexType(void *vpCtx, aint uiType)
Called only by apgex. Sets the display type for apgex tracing.
void * vpLog
Pointer to a message log object for reporting configuration errors.
exception * spException
Pointer to the exception to use to report fatal errors back to the parser's catch block.
APG Version 7.0 is licensed under the
2-Clause BSD License,
an Open Source Initiative Approved License.