Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
|
Go to the documentation of this file.
80 #define ID_PPPT_NOMATCH 0
82 #define ID_PPPT_MATCH 1
83 #define ID_PPPT_EMPTY 2
84 #define ID_PPPT_ACTIVE 3
92 #define ID_AST_POST 31
94 #define ID_AST_SKIP 33
102 #define ID_ATTR_MR 42
108 #define ID_LOOKAROUND_NONE 50
110 #define ID_LOOKAROUND_AHEAD 51
111 #define ID_LOOKAROUND_BEHIND 52
117 #define ID_BKR_MODE_U 60
119 #define ID_BKR_MODE_P 61
120 #define ID_BKR_CASE_S 62
121 #define ID_BKR_CASE_I 63
abool bParseSubString
If true (non-zero), only parse the defined sub-string of the input string.
aint uiSubStringBeg
The first character of the sub-string to parse. Must be < uiInputLength or exception is thrown.
aint uiSuccess
True (>0) if the input string was matched in its entirety, false (0) otherwise.
aint uiUDTIndex
[read only] The UDT index of this UDT's callback. APG_UNDEFINED if this is a rule callback.
void vParserParse(void *vpCtx, parser_config *spConfig, parser_state *spState)
Parse an input string of alphabet characters.
aint uiParserOffset
[read only] Offset from acpString to the first character to match
const achar * acpString
[read only] Pointer to the input sub-string,
const achar * acpInput
Pointer to the input string.
aint uiParserState
[read only] ID_ACTIVE if the parser is going down the tree. ID_MATCH or ID_NOMATCH if coming up the t...
void * vpUserData
Pointer to user data, if any. Not examined or used by the parser in any way. Presented to the user's ...
uint_fast8_t achar
achar is the type for the parser's alphabet characters.
aint uiStringLength
Length of the input string.
aint uiParserRuleLookup(void *vpCtx, const char *cpRuleName)
Find the rule index corresponding to a rule name.
aint uiRuleIndex
[read only] The rule index of this rule's callback. APG_UNDEFINED if this is a UDT callback.
const void * vpParserInit
void(* parser_callback)(callback_data *spData)
User-written callback function prototype.
uint_fast32_t aint
The APG parser's unsigned integer type.
aint uiInputLength
Number of input string alphabet characters.
void vParserSetRuleCallback(void *vpCtx, aint uiRuleId, parser_callback pfnCallback)
Set a call back function for a specific rule.
aint uiParserPhraseLength
[read only] The parser's matched phrase length if uiParserState is ID_MATCH or ID_NOMATCH....
Defines the input string and other configuration parameters for the parser,.
aint uiCallbackState
[input/output] Rule name (RNM) callback functions: If ID_ACTIVE, the parser takes no action....
void vParserSetUdtCallback(void *vpCtx, aint uiUdtId, parser_callback pfnCallback)
Set a call back function for a specific UDT.
The parser's final state.
A structure to describe the type and location of a caught exception.
aint uiCallbackPhraseLength
[input/output] The phrase length of the matched phrase if the callback function returns ID_MATCH.
The data struct passed to each callback function.
aint uiLookBehindLength
The maximum length to look behind for a match. Use 0 or APG_INFINITE for infinite look behind.
aint uiState
One of ID_EMPTY, ID_MATCH or ID_NOMATCH. Note that it is possible for the parser to match a phrase wi...
void * vpMem
[read only] Do not use. For system use only.
const char * cpParserUdtName(void *vpCtx, aint uiUdtIndex)
Find the UDT name corresponding to a UDT index.
void * vpCtx
[read only] Do not use. For system use only.
void * vpUserData
[input/output] User-defined data passed to to the parser in parser_config.
aint uiSubStringLength
The number of characters in the sub-string. If 0, then the remainder of the string from uiSubStringBe...
const char * cpParserRuleName(void *vpCtx, aint uiRuleIndex)
Find the rule name from the corresponding index.
aint uiMaxTreeDepth
The maximum tree depth reached during the parse.
aint uiHitCount
The number of nodes visited during the traversal of the parse tree.
uint8_t abool
abool is the APG bool type.
aint uiPhraseLength
Length of the matched phrase.
aint uiStartRule
Index of the start rule. Any rule in the SABNF grammar may be used as the start rule.
void * vpParserCtor(exception *spException, void *vpParserInit)
The parser's constructor for file initialization data.
aint uiParserUdtLookup(void *vpCtx, const char *cpUdtName)
aint uiStringLength
[read only] The input string length.
abool bParserValidate(void *vpCtx)
Validate the context pointer of a parser.
exception * spException
[read only] Use to throw exceptions back to the parser's catch block scope: e.g. XTHROW(spException,...
void vParserDtor(void *vpCtx)
Clears the parser component's context and frees all heap memory associated with this parser.
APG Version 7.0 is licensed under the
2-Clause BSD License,
an Open Source Initiative Approved License.