Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
parserp.h
Go to the documentation of this file.
1 /* *************************************************************************************
2  Copyright (c) 2021, Lowell D. Thomas
3  All rights reserved.
4 
5  This file is part of APG Version 7.0.
6  APG Version 7.0 may be used under the terms of the BSD 2-Clause License.
7 
8  Redistribution and use in source and binary forms, with or without
9  modification, are permitted provided that the following conditions are met:
10 
11  1. Redistributions of source code must retain the above copyright notice, this
12  list of conditions and the following disclaimer.
13 
14  2. Redistributions in binary form must reproduce the above copyright notice,
15  this list of conditions and the following disclaimer in the documentation
16  and/or other materials provided with the distribution.
17 
18  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 
29 * *************************************************************************************/
37 #ifndef LIB_PARSERP_H_
38 #define LIB_PARSERP_H_
39 
46 typedef struct {
47  uint32_t uiSizeofAchar;
48  uint32_t uiSizeofUint;
50  uint32_t uiAcharTableLength;
51  uint32_t uiPpptTableLength;
52  uint32_t uiParserInitLength;
53  const char* cpStringTable;
54  const uint8_t* ucpPpptTable;
55  const void* vpAcharTable;
56  const void* vpParserInit;
57 } parser_init;
58 
59 
69 typedef struct {
97 } init_hdr;
98 
99 
100 // runtime opcodes
101 struct parser_tag;
108 union opcode_tag;
114 typedef void (*pfn_op)(struct parser_tag* spCtx, const union opcode_tag* spOp);
115 
119 typedef struct {
120  const char* cpRuleName;
121  const uint8_t* ucpPpptMap;
122  const union opcode_tag* spOp;
128 } rule;
129 
133 typedef struct {
134  const char* cpUdtName;
140 } udt;
141 
142 // opcodes
146 typedef struct {
148  const uint8_t* ucpPpptMap;
151 } op_alt;
152 
156 typedef struct {
158  const uint8_t* ucpPpptMap;
161 } op_cat;
162 
166 typedef struct {
168  const uint8_t* ucpPpptMap;
171 } op_rep;
172 
176 typedef struct {
178  const uint8_t* ucpPpptMap;
180 }op_rnm;
181 
185 typedef struct {
187  const uint8_t* ucpPpptMap;
190 } op_trg;
191 
195 typedef struct {
197  const uint8_t* ucpPpptMap;
198  const achar* acpStrTbl;
200 } op_tls;
201 
205 typedef struct {
207  const uint8_t* ucpPpptMap;
208  const achar* acpStrTbl;
210 } op_tbs;
211 
215 typedef struct {
217  const uint8_t* ucpPpptMap;
220 } op_udt;
221 
225 typedef struct {
227  const uint8_t* ucpPpptMap;
228 } op_and;
229 
233 typedef struct {
235  const uint8_t* ucpPpptMap;
236 } op_not;
237 
241 typedef struct {
243  const uint8_t* ucpPpptMap;
247 } op_bkr;
248 
252 typedef struct {
254  const uint8_t* ucpPpptMap;
255 } op_bka;
256 
260 typedef struct {
262  const uint8_t* ucpPpptMap;
263 } op_bkn;
264 
268 typedef struct {
270  const uint8_t* ucpPpptMap;
271 } op_abg;
272 
276 typedef struct {
278  const uint8_t* ucpPpptMap;
279 } op_aen;
290 typedef struct {
292  const uint8_t* ucpPpptMap;
293 } op_gen;
294 
295 
296 typedef union opcode_tag {
314 } opcode;
315 
316 // parser context
320 typedef struct parser_tag {
321  // basic objects
322  const void* vpValidate;
325  void* vpMem;
326  void* vpAst;
327  void* vpTrace;
328  void* vpStats;
329  void* vpBkru;
330  void* vpBkrp;
333  // grammar data
334  const char* cpStringTable;
339  opcode* spOpcodes;
344  // input data
353  // look around management
357  // PPPT
358  const uint8_t* ucpMaps;
365  // parsing control
369  opcode sStartOp;
375  // parsing state
377 } parser;
378 
379 void* vpParserAllocCtor(exception* spException, void* vpParserInit, abool bAllocateTables);
380 aint uiGetAcharTable(parser_init* spHdr, achar* acpAcharTable);
381 abool bGetParserInitData(parser_init* spHdr, luint* luipParserInit);
382 void vGetChildListTable(init_hdr* spHdr, aint* uipList);
383 void vTranslateRules(parser* spCtx, rule* spRules, opcode* spOpcodes, luint* luipData);
384 void vTranslateUdts(parser* spCtx, udt* spUdts, luint* luipData);
385 void vTranslateOpcodes(parser* spCtx, rule* spRules, udt* spUdts, opcode* spOpcodes, luint* luipData);
386 uint8_t ucGetMapVal(const uint8_t* ucpMap, luint luiOffset, luint luiChar);
387 
388 #ifndef APG_NO_PPPT
389 void vDisplayMap();
390 abool bPpptEval(parser* spCtx, const opcode* spOp, aint uiOffset);
391 aint uiPpptState(parser* spCtx, const opcode* spOp, aint uiOffset);
392 #endif /* APG_NO_PPPT */
393 
394 #endif /* LIB_PARSERP_H_ */
op_rnm::uiId
aint uiId
The operation identifier, ID_ALT.
Definition: parserp.h:177
parser_tag::vpValidate
const void * vpValidate
Set to a "magic number" by the constructor. Must be valid for all other parser function calls.
Definition: parserp.h:322
op_tls
Data structure for a single TLS opcode.
Definition: parserp.h:195
opcode_tag::sCat
op_cat sCat
The concatenation CAT opcode.
Definition: parserp.h:300
parser_tag::uiMapSize
aint uiMapSize
Number of bytes in a single PPPT map.
Definition: parserp.h:359
op_tls::uiStrLen
aint uiStrLen
Number of characters in the string.
Definition: parserp.h:199
op_aen::uiId
aint uiId
The operation identifier, ID_ALT.
Definition: parserp.h:277
init_hdr::uiVersionOffset
luint uiVersionOffset
Offset from the beginning of the string table to the null-terminated version number string.
Definition: parserp.h:82
op_not::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for this opcode, if any.
Definition: parserp.h:235
op_tbs::acpStrTbl
const achar * acpStrTbl
Pointer to the alphabet character table for the first character of the allowed string.
Definition: parserp.h:208
op_bka::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for this opcode, if any.
Definition: parserp.h:254
bGetParserInitData
abool bGetParserInitData(parser_init *spHdr, luint *luipParserInit)
Re-size the initialization data to the required integer size.
Definition: parser-get-init.c:80
parser_tag::uipChildList
const aint * uipChildList
Pointer to the table of child indexes for ALT and CAT operators.
Definition: parserp.h:336
opcode_tag::sRep
op_rep sRep
The repetition REP opcode.
Definition: parserp.h:301
parser_tag::acpAcharTable
const achar * acpAcharTable
Pointer to the alphabet character table for TLS and TBS operators.
Definition: parserp.h:335
op_tbs::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for this opcode, if any.
Definition: parserp.h:207
op_alt::uipChildList
const aint * uipChildList
Pointer to the first child opcode index.
Definition: parserp.h:149
op_trg::acMin
achar acMin
Minimum alphabet character in the allowed range.
Definition: parserp.h:188
parser_tag::sCBData
callback_data sCBData
The callback data, initialized by the parser and passed to user-defined call back functions.
Definition: parserp.h:371
op_rnm::spRule
rule * spRule
Pointer to the rule for this operation.
Definition: parserp.h:179
parser_init::uiSizeofUint
uint32_t uiSizeofUint
Minimum size, in bytes, required for the basic parser unsigned integer, aint.
Definition: parserp.h:48
parser_tag::uiSubStringLength
aint uiSubStringLength
The number of characters in the substring to parse.
Definition: parserp.h:351
opcode_tag::sNot
op_not sNot
The negative look ahead NOT opcode.
Definition: parserp.h:308
udt::pfnCallback
parser_callback pfnCallback
Pointer to the call back function for this UDT. The parser will throw an exception if this is NULL....
Definition: parserp.h:135
parser_tag::spRules
rule * spRules
Pointer to the list of rules.
Definition: parserp.h:337
init_hdr::uiOpcodesOffset
luint uiOpcodesOffset
Offset from the beginning of the initialization data to the to the list of opcodes.
Definition: parserp.h:94
opcode_tag::sTrg
op_trg sTrg
The terminal range TRG opcode.
Definition: parserp.h:303
parser_tag::uiStartRule
aint uiStartRule
The current index of the start rule.
Definition: parserp.h:345
parser_init::cpStringTable
const char * cpStringTable
Pointer to the string table.
Definition: parserp.h:53
init_hdr::uiUdtCount
luint uiUdtCount
The number of UDTs in the grammar.
Definition: parserp.h:78
parser_tag::vpVecInputString
void * vpVecInputString
Vector to keep a copy of the input string.
Definition: parserp.h:346
op_rep
Data structure for a single REP opcode.
Definition: parserp.h:166
opcode_tag::sBka
op_bka sBka
The positive look behind BKA opcode.
Definition: parserp.h:310
op_udt
Data structure for a single UDT opcode.
Definition: parserp.h:215
init_hdr::uiRuleCount
luint uiRuleCount
The number of rules in the grammar.
Definition: parserp.h:77
parser_tag::pfnOpFunc
pfn_op * pfnOpFunc
Pointer to the current node operation function.
Definition: parserp.h:331
init_hdr::uiChildListOffset
luint uiChildListOffset
Offset from the beginning of the initialization data to the list of ALT and CAT child node opcode ind...
Definition: parserp.h:85
parser_init::uiAcharTableLength
uint32_t uiAcharTableLength
Length of this data's alphabet character table.
Definition: parserp.h:50
rule::pfnCallback
parser_callback pfnCallback
Pointer to the call back function for this rule. NULL if the user has not defined a call back functio...
Definition: parserp.h:124
parser_tag::spException
exception * spException
Pointer to the exception structure to use for reporting fatal errors.
Definition: parserp.h:324
op_cat::uipChildList
const aint * uipChildList
Pointer to the first child opcode index.
Definition: parserp.h:159
op_alt::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for this opcode, if any.
Definition: parserp.h:148
uiGetAcharTable
aint uiGetAcharTable(parser_init *spHdr, achar *acpAcharTable)
Extract the alphabet character table from the initialization data.
Definition: parser-get-init.c:43
op_bkn
Data structure for a single BKN opcode.
Definition: parserp.h:260
op_abg::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for this opcode, if any.
Definition: parserp.h:270
achar
uint_fast8_t achar
achar is the type for the parser's alphabet characters.
Definition: apg.h:91
op_and::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for this opcode, if any.
Definition: parserp.h:227
op_rep::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for this opcode, if any.
Definition: parserp.h:168
parser_tag::sStartOp
opcode sStartOp
Placeholder for the parser-generated RNM operator of the start rule. The root node of the parse tree.
Definition: parserp.h:369
rule::spOp
const union opcode_tag * spOp
Pointer to the first opcode of the rule.
Definition: parserp.h:122
parser_tag::uiOpcodeCount
aint uiOpcodeCount
The number of opcodes (node operations) generated by the SABNF grammar.
Definition: parserp.h:342
op_rnm
Data structure for a single RNM opcode.
Definition: parserp.h:176
op_trg::acMax
achar acMax
Maximum alphabet character in the allowed range.
Definition: parserp.h:189
parser_tag::vpTrace
void * vpTrace
Pointer to the trace object context, if any. See vpTraceCtor().
Definition: parserp.h:327
op_tbs::uiStrLen
aint uiStrLen
Number of characters in the string.
Definition: parserp.h:209
vpParserInit
const void * vpParserInit
Definition: sabnf-grammar.c:1422
parser_tag::uiMapCount
aint uiMapCount
Number of maps in the PPPT.
Definition: parserp.h:360
init_hdr::uiOpcodeCount
luint uiOpcodeCount
The number of opcodes in the grammar.
Definition: parserp.h:79
op_udt::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for this opcode, if any.
Definition: parserp.h:217
op_bkr::uiId
aint uiId
The operation identifier, ID_ALT.
Definition: parserp.h:242
op_bkn::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for this opcode, if any.
Definition: parserp.h:262
init_hdr::uiSizeInInts
luint uiSizeInInts
The number of integers in the initialization data, including this header.
Definition: parserp.h:70
op_gen::uiId
aint uiId
The opcode identifier e.g. ID_ALT.
Definition: parserp.h:291
parser_init::uiSizeofAchar
uint32_t uiSizeofAchar
Minimum size, in bytes, required for the alphabet characters, achar.
Definition: parserp.h:47
parser_init::uiParserInitLength
uint32_t uiParserInitLength
Length of the parser initialization data.
Definition: parserp.h:52
parser_init::uiStringTableLength
uint32_t uiStringTableLength
Length of this data's string table.
Definition: parserp.h:49
parser_init
The initialization information generated by APG.
Definition: parserp.h:46
parser_callback
void(* parser_callback)(callback_data *spData)
User-written callback function prototype.
Definition: parser.h:178
op_trg::uiId
aint uiId
The operation identifier, ID_ALT.
Definition: parserp.h:186
parser_tag::uiOpState
aint uiOpState
State of the current opcode being processed.
Definition: parserp.h:368
init_hdr::uiLicenseOffset
luint uiLicenseOffset
Offset from the beginning of the string table to the null-terminated license string.
Definition: parserp.h:84
op_not::uiId
aint uiId
The operation identifier, ID_ALT.
Definition: parserp.h:234
parser_tag::ucpMaps
const uint8_t * ucpMaps
Pointer to the PPPT maps.
Definition: parserp.h:358
parser_init::vpAcharTable
const void * vpAcharTable
Pointer to the alphabet character table or NULL if none. (Possible for small grammars....
Definition: parserp.h:55
vGetChildListTable
void vGetChildListTable(init_hdr *spHdr, aint *uipList)
Extract the child index list from the initialization data.
Definition: parser-get-init.c:130
op_bkn::uiId
aint uiId
The operation identifier, ID_ALT.
Definition: parserp.h:261
rule::uiRuleIndex
aint uiRuleIndex
The rule index - zero-based order in which the rule appears in the SABNF grammar.
Definition: parserp.h:127
aint
uint_fast32_t aint
The APG parser's unsigned integer type.
Definition: apg.h:79
parser_tag::sState
parser_state sState
The final state of the parser.
Definition: parserp.h:376
opcode_tag::sUdt
op_udt sUdt
The User-Defined Terminal UDT opcode.
Definition: parserp.h:306
parser_tag::spOpcodes
opcode * spOpcodes
Pointer to the list of opcodes.
Definition: parserp.h:339
opcode_tag::sAen
op_aen sAen
The end-of-string anchor AEN opcode.
Definition: parserp.h:313
op_tls::acpStrTbl
const achar * acpStrTbl
Pointer to the alphabet character table for the first character of the allowed string.
Definition: parserp.h:198
op_abg::uiId
aint uiId
The operation identifier, ID_ALT.
Definition: parserp.h:269
init_hdr::uiAcharMin
luint uiAcharMin
The minimum value of all of the alphabet characters (achar) present in the grammar.
Definition: parserp.h:71
udt::cpUdtName
const char * cpUdtName
Pointer to the (null-terminated) ASCII rule name.
Definition: parserp.h:134
opcode_tag::sBkr
op_bkr sBkr
The back reference BKR opcode.
Definition: parserp.h:309
parser_tag::cpStringTable
const char * cpStringTable
Pointer to the ASCII string table with rule and UDT names.
Definition: parserp.h:334
op_rep::uiMin
aint uiMin
Minimum number of repetitions allowed.
Definition: parserp.h:169
op_tls::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for this opcode, if any.
Definition: parserp.h:197
init_hdr::uiUdtsOffset
luint uiUdtsOffset
Offset from the beginning of the initialization data to the to the list of UDTs.
Definition: parserp.h:91
pfn_op
void(* pfn_op)(struct parser_tag *spCtx, const union opcode_tag *spOp)
Prototype for the node operation functions.
Definition: parserp.h:114
init_hdr::uiUdtsLength
luint uiUdtsLength
Number of integers in the UDT list.
Definition: parserp.h:93
parser_state
The parser's final state.
Definition: parser.h:183
parser_tag::uiLookBehindLength
aint uiLookBehindLength
The maximum number of character to search for a match in look behind.
Definition: parserp.h:354
init_hdr::uiUintMax
luint uiUintMax
The maximum value of all of the integers present in this initialization data.
Definition: parserp.h:74
op_gen
General opcode. Only holds the opcode ID and PPPT map pointer.
Definition: parserp.h:290
opcode_tag::sAnd
op_and sAnd
The positive look ahead AND opcode.
Definition: parserp.h:307
exception
A structure to describe the type and location of a caught exception.
Definition: exception.h:47
op_tbs
Data structure for a single TBS opcode.
Definition: parserp.h:205
op_not
Data structure for a single NOT opcode.
Definition: parserp.h:233
parser_tag::uiOffset
aint uiOffset
Offset to the current phrase to parse.
Definition: parserp.h:366
op_tls::uiId
aint uiId
The operation identifier, ID_ALT.
Definition: parserp.h:196
parser_tag::vpAst
void * vpAst
Pointer to the AST object context, if any. See vpAstCtor().
Definition: parserp.h:326
op_aen
Data structure for a single AEN opcode.
Definition: parserp.h:276
parser_tag::uiInputStringLength
aint uiInputStringLength
Number of characters in the input string.
Definition: parserp.h:348
init_hdr::uiOpcodesLength
luint uiOpcodesLength
Number of integers in the opcode list.
Definition: parserp.h:96
op_cat::uiId
aint uiId
The operation identifier, ID_ALT.
Definition: parserp.h:157
op_cat::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for this opcode, if any.
Definition: parserp.h:158
op_gen::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for this opcode, if any.
Definition: parserp.h:292
op_and::uiId
aint uiId
The operation identifier, ID_ALT.
Definition: parserp.h:226
vTranslateOpcodes
void vTranslateOpcodes(parser *spCtx, rule *spRules, udt *spUdts, opcode *spOpcodes, luint *luipData)
Translate the initialization data for the opcodes into the internal opcode format.
Definition: parser-translate-init.c:76
opcode_tag::sAbg
op_abg sAbg
The begin-of-string anchor ABG opcode.
Definition: parserp.h:312
luint
uintmax_t luint
luint is used to cast integers suitable for the %"PRIuMAX" printf format.
Definition: apg.h:133
op_bkr::uiMode
aint uiMode
Definition: parserp.h:246
opcode_tag::sTls
op_tls sTls
The terminal literal string TLS opcode.
Definition: parserp.h:305
callback_data
The data struct passed to each callback function.
Definition: parser.h:134
op_udt::uiEmpty
aint uiEmpty
True if this UDT can return EMPTY, false otherwise.
Definition: parserp.h:219
parser_init::ucpPpptTable
const uint8_t * ucpPpptTable
Pointer to the PPPT or NULL if none.
Definition: parserp.h:54
opcode_tag::sAlt
op_alt sAlt
The alternation ALT opcode.
Definition: parserp.h:299
opcode_tag::sGen
op_gen sGen
Each opcode has its ID as the first integer. This general opcode serves only the purpose of getting t...
Definition: parserp.h:297
op_and
Data structure for a single AND opcode.
Definition: parserp.h:225
udt::uiEmpty
aint uiEmpty
APG_TRUE if this UDT can be empty, APG_FALSE otherwise. Parser will throw an exception if this if fal...
Definition: parserp.h:137
op_bkr::uiCase
aint uiCase
Definition: parserp.h:245
parser_tag::acAcharMin
achar acAcharMin
The minimum alphabet character referenced by the SABNF grammar.
Definition: parserp.h:361
parser_tag::uiRuleCount
aint uiRuleCount
The number of rules in the SABNF grammar.
Definition: parserp.h:340
init_hdr::uiSizeofAchar
luint uiSizeofAchar
The minimum size, in bytes, required to hold all alphabet characters in the grammar.
Definition: parserp.h:73
vTranslateUdts
void vTranslateUdts(parser *spCtx, udt *spUdts, luint *luipData)
Translate the initialization data for the UDTs into the internal UDT format.
Definition: parser-translate-init.c:60
opcode_tag::sBkn
op_bkn sBkn
The negative look behind BKN opcode.
Definition: parserp.h:311
op_rep::uiMax
aint uiMax
Maximum number of repetitions allowed.
Definition: parserp.h:170
parser_tag::spUdts
udt * spUdts
Pointer to the list of UDTs.
Definition: parserp.h:338
parser_tag::uiSubStringBeg
aint uiSubStringBeg
The offset to the first character of the sub-string to parse.
Definition: parserp.h:349
rule
Data structure for a single rule.
Definition: parserp.h:119
parser_tag::uiTreeDepth
aint uiTreeDepth
The current parse tree depth.
Definition: parserp.h:373
parser_tag::uiUdtCount
aint uiUdtCount
The number of UDTs in the SABNF grammar.
Definition: parserp.h:341
op_aen::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for this opcode, if any.
Definition: parserp.h:278
init_hdr::uiRulesOffset
luint uiRulesOffset
Offset from the beginning of the initialization data to the to the list of rules.
Definition: parserp.h:88
parser_tag::vpBkru
void * vpBkru
Pointer to the universal-mode back reference object context, if any. See vpBkruCtor().
Definition: parserp.h:329
parser_tag::vpBkrp
void * vpBkrp
Pointer to the parent-mode back reference object context, if any. See vpBkrpCtor().
Definition: parserp.h:330
parser_tag::uiInLookaround
aint uiInLookaround
True if in look ahead or look behind mode.
Definition: parserp.h:355
vTranslateRules
void vTranslateRules(parser *spCtx, rule *spRules, opcode *spOpcodes, luint *luipData)
Translate the initialization data for the rules into the internal rules format.
Definition: parser-translate-init.c:43
init_hdr::uiAcharMax
luint uiAcharMax
The maximum value of all of the alphabet characters (achar) present in the grammar.
Definition: parserp.h:72
op_alt
Data structure for a single ALT opcode.
Definition: parserp.h:146
op_bka
Data structure for a single BKA opcode.
Definition: parserp.h:252
op_trg::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for this opcode, if any.
Definition: parserp.h:187
op_bka::uiId
aint uiId
The operation identifier, ID_ALT.
Definition: parserp.h:253
op_bkr::uiRuleIndex
aint uiRuleIndex
Index of the rule to back reference.
Definition: parserp.h:244
rule::uiOpcodeCount
aint uiOpcodeCount
Number of opcodes in this rule.
Definition: parserp.h:123
op_cat
Data structure for a single CAT opcode.
Definition: parserp.h:156
ucGetMapVal
uint8_t ucGetMapVal(const uint8_t *ucpMap, luint luiOffset, luint luiChar)
op_alt::uiId
aint uiId
The operation identifier, ID_ALT.
Definition: parserp.h:147
init_hdr::uiChildListLength
luint uiChildListLength
The number of integers in the child index list.
Definition: parserp.h:87
abool
uint8_t abool
abool is the APG bool type.
Definition: apg.h:140
rule::uiEmpty
aint uiEmpty
APG_TRUE if this rule can be empty, APG_FALSE otherwise.
Definition: parserp.h:126
op_rep::uiId
aint uiId
The operation identifier, ID_ALT.
Definition: parserp.h:167
parser_tag::uiSubStringEnd
aint uiSubStringEnd
The offset to the first character beyond the end of the sub-string to parse.
Definition: parserp.h:350
opcode_tag::sRnm
op_rnm sRnm
The rule name RNM opcode.
Definition: parserp.h:302
parser_tag::vpMem
void * vpMem
Pointer to a memory object context used for all memory allocations by the parser.
Definition: parserp.h:325
parser_tag
The parser object's context. Holds the parser's state. Opaque to user.
Definition: parserp.h:320
parser_init::uiPpptTableLength
uint32_t uiPpptTableLength
Length of this data's PPPT.
Definition: parserp.h:51
init_hdr::uiMapSize
luint uiMapSize
The number of bytes in one PPPT map.
Definition: parserp.h:81
init_hdr::uiCopyrightOffset
luint uiCopyrightOffset
Offset from the beginning of the string table to the null-terminated copyright string.
Definition: parserp.h:83
op_bkr::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for this opcode, if any.
Definition: parserp.h:243
vpParserAllocCtor
void * vpParserAllocCtor(exception *spException, void *vpParserInit, abool bAllocateTables)
The parser constructor.
Definition: parser.c:88
op_abg
Data structure for a single ABG opcode.
Definition: parserp.h:268
parser_tag::acpInputString
const achar * acpInputString
Pointer to the input string.
Definition: parserp.h:347
init_hdr::uiMapCount
luint uiMapCount
The number rule, UDT, and opcode PPPT maps.
Definition: parserp.h:80
opcode_tag::sTbs
op_tbs sTbs
The terminal binary string TBS opcode.
Definition: parserp.h:304
op_rnm::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for this opcode, if any.
Definition: parserp.h:178
init_hdr
Header for the parser initialization data.
Definition: parserp.h:69
op_trg
Data structure for a single TRG opcode.
Definition: parserp.h:185
parser_tag::uiPhraseLength
aint uiPhraseLength
Phrase length of a matched phrase.
Definition: parserp.h:367
init_hdr::uiSizeofUint
luint uiSizeofUint
The minimum integer size, in bytes, required to hold all of the integers in the initialization data.
Definition: parserp.h:75
parser_init::vpParserInit
const void * vpParserInit
Pointer to the parser's initialization data.
Definition: parserp.h:56
parser_tag::acAcharMax
achar acAcharMax
The maximum alphabet character referenced by the SABNF grammar.
Definition: parserp.h:362
opcode_tag
A union of all possible node type opcode data structures.
Definition: parserp.h:296
rule::ucpPpptMap
const uint8_t * ucpPpptMap
Pointer to the PPPT map for the rule.
Definition: parserp.h:121
init_hdr::uiRulesLength
luint uiRulesLength
Number of integers in the rules list.
Definition: parserp.h:90
op_udt::uiId
aint uiId
The operation identifier, ID_ALT.
Definition: parserp.h:216
udt
Data structure for a single UDT.
Definition: parserp.h:133
op_udt::spUdt
udt * spUdt
Pointer to the UDT structure.
Definition: parserp.h:218
udt::uiUdtIndex
aint uiUdtIndex
The UDT index - the zero-based order in which the UDT appears in the SABNF grammar.
Definition: parserp.h:139
op_tbs::uiId
aint uiId
The operation identifier, ID_ALT.
Definition: parserp.h:206
op_alt::uiChildCount
aint uiChildCount
Number of children.
Definition: parserp.h:150
rule::cpRuleName
const char * cpRuleName
Pointer to the (null-terminated) ASCII rule name.
Definition: parserp.h:120
op_cat::uiChildCount
aint uiChildCount
Number of children.
Definition: parserp.h:160
parser_tag::vpStats
void * vpStats
Pointer to the stats object context, if any. See vpStatsCtor().
Definition: parserp.h:328
op_bkr
Data structure for a single BKR opcode.
Definition: parserp.h:241
APG Version 7.0 is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.