Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
|
void vAstInfo(void *vpCtx, ast_info *spInfo)
Retrieve basic information about the AST object.
aint uiThatRecord
The matching record number. That is, if uiThisRecord the number of the record that opens the rule,...
abool bAstValidate(void *vpCtx)
Validate an AST context pointer.
const achar * acpString
The parsed input string.
aint uiRuleCount
The number of rules.
aint uiStringLength
The number of characters in the input string.
aint uiPhraseLength
The number of characters in the matched phrase.
aint uiUdtCount
The number of UDTs.
exception * spException
Use but don't alter. Use to throw exceptions to the AST catch block.
Input data to the AST callback functions.
uint_fast8_t achar
achar is the type for the parser's alphabet characters.
const char * cpName
Name of the rule or UDT.
const char * cpName
Name of the rule or UDT of this record.
aint uiIndex
Index of the rule or UDT.
uint_fast32_t aint
The APG parser's unsigned integer type.
void vAstDtor(void *vpCtx)
abool bIsUdt
True if this record is for a UDT.
void vAstTranslate(void *vpCtx, void *vpUserData)
Do a depth-first traversal of the AST with user-defined callback functions to translate the AST recor...
All the information a user needs to write a custom AST translator.
A structure to describe the type and location of a caught exception.
aint(* ast_callback)(ast_data *spData)
The prototype for AST translation callback functions.
void vAstSetUdtCallback(void *vpCtx, aint uiUdtIndex, ast_callback pfnCallback)
Define a callback function for a single UDT on the AST.
aint uiRecordCount
The number of records (two for each node of the AST, one down traversal, one up.)
aint uiState
ID_AST_PRE if the current record opens the rule, ID_AST_POST if the current record closes the rule.
aint uiThisRecord
The record number.
ast_record * spRecords
The list of records in the order of a depth-first traversal of the AST.
abool bIsUdt
True if this record is for a UDT. False if it is for a rule.
void vAstSetRuleCallback(void *vpCtx, aint uiRuleIndex, ast_callback pfnCallback)
Define a callback function for a single rule on the AST.
uint8_t abool
abool is the APG bool type.
aint uiPhraseOffset
The offset into the input string to the first character of the matched phrase.
aint uiIndex
Index of the rule or UDT of this record.
void vAstClear(void *vpCtx)
Clear the AST records for reuse of the AST object.
void * vpAstCtor(void *vpParserCtx)
The AST object constructor.
APG Version 7.0 is licensed under the
2-Clause BSD License,
an Open Source Initiative Approved License.