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

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

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ast
 The AST object context. Holds the object's state. More...
 

Functions

Private AST Functions

These functions are primarily for the parser to call (via macros, e.g. AST_CLEAR, etc.)

void vAstClear (void *vpCtx)
 Clear the AST records for reuse of the AST object. More...
 
void vAstRuleOpen (void *vpCtx, aint uiRuleIndex, aint uiPhraseOffset)
 Called by parser's RNM operator before downward traversal. More...
 
void vAstRuleClose (void *vpCtx, aint uiRuleIndex, aint uiState, aint uiPhraseOffset, aint uiPhraseLength)
 Called by parser's RNM operator after upward traversal. More...
 
void vAstOpOpen (void *vpCtx)
 Called in preparation for a downward traversal of an RNM or UDT node. More...
 
void vAstOpClose (void *vpCtx, aint uiState)
 Called to finish up after an upward traversal of an RNM or UDT node. More...
 

Detailed Description

Private header file for the AST functions.

Applications should not need to include this header directly.

Definition in file astp.h.

Function Documentation

◆ vAstClear()

void vAstClear ( void *  vpCtx)

Clear the AST records for reuse of the AST object.

Parameters
vpCtxPointer to an AST context returned from vpAstCtor(); Silently ignored if NULL. However, if non-NULL it must be a valid AST context pointer or the application will exit with BAD_CONTEXT.

Definition at line 118 of file ast.c.

◆ vAstOpClose()

void vAstOpClose ( void *  vpCtx,
aint  uiState 
)

Called to finish up after an upward traversal of an RNM or UDT node.

Parameters
vpCtx- AST context handle returned from
See also
vpAstCtor. No validation is done here as this function is always called by a trusted parser operator function.
Parameters
uiStateID_MATCH or ID_NOMATCH, the result of the parse.

Definition at line 403 of file ast.c.

◆ vAstOpOpen()

void vAstOpOpen ( void *  vpCtx)

Called in preparation for a downward traversal of an RNM or UDT node.

Parameters
vpCtx- AST context handle returned from
See also
vpAstCtor. No validation is done here as this function is always called by a trusted parser operator function.

Definition at line 392 of file ast.c.

◆ vAstRuleClose()

void vAstRuleClose ( void *  vpCtx,
aint  uiRuleIndex,
aint  uiState,
aint  uiPhraseOffset,
aint  uiPhraseLength 
)

Called by parser's RNM operator after upward traversal.

Parameters
vpCtx- AST context handle returned from
See also
vpAstCtor. No validation is done here as this function is always called by a trusted parser operator function.
Parameters
uiRuleIndexThe index of the RNM rule. If uiRuleIndex > uiRuleCount then it represents a UDT whose index is uiRuleIndex - uiRuleCount.
uiStateID_MATCH or ID_NOMATCH, the result of the parse for this rule or UDT.
uiPhraseOffsetOffset into the input string of the offest of the matched phrase.
uiPhraseLengthThe number of match characters in the phrase.

Definition at line 329 of file ast.c.

◆ vAstRuleOpen()

void vAstRuleOpen ( void *  vpCtx,
aint  uiRuleIndex,
aint  uiPhraseOffset 
)

Called by parser's RNM operator before downward traversal.

Parameters
vpCtxPointer to a valid AST context returned by vpAstCtor(). No validation is done here as this function is always called by a trusted parser operator function.
uiRuleIndexThe index of the RNM rule. If uiRuleIndex > uiRuleCount then it represents a UDT whose index is uiRuleIndex - uiRuleCount.
uiPhraseOffsetOffset into the input string of the offest of the matched phrase.

Definition at line 286 of file ast.c.

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