Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
|
Go to the documentation of this file.
45 #include "../../library/lib.h"
48 #define isalphanum(c) (((c) >= 97 && (c) <= 122) || ((c) >= 48 && (c) <= 57) || ((c) >= 65 && (c) <= 90))
49 #define ishexdigit(c) (((c) >= 48 && (c) <= 57) || ((c) >= 65 && (c) <= 70) || ((c) >= 97 && (c) <= 102))
104 if(acpChar < acpEnd){
105 if(*acpChar >= 48 && *acpChar <= 57){
115 while(acpChar < acpEnd){
116 if(*acpChar >= 48 && *acpChar <= 57){
149 if(acpChar == acpEnd){
160 while(acpChar < acpEnd){
169 if(acpChar[-1] == 45){
174 if(acpChar < acpEnd && *acpChar == 46){
211 if(acpChar < acpEnd){
215 if((acpChar < acpEnd) && *acpChar == 10){
218 }
else if(*acpChar == 10){
244 while(acpChar < acpEnd){
245 if((*acpChar == 32) || (*acpChar == 9)){
252 if(acpChar < acpEnd){
256 if((acpChar < acpEnd) && *acpChar == 10){
259 }
else if(*acpChar == 10){
265 while(acpChar < acpEnd){
266 if((*acpChar == 32) || (*acpChar == 9)){
308 if(acpChar < acpEnd){
309 if((*acpChar == 32) || (*acpChar == 9)){
320 while(acpChar < acpEnd){
337 while(acpChar < acpEnd){
357 achar acChar = *acpChar;
369 achar acChar = *acpChar;
370 if((acpChar < acpEnd) && ((acChar >= 97 && acChar <= 122) || (acChar >= 65 && acChar <= 90))){
383 while(acpChar < acpEnd){
384 if(bParamchar(*acpChar)){
389 if((acpChar + 3) < acpEnd){
390 if(bEscaped(acpChar[0], acpChar[1], acpChar[2])){
413 if(acpChar < acpEnd){
450 memset((
void*)cb, 0,
sizeof(cb));
void u_Alphanum1(callback_data *spData)
void u_ALPHA(callback_data *spData)
void vSip1UdtCallbacks(void *vpParserCtx)
Set the UDT callback functions for the SIP2.bnf grammar to their respective parse tree nodes.
void u_DomainLabel(callback_data *spData)
Evaluates the lower elements of a host name.
aint uiParserOffset
[read only] Offset from acpString to the first character to match
const achar * acpString
[read only] Pointer to the input sub-string,
uint_fast8_t achar
achar is the type for the parser's alphabet characters.
void u_WSP(callback_data *spData)
void(* parser_callback)(callback_data *spData)
User-written callback function prototype.
void u_CRLF(callback_data *spData)
Evaluates the line end character sequence.
void vParserSetUdtCallback(void *vpCtx, aint uiUdtId, parser_callback pfnCallback)
Set a call back function for a specific UDT.
uint_fast32_t aint
The APG parser's unsigned integer type.
void u_Digit(callback_data *spData)
aint uiCallbackState
[input/output] Rule name (RNM) callback functions: If ID_ACTIVE, the parser takes no action....
void e_MessageBody(callback_data *spData)
Evaluates the message body.
void u_Digit1(callback_data *spData)
#define SIP_1_U_PARAMCHAR1
void u_unreserved(callback_data *spData)
aint uiCallbackPhraseLength
[input/output] The phrase length of the matched phrase if the callback function returns ID_MATCH.
#define ID_MATCH
indicates a matched phrase parser state on return from parse tree below this node
The data struct passed to each callback function.
#define SIP_1_U_ALPHANUM1
void u_alphanum(callback_data *spData)
void e_Alphanum0(callback_data *spData)
void e_SWS(callback_data *spData)
Optional linear white space. (See u_LWS.)
#define SIP_1_E_ALPHANUM0
uint8_t abool
abool is the APG bool type.
#define ID_NOMATCH
indicates that no phrase was matched on return from parse tree below this node
void u_paramchar1(callback_data *spData)
#define SIP_1_E_MESSAGEBODY
#define SIP_1_U_UNRESERVED
aint uiStringLength
[read only] The input string length.
#define SIP_1_U_DOMAINLABEL
void u_LWS(callback_data *spData)
Linear white space. White space with possible line breaks allowed.
APG Version 7.0 is licensed under the
2-Clause BSD License,
an Open Source Initiative Approved License.