Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
Data Structures
tracep.h File Reference

Private header file for the trace functions. More...

#include <stdio.h>
Include dependency graph for tracep.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  trace_record
 The information recorded & displayed by the trace object for each node visited. More...
 
struct  trace_config
 Configuration defining the subset of nodes to display information for. More...
 
struct  trace
 The trace object context. Maintains the trace object's state. More...
 

Macros

Trace Header Handling

The header may be handled by the trace object directly or if apgex is tracing, apgex will handle the header.

#define TRACE_HEADER_APGEX   2
 Identifies apgex as the header handler. More...
 
#define TRACE_HEADER_TRACE   3
 Identifies the trace object as the header handler. More...
 

Functions

Special Tracing Functions

These tracing functions are designed especially and exclusively for apgex tracing.

void vTraceApgexSeparator (void *vpCtx, aint uiLastIndex)
 Only called by apgex. More...
 
void vTraceApgexType (void *vpCtx, aint uiType)
 Called only by apgex. Sets the display type for apgex tracing. More...
 
void vTraceApgexHeader (void *vpCtx)
 Only called by apgex. More...
 
void vTraceApgexFooter (void *vpCtx)
 Only called by apgex. More...
 
Private Tracing Functions

These functions are only used by the trace and parser objects.

void vTraceBegin (void *vpCtx)
 Called by the parser to start the trace. More...
 
void vTraceEnd (void *vpCtx)
 Called by the parser to end the trace. More...
 
void vTraceDown (void *vpCtx, const opcode *spOp, aint uiOffset)
 Called by the parser prior to downward traversal of a parse tree node. More...
 
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. More...
 
void vDisplayRecord (trace *spCtx, trace_record *spRec, abool bIsMatchedPppt)
 Display one trace record. More...
 
void vDisplayHeader (trace *spCtx)
 Display the trace header. More...
 
void vDisplaySeparator (trace *spCtx, aint uiLastIndex)
 Display a separator between trace outputs (apgex only) More...
 
void vDisplayFooter (trace *spCtx)
 Display the trace footer. More...
 
void vSetDefaultConfig (trace *spTrace)
 Sets the default trace configuration on construction. More...
 

Detailed Description

Private header file for the trace functions.

Structures and function prototypes used only by the trace object.

Definition in file tracep.h.

Macro Definition Documentation

◆ TRACE_HEADER_APGEX

#define TRACE_HEADER_APGEX   2

Identifies apgex as the header handler.

Definition at line 50 of file tracep.h.

◆ TRACE_HEADER_TRACE

#define TRACE_HEADER_TRACE   3

Identifies the trace object as the header handler.

Definition at line 54 of file tracep.h.

Function Documentation

◆ vDisplayFooter()

void vDisplayFooter ( trace spCtx)

Display the trace footer.

Definition at line 141 of file trace-out.c.

◆ vDisplayHeader()

void vDisplayHeader ( trace spCtx)

Display the trace header.

Definition at line 98 of file trace-out.c.

◆ vDisplayRecord()

void vDisplayRecord ( trace spCtx,
trace_record spRec,
abool  bIsMatchedPppt 
)

Display one trace record.

Definition at line 110 of file trace-out.c.

◆ vDisplaySeparator()

void vDisplaySeparator ( trace spCtx,
aint  uiLastIndex 
)

Display a separator between trace outputs (apgex only)

Definition at line 129 of file trace-out.c.

◆ vSetDefaultConfig()

void vSetDefaultConfig ( trace spTrace)

Sets the default trace configuration on construction.

Definition at line 56 of file trace-config.c.

◆ vTraceApgexFooter()

void vTraceApgexFooter ( void *  vpCtx)

Only called by apgex.

Displays a special form of footer for apgex applications.

Definition at line 211 of file trace.c.

◆ vTraceApgexHeader()

void vTraceApgexHeader ( void *  vpCtx)

Only called by apgex.

Displays a special form of header for apgex applications.

Definition at line 199 of file trace.c.

◆ vTraceApgexSeparator()

void vTraceApgexSeparator ( void *  vpCtx,
aint  uiLastIndex 
)

Only called by apgex.

apgex may parse repeatedly on different sub-strings until it finds a match or fails completely. This is a special separator that is used to distinguish the individual traces for each attempt.

Definition at line 225 of file trace.c.

◆ vTraceApgexType()

void vTraceApgexType ( void *  vpCtx,
aint  uiType 
)

Called only by apgex. Sets the display type for apgex tracing.

Definition at line 116 of file trace-config.c.

◆ vTraceBegin()

void vTraceBegin ( void *  vpCtx)

Called by the parser to start the trace.

Called via the macro TRACE_BEGIN only trace is implemented.

Definition at line 237 of file trace.c.

◆ vTraceDown()

void vTraceDown ( void *  vpCtx,
const opcode *  spOp,
aint  uiOffset 
)

Called by the parser prior to downward traversal of a parse tree node.

Called via the macro TRACE_DOWN only trace is implemented.

Definition at line 266 of file trace.c.

◆ vTraceEnd()

void vTraceEnd ( void *  vpCtx)

Called by the parser to end the trace.

Called via the macro TRACE_END only trace is implemented.

Definition at line 251 of file trace.c.

◆ vTraceUp()

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.

Called via the macro TRACE_UP only trace is implemented.

Definition at line 285 of file trace.c.

APG Version 7.0 is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.