Version 6.3
Copyright © 2005 - 2012 Lowell D. Thomas
APG
  … ABNF Parser Generator
All Data Structures Files Functions Variables Typedefs Macros Pages
Apg.h
Go to the documentation of this file.
1 /*******************************************************************************
2  APG Version 6.3
3  Copyright (C) 2005 - 2012 Lowell D. Thomas, all rights reserved
4 
5  author: Lowell D. Thomas
6  email: lowell@coasttocoastresearch.com
7  website: http://www.coasttocoastresearch.com
8 
9  This program is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 2 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program. If not, see
21  <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
22  or write to the Free Software Foundation, Inc.,
23  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 *******************************************************************************/
142 #ifndef APG_H_6_3
143 #define APG_H_6_3
144 //static int testing = 0; /**! member comment */
145 
146 #include <stdlib.h>
147 #include <string.h>
148 
149 // Begin C-language linkage specification
150 #if defined(__cplusplus)
151 extern "C"
152 {
153 #endif
154 
156 // BASIC INTEGER TYPES
158 // APG integer apg_uint, default = unsigned int
160 #if defined _APG_CFG_UINT && _APG_CFG_UINT == 1
161  typedef unsigned char apg_uint;
162 #elif defined _APG_CFG_UINT && _APG_CFG_UINT == 2
163  typedef unsigned short int apg_uint;
164 #elif defined _APG_CFG_UINT && _APG_CFG_UINT == 4
165  typedef unsigned int apg_uint;
166 #elif defined _APG_CFG_UINT && _APG_CFG_UINT == 8
167  typedef unsigned long int apg_uint;
168 #else
169  typedef unsigned int apg_uint;
170 #endif
171 
172 // APG alphabet character apg_achar, default = unsigned char
174 #if defined _APG_CFG_ACHAR && _APG_CFG_ACHAR == 1
175  typedef unsigned char apg_achar;
176 #elif defined _APG_CFG_ACHAR && _APG_CFG_ACHAR == 2
177  typedef unsigned short int apg_achar;
178 #elif defined _APG_CFG_ACHAR && _APG_CFG_ACHAR == 4
179  typedef unsigned int apg_achar;
180 #elif defined _APG_CFG_ACHAR && _APG_CFG_ACHAR == 8
181  typedef unsigned long int apg_achar;
182 #else
183  typedef unsigned char apg_achar;
184 #endif
185 
187 #define APG_TRUE 1 // apg_uint true value
188 
190 #define APG_FALSE 0 // apg_uint false value
191 
194 #define APG_UNDEFINED -1 // often used to represent an undefined integer
195 
199 #define APG_INFINITE -1 // often used to represent an infinite integer
200 
201 // NOTE: on Hungarian notation
202 // prefix - type
203 // c - char
204 // cp - char*
205 // ac - apg_achar
206 // acp - apg_achar*
207 // ui - apg_uint
208 // uip - apg_uint*
209 // v - void
210 // vp - void*
211 // s - struct/union
212 // sp - pointer to struct/union
213 
215 // CONFIGURATION CONTROL
216 // Control of debugging, statistics and tracing information is designed
217 // through macros so that when not needed, they generate no code.
218 //
219 // Debug information
220 // _APG_CFG_DEBUG - if defined:
221 // - automatically defines _APG_CFG_STATS
222 // - automatically defines _APG_CFG_TRACE
223 //
225 
226 // these macros generate no code unless otherwise defined
228 #if defined(_APG_CFG_DEBUG)
229  // debug implies defines tracing & statistics gathering
230  #undef _APG_CFG_TRACE
231  #define _APG_CFG_TRACE
232 
233  #undef _APG_CFG_STATS
234  #define _APG_CFG_STATS
235 #endif
236 
237 #if defined(_APG_CFG_TRACE)
238  // tracing macros (requires run-time set up in addition to _APG_CFG_TRACE)
239  #define APG_TRACE_ADMIN(ctx, a, i, e, c) vTraceAdmin((ctx), (a), (i), (e), (c));
240  #define APG_TRACE(ctx, op, a, i, off, pl) if((ctx)->vpTraceCtx){vTrace((ctx), (op), (a), (i), (off), (pl));}
241 #else
242  #define APG_TRACE_ADMIN(ctx, a, i, e, c)
243  #define APG_TRACE(ctx, op, a, i, off, pl)
244 #endif
245 
246 #if defined(_APG_CFG_STATS)
247  #define APG_STATS_ADMIN(ctx, a, s, r, cfg) vStatsAdmin((ctx), (a), (s), (r), (cfg))
248  #define APG_STATS(ctx, a, s, o, r) vStats((ctx), (a), (s), (o), (r))
249 #else
250  #define APG_STATS_ADMIN(ctx, a, s, r, cfg)
251  #define APG_STATS(ctx, a, s, o, r)
252 #endif
253 
255 // Configurable default values
256 #undef APG_VEC_ELEMENT
257 #undef APG_VEC_ALLOC
258 
261 #define APG_VEC_ELEMENT ((apg_uint)1) // default vector element size (bytes)
262 
265 #define APG_VEC_ALLOC ((apg_uint)100) // default initial number of vector elements allocated
266 
267 #define APG_DISPLAY_MAX_LINE 128
268 
270 // ALERT HANDLING
272 
276 typedef void (*PFN_ALERT)(unsigned int uiLine, const char* cpFile);
282 typedef void (*PFN_ALERT_MSG)(unsigned int uiLine, const char* cpFile, const char* cpMsg);
287 void vDefaultAlertHandler(unsigned int uiLine, const char* cpFile);
288 
290 // TOOLS
292 // non-ANSI minimum/maximum macros
293 #undef min
294 #undef max
295 
296 #define min(a,b) (((a) < (b)) ? (a) : (b))
297 
298 #define max(a,b) (((a) > (b)) ? (a) : (b))
299 
300 // stricmp is non-ANSI - not all CRTs support it
310 int apg_stricmp(const char* cpLhs, const char* cpRhs);
316 void vCharToAChar(apg_achar* acpAChars, const char* cpChars, apg_uint uiLen);
323 apg_uint uiACharToStringSize(const apg_achar* acpAChars, apg_uint uiALen);
338 apg_uint uiACharToString(char* cpChars, apg_uint uiCLen, const apg_achar* acpAChars, apg_uint uiALen);
339 
341 // APG INFORMATION
342 char* cpApgVersion();
343 char* cpApgAuthor();
344 char* cpApgDescription();
345 char* cpApgCopyright();
346 char* cpApgEmail();
347 char* cpApgWebsite();
348 char* cpApgGPLNotice();
351 // MEMORY MANAGEMENT COMPONENT
353 // A container for all parser & parser-related memory allocations.
354 // Intended for initial set ups, not for dynamic allocation during parsing.
356 
360 typedef struct{
368 } APG_MEM_STATS;
369 
371 typedef void* (*PFN_ALLOCATOR)(size_t);
373 typedef void (*PFN_DEALLOCATOR)(void*);
374 void* vpMemCtorA(PFN_ALLOCATOR pfnAllocator, PFN_DEALLOCATOR pfnDeAllocator);
375 void* vpMemCtor();
376 void vMemDtor(void* vpCtx);
377 apg_uint uiMemValidate(void* vpCtx);
378 void* vpMemAlloc(void* vpCtx, apg_uint uiBytes);
379 void* vpMemRealloc(void* vpCtx, void* vpData, apg_uint uiBytes);
380 void vMemFree(void* vpCtx, void* vpData);
381 apg_uint uiMemCheckPoint(void* vpCtx);
382 void vMemFreeToCheckPoint(void* vpCtx, apg_uint uiChk);
383 void vMemClear(void* vpCtx);
384 
386 // VECTOR
387 // a dynamic buffer for an arbitrary number of fixed-size elements
388 // Intended for initial set ups, not for dynamic allocation during parsing.
390 void* vpVecCtor(void* vpMemCtx, apg_uint uiElementSize, apg_uint uiInitialAlloc);
391 void vVecDtor(void* vpCtx);
392 void* vpVecPush(void* vpVec, void* vpElement);
393 void* vpVecPushn(void* vpCtx, void* vpElement, apg_uint uiCount);
394 void* vpVecPop(void* vpCtx);
395 void* vpVecPopn(void* vpCtx, apg_uint uiCount);
396 void* vpVecPopTo(void* vpCtx, apg_uint uiIndex);
397 void* vpVecFront(void* vpCtx);
398 void* vpVecBack(void* vpCtx);
399 void* vpVecAt(void* vpCtx, apg_uint uiIndex);
400 apg_uint uiVecBytes(void* vpCtx);
401 apg_uint uiVecSize(void* vpCtx);
402 apg_uint uiVecElementSize(void* vpCtx);
403 apg_uint uiVecReallocations(void* vpCtx);
404 apg_uint uiVecValidate(void* vpCtx);
405 void vVecClear(void* vpCtx);
406 
408 // PARSER
410 // structure passed to all syntax and semantic call back functions
411 /*
412 
413 // !!!! DEBUG
414 Therefore, some variables are defined in a hierarchy of useage:
415 <pre>
416 Syntax Analysis - uiParserSyntaxAnalysis()
417  rule callback functions
418  UDT callback functions
419 Semantic Analysis - uiParserAstTranslate()
420  rule callback functions
421  UDT callback functions
422 </pre>
423 
424 
425  Syntax Analysis, both rule and UDT callback functions.
426  <pre>
427  May be one of:
428  PRE_PARSE - indicates the downward traversal state. No phrase has yet been matched.
429  MATCH - a non-empty phrase has been matched
430  EMPTY - an empty phrase has been matched
431  NOMATCH - no phrase has been matched.
432  </pre>
433  Note on UDT
434 
435  From uiParserSyntaxAnalysis() may be any of PRE_PARSE, MATCH, EMPTY or NOMATCH.<br>
436  From uiParserAstTranslate() may be PRE_AST or POST_AST.
437 
438  // SYNTAX ANALYSIS: output - set uiPhraseLength to the matched phrase length or APG_UNDEFINED if no match found
439  // SEMANTIC ANALYSIS: uiPhraseLength for user's use only, ignored by parser on return
440 
441  // NOT USED BY PARSER - optional user-defined data, may be NULL
442 */
453 typedef struct{
454  void* vpCtx;
455  const apg_achar* acpSrc;
460  void* vpUserData;
461 } APG_CBDATA;
462 
515 typedef apg_uint (*APG_CALLBACK)(APG_CBDATA* spData);
516 
517 void vExecuteRule(APG_CBDATA* spData, apg_uint uiId, apg_uint uiOffset);
518 void vExecuteUdt(APG_CBDATA* spData, apg_uint uiId, apg_uint uiOffset);
519 
520 // call back function states
526 #define PRE_PARSE ((apg_uint)0) // pre-branch state
527 
532 #define NOMATCH ((apg_uint)1) // post-branch, string was not matched by grammar syntax
533 
538 #define EMPTY ((apg_uint)2) // post-branch, syntax was matched by an empty string
539 
544 #define MATCH ((apg_uint)3) // post-branch, syntax was matched with a string of one or more characters
545 
550 #define PRE_AST ((apg_uint)4) // post-branch state (semantic analysis only)
551 
556 #define POST_AST ((apg_uint)5) // post-branch state (semantic analysis only)
557 
558 // parser final state
561 typedef struct{
567 
568 // parser statistics
572 typedef struct{
577 } APG_STAT;
578 
582 typedef struct{
584  char* cpName;
586 } APG_NAME_STAT;
587 
591 typedef struct{
599  char* cpNames;
612 
613 // parser constructor/desctructor
614 void* vpParserCtor(void* vpParserInit, PFN_ALERT pfnAlertHandler);
615 void vParserDtor(void* vpCtx);
616 
617 // parser syntax analysis
618 apg_uint uiParserSyntaxInitCallbacks(void* vpCtx, APG_CALLBACK* spRuleCallbacks, APG_CALLBACK* spUdtCallbacks);
619 apg_uint uiParserSyntaxAnalysis(void* vpCtx, apg_uint uiStartRule, const apg_achar* acpSrc, apg_uint uiSrcLen, void* vpData);
620 apg_uint uiParserState(void* vpCtx, APG_PARSER_STATE* spState);
621 
622 // parser semantic analysis
623 void vParserAstInitNodes(void* vpCtx, apg_uint* uipRules, apg_uint* uipUdts);
624 void vParserAstInitCallbacks(void* vpCtx, APG_CALLBACK* spRuleCallbacks, APG_CALLBACK* spUdtCallbacks);
625 apg_uint uiParserAstTranslate(void* vpCtx, APG_CALLBACK* pfnRuleCallbacks, APG_CALLBACK* pfnUdtCallbacks, void* vpData);
626 
627 // parser statistics
628 apg_uint uiParserStatsEnable(void* vpCtx, apg_uint uiEnable);
629 apg_uint uiParserStatsGet(void* vpCtx, APG_PARSER_STATS* spStats, apg_uint* uipBufferSize);
630 
631 // parser trace configuration
632 apg_uint uiParserTraceEnable(void* vpCtx, apg_uint uiEnable);
633 void vParserTraceOp(void* vpCtx, apg_uint uiOpId, apg_uint uiEnable);
634 void vParserTraceRule(void* vpCtx, apg_uint uiIndex, apg_uint uiEnable);
635 void vParserTraceUdt(void* vpCtx, apg_uint uiIndex, apg_uint uiEnable);
636 void vParserTraceRange(void* vpCtx, apg_uint uiBegin, apg_uint uiCount);
637 
638 // TRACE OPERATOR IDS
641 #define APG_TRACE_ALL 1
642 
643 #define APG_TRACE_TRG 2
644 
645 #define APG_TRACE_TBS 3
646 
647 #define APG_TRACE_TLS 4
648 
649 #define APG_TRACE_AND 5
650 
651 #define APG_TRACE_NOT 6
652 
653 #define APG_TRACE_CAT 7
654 
655 #define APG_TRACE_ALT 8
656 
657 #define APG_TRACE_REP 9
658 
659 #define APG_TRACE_RNM 10
660 
661 #define APG_TRACE_UDT 11
662 
665 #define APG_TRACE_COUNT 12
666 
668 // the UDT callback function library
684 
685 // End C-language linkage specification
686 #if defined(__cplusplus)
687 }
688 #endif
689 
690 #endif // APG_H_6_3
APG_MEM_STATS
generated by the Memory component, available to the user for display of memory statistics
Definition: Apg.h:360
APG_PARSER_STATS::sAlt
APG_STAT sAlt
Definition: Apg.h:603
uiUdtLib_u_doublequotedstring
apg_uint uiUdtLib_u_doublequotedstring(APG_CBDATA *spData)
Definition: UdtLib.c:561
uiParserAstTranslate
apg_uint uiParserAstTranslate(void *vpCtx, APG_CALLBACK *pfnRuleCallbacks, APG_CALLBACK *pfnUdtCallbacks, void *vpData)
Definition: Parser.c:361
APG_NAME_STAT::uiIndex
apg_uint uiIndex
Definition: Apg.h:583
vpVecFront
void * vpVecFront(void *vpCtx)
Definition: Vector.c:396
APG_PARSER_STATS::uiUdtCount
apg_uint uiUdtCount
Definition: Apg.h:595
vParserAstInitCallbacks
void vParserAstInitCallbacks(void *vpCtx, APG_CALLBACK *spRuleCallbacks, APG_CALLBACK *spUdtCallbacks)
Definition: Parser.c:316
PFN_ALLOCATOR
void *(* PFN_ALLOCATOR)(size_t)
Definition: Apg.h:371
APG_PARSER_STATS
full set of statistics gathered during parsing, uiParserSyntaxAnalysis()
Definition: Apg.h:591
vpVecPopn
void * vpVecPopn(void *vpCtx, apg_uint uiCount)
Definition: Vector.c:341
vMemDtor
void vMemDtor(void *vpCtx)
Definition: Memory.c:97
uiParserStatsEnable
apg_uint uiParserStatsEnable(void *vpCtx, apg_uint uiEnable)
Definition: Parser.c:403
APG_PARSER_STATE
the state of the parser after parsing an input string.
Definition: Apg.h:561
vVecClear
void vVecClear(void *vpCtx)
Definition: Vector.c:218
vpVecPopTo
void * vpVecPopTo(void *vpCtx, apg_uint uiIndex)
Definition: Vector.c:376
vpVecBack
void * vpVecBack(void *vpCtx)
Definition: Vector.c:414
vpMemRealloc
void * vpMemRealloc(void *vpCtx, void *vpData, apg_uint uiBytes)
Definition: Memory.c:182
uiVecSize
apg_uint uiVecSize(void *vpCtx)
Definition: Vector.c:167
vDefaultAlertHandler
void vDefaultAlertHandler(unsigned int uiLine, const char *cpFile)
Definition: Tools.c:33
vParserDtor
void vParserDtor(void *vpCtx)
Definition: Parser.c:168
APG_CBDATA::acpSrc
const apg_achar * acpSrc
Definition: Apg.h:455
APG_PARSER_STATS::cpNames
char * cpNames
Definition: Apg.h:599
uiVecBytes
apg_uint uiVecBytes(void *vpCtx)
Definition: Vector.c:152
APG_PARSER_STATS::uiNameCount
apg_uint uiNameCount
Definition: Apg.h:593
APG_NAME_STAT::cpName
char * cpName
Definition: Apg.h:584
APG_MEM_STATS::uiFrees
apg_uint uiFrees
Definition: Apg.h:363
APG_MEM_STATS::uiMaxCells
apg_uint uiMaxCells
Definition: Apg.h:365
vpVecCtor
void * vpVecCtor(void *vpMemCtx, apg_uint uiElementSize, apg_uint uiInitialAlloc)
Definition: Vector.c:81
apg_uint
unsigned int apg_uint
Definition: Apg.h:169
vVecDtor
void vVecDtor(void *vpCtx)
Definition: Vector.c:123
APG_CALLBACK
apg_uint(* APG_CALLBACK)(APG_CBDATA *spData)
Definition: Apg.h:515
APG_PARSER_STATS::spNameStats
APG_NAME_STAT * spNameStats
Definition: Apg.h:596
APG_STAT::uiTotal
apg_uint uiTotal
Definition: Apg.h:573
APG_PARSER_STATE::uiPhraseLength
apg_uint uiPhraseLength
Definition: Apg.h:564
vpVecPop
void * vpVecPop(void *vpCtx)
Definition: Vector.c:315
vExecuteUdt
void vExecuteUdt(APG_CBDATA *spData, apg_uint uiId, apg_uint uiOffset)
Definition: Parser.c:559
APG_PARSER_STATS::uiRuleCount
apg_uint uiRuleCount
Definition: Apg.h:594
uiUdtLib_u_alphanum_hyphen
apg_uint uiUdtLib_u_alphanum_hyphen(APG_CBDATA *spData)
Definition: UdtLib.c:434
APG_NAME_STAT::sStat
APG_STAT sStat
Definition: Apg.h:585
uiUdtLib_u_lineend
apg_uint uiUdtLib_u_lineend(APG_CBDATA *spData)
Definition: UdtLib.c:320
uiUdtLib_u_semi_comment
apg_uint uiUdtLib_u_semi_comment(APG_CBDATA *spData)
Definition: UdtLib.c:354
vpMemCtor
void * vpMemCtor()
Definition: Memory.c:77
PFN_DEALLOCATOR
void(* PFN_DEALLOCATOR)(void *)
Definition: Apg.h:373
APG_PARSER_STATS::uiSize
apg_uint uiSize
Definition: Apg.h:592
APG_CBDATA::uiPhraseOffset
apg_uint uiPhraseOffset
Definition: Apg.h:457
PFN_ALERT
void(* PFN_ALERT)(unsigned int uiLine, const char *cpFile)
Definition: Apg.h:276
vMemFree
void vMemFree(void *vpCtx, void *vpData)
Definition: Memory.c:157
APG_STAT::uiNoMatch
apg_uint uiNoMatch
Definition: Apg.h:576
APG_MEM_STATS::uiAllocations
apg_uint uiAllocations
Definition: Apg.h:361
vpMemAlloc
void * vpMemAlloc(void *vpCtx, apg_uint uiBytes)
Definition: Memory.c:130
APG_PARSER_STATS::sRep
APG_STAT sRep
Definition: Apg.h:602
APG_PARSER_STATS::spNameStatsAlpha
APG_NAME_STAT * spNameStatsAlpha
Definition: Apg.h:597
APG_STAT::uiEmpty
apg_uint uiEmpty
Definition: Apg.h:575
uiUdtLib_u_cpp_comment
apg_uint uiUdtLib_u_cpp_comment(APG_CBDATA *spData)
Definition: UdtLib.c:372
APG_STAT
the parsers total node hit statistics
Definition: Apg.h:572
APG_PARSER_STATS::sNot
APG_STAT sNot
Definition: Apg.h:606
uiVecElementSize
apg_uint uiVecElementSize(void *vpCtx)
Definition: Vector.c:185
vpVecAt
void * vpVecAt(void *vpCtx, apg_uint uiIndex)
Definition: Vector.c:433
uiParserSyntaxInitCallbacks
apg_uint uiParserSyntaxInitCallbacks(void *vpCtx, APG_CALLBACK *spRuleCallbacks, APG_CALLBACK *spUdtCallbacks)
Definition: Parser.c:187
uiUdtLib_e_any
apg_uint uiUdtLib_e_any(APG_CBDATA *spData)
Definition: UdtLib.c:337
APG_MEM_STATS::uiCells
apg_uint uiCells
Definition: Apg.h:364
uiUdtLib_e_owsp
apg_uint uiUdtLib_e_owsp(APG_CBDATA *spData)
Definition: UdtLib.c:280
APG_CBDATA::uiPhraseLength
apg_uint uiPhraseLength
Definition: Apg.h:459
APG_PARSER_STATS::sUdt
APG_STAT sUdt
Definition: Apg.h:601
vpVecPush
void * vpVecPush(void *vpVec, void *vpElement)
Definition: Vector.c:238
uiUdtLib_u_c_comment
apg_uint uiUdtLib_u_c_comment(APG_CBDATA *spData)
Definition: UdtLib.c:395
uiACharToStringSize
apg_uint uiACharToStringSize(const apg_achar *acpAChars, apg_uint uiALen)
Definition: Tools.c:165
vExecuteRule
void vExecuteRule(APG_CBDATA *spData, apg_uint uiId, apg_uint uiOffset)
Definition: Parser.c:537
APG_MEM_STATS::uiMaxHeapBytes
apg_uint uiMaxHeapBytes
Definition: Apg.h:367
vParserTraceOp
void vParserTraceOp(void *vpCtx, apg_uint uiOpId, apg_uint uiEnable)
Definition: Parser.c:482
uiUdtLib_u_hexnum
apg_uint uiUdtLib_u_hexnum(APG_CBDATA *spData)
Definition: UdtLib.c:495
APG_PARSER_STATS::sTbs
APG_STAT sTbs
Definition: Apg.h:608
APG_MEM_STATS::uiReAllocations
apg_uint uiReAllocations
Definition: Apg.h:362
vParserAstInitNodes
void vParserAstInitNodes(void *vpCtx, apg_uint *uipRules, apg_uint *uipUdts)
Definition: Parser.c:283
vMemClear
void vMemClear(void *vpCtx)
Definition: Memory.c:277
APG_CBDATA::uiState
apg_uint uiState
Definition: Apg.h:458
uiParserState
apg_uint uiParserState(void *vpCtx, APG_PARSER_STATE *spState)
Definition: Parser.c:379
APG_CBDATA::vpCtx
void * vpCtx
Definition: Apg.h:454
vParserTraceRange
void vParserTraceRange(void *vpCtx, apg_uint uiBegin, apg_uint uiCount)
Definition: Parser.c:524
apg_achar
unsigned char apg_achar
Definition: Apg.h:183
APG_PARSER_STATE::uiState
apg_uint uiState
Definition: Apg.h:563
APG_PARSER_STATS::spNameStatsCount
APG_NAME_STAT * spNameStatsCount
Definition: Apg.h:598
APG_STAT::uiMatch
apg_uint uiMatch
Definition: Apg.h:574
APG_PARSER_STATS::sTotal
APG_STAT sTotal
Definition: Apg.h:610
uiVecReallocations
apg_uint uiVecReallocations(void *vpCtx)
Definition: Vector.c:200
vParserTraceRule
void vParserTraceRule(void *vpCtx, apg_uint uiIndex, apg_uint uiEnable)
Definition: Parser.c:495
APG_CBDATA
The data structure passed to all syntax and AST callback functions, both rule and UDT.
Definition: Apg.h:453
vpParserCtor
void * vpParserCtor(void *vpParserInit, PFN_ALERT pfnAlertHandler)
Definition: Parser.c:58
APG_CBDATA::uiSrcLen
apg_uint uiSrcLen
Definition: Apg.h:456
uiACharToString
apg_uint uiACharToString(char *cpChars, apg_uint uiCLen, const apg_achar *acpAChars, apg_uint uiALen)
Definition: Tools.c:197
APG_PARSER_STATS::sRnm
APG_STAT sRnm
Definition: Apg.h:600
uiUdtLib_u_quotedstring
apg_uint uiUdtLib_u_quotedstring(APG_CBDATA *spData)
Definition: UdtLib.c:525
vParserTraceUdt
void vParserTraceUdt(void *vpCtx, apg_uint uiIndex, apg_uint uiEnable)
Definition: Parser.c:508
PFN_ALERT_MSG
void(* PFN_ALERT_MSG)(unsigned int uiLine, const char *cpFile, const char *cpMsg)
Definition: Apg.h:282
APG_PARSER_STATS::sTls
APG_STAT sTls
Definition: Apg.h:609
vMemFreeToCheckPoint
void vMemFreeToCheckPoint(void *vpCtx, apg_uint uiChk)
Definition: Memory.c:250
APG_PARSER_STATS::sCat
APG_STAT sCat
Definition: Apg.h:604
APG_PARSER_STATS::sAnd
APG_STAT sAnd
Definition: Apg.h:605
uiUdtLib_u_decnum
apg_uint uiUdtLib_u_decnum(APG_CBDATA *spData)
Definition: UdtLib.c:472
APG_CBDATA::vpUserData
void * vpUserData
Definition: Apg.h:460
uiUdtLib_u_singlequotedstring
apg_uint uiUdtLib_u_singlequotedstring(APG_CBDATA *spData)
Definition: UdtLib.c:544
uiUdtLib_u_wsp
apg_uint uiUdtLib_u_wsp(APG_CBDATA *spData)
Definition: UdtLib.c:301
vpVecPushn
void * vpVecPushn(void *vpCtx, void *vpElement, apg_uint uiCount)
Definition: Vector.c:276
uiParserTraceEnable
apg_uint uiParserTraceEnable(void *vpCtx, apg_uint uiEnable)
Definition: Parser.c:452
APG_NAME_STAT
named rule or UDT node statistics
Definition: Apg.h:582
vCharToAChar
void vCharToAChar(apg_achar *acpAChars, const char *cpChars, apg_uint uiLen)
Definition: Tools.c:79
APG_PARSER_STATS::sTrg
APG_STAT sTrg
Definition: Apg.h:607
apg_stricmp
int apg_stricmp(const char *cpLhs, const char *cpRhs)
Definition: Tools.c:46
uiUdtLib_u_alphanum
apg_uint uiUdtLib_u_alphanum(APG_CBDATA *spData)
Definition: UdtLib.c:414
uiMemCheckPoint
apg_uint uiMemCheckPoint(void *vpCtx)
Definition: Memory.c:230
APG_PARSER_STATE::uiStringLength
apg_uint uiStringLength
Definition: Apg.h:565
uiParserSyntaxAnalysis
apg_uint uiParserSyntaxAnalysis(void *vpCtx, apg_uint uiStartRule, const apg_achar *acpSrc, apg_uint uiSrcLen, void *vpData)
Definition: Parser.c:228
uiVecValidate
apg_uint uiVecValidate(void *vpCtx)
Definition: Vector.c:142
uiUdtLib_u_alphanum_under
apg_uint uiUdtLib_u_alphanum_under(APG_CBDATA *spData)
Definition: UdtLib.c:454
vpMemCtorA
void * vpMemCtorA(PFN_ALLOCATOR pfnAllocator, PFN_DEALLOCATOR pfnDeAllocator)
Definition: Memory.c:56
APG_PARSER_STATE::uiSuccess
apg_uint uiSuccess
Definition: Apg.h:562
uiMemValidate
apg_uint uiMemValidate(void *vpCtx)
Definition: Memory.c:115
APG_MEM_STATS::uiHeapBytes
apg_uint uiHeapBytes
Definition: Apg.h:366
uiParserStatsGet
apg_uint uiParserStatsGet(void *vpCtx, APG_PARSER_STATS *spStats, apg_uint *uipBufferSize)
Definition: Parser.c:422
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/licenses.html or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.