Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
Macros | Functions
basics.c File Reference

Callback functions for basic rules common to all component parsers. More...

#include "callbacks.h"
Include dependency graph for basics.c:

Go to the source code of this file.

Macros

#define CLOSE_BRACKET   62
 
#define HYPHEN   45
 

Functions

void vThrowError (xml *spXml, const char *cpMsg, aint uiOffset, unsigned int uiLine, const char *cpFile, const char *cpFunc)
 
void vLogMsg (xml *spXml, aint uiOffset, char *cpTitle)
 
void vPushFrame (callback_data *spData)
 
void vPopFrame (callback_data *spData)
 
uint32_t ui2byte (const achar *acpBytes)
 
uint32_t ui3byte (const achar *acpBytes)
 
uint32_t ui4byte (const achar *acpBytes)
 
abool bValidateChar (uint32_t uiChar)
 
void vMakeCDataDisplay (xml *spXml, cdata_id *spDataId, u32_phrase *spCData, aint uiOffset)
 
void vMakeCDataIdFromInput (xml *spXml, const achar *acpInput, aint uiLen, aint uiOffset, cdata_id *spCDataId)
 
cdata_id sCapturePhrase (xml *spXml, achar *acpPhrase, aint uiPhraseLength, aint uiOffset)
 
void vConvertParsedData (xml *spXml, const achar *acpData, aint uiDataLen, uint32_t *uipOffset, uint32_t *uipLength)
 Converts parsed UTF-8 data to UTF-32 code points. More...
 
void vDoubleh (callback_data *spData)
 
void vComment (callback_data *spData)
 
void vPIOpen (callback_data *spData)
 
void vPIClose (callback_data *spData)
 
void vPITarget (callback_data *spData)
 
void vPIInfo (callback_data *spData)
 
void vPIInfoq (callback_data *spData)
 
void vPIInfoa (callback_data *spData)
 
void vPIForbidden (callback_data *spData)
 
void vPIReserved (callback_data *spData)
 
void vAscii (callback_data *spData)
 
void vUtf82 (callback_data *spData)
 
void vUtf83 (callback_data *spData)
 
void vUtf84 (callback_data *spData)
 
void vName (callback_data *spData)
 
void vNameStartChar (callback_data *spData)
 
void vNameOtherChar (callback_data *spData)
 
uint32_t uiHexValue32 (xml *spXml, aint uiOffset, uint32_t *uipChars, uint32_t uiCount)
 
uint32_t uiDecValue32 (xml *spXml, aint uiOffset, uint32_t *uipChars, uint32_t uiCount)
 
att_declspLeftMostElement (xml *spXml, att_decl *spAttList)
 
entity_declspEntityNameLookup (xml *spXml, aint uiOffset, uint32_t *uipName, uint32_t uiNameLen)
 Find the left-most occurrence of the given entity name. More...
 
abool bCompNames (const uint32_t *uipLName, uint32_t uiLLen, const uint32_t *uipRName, uint32_t uiRLen)
 
cdata_id sNormalizeAttributeValue (xml *spXml, aint uiOffset, uint32_t *uipAttValue, uint32_t uiLength, abool bIsCDATA)
 
int iAttComp (const void *vpL, const void *vpR)
 
int iEntityComp (const void *vpL, const void *vpR)
 
void vExpandEntity (xml *spXml, aint uiOffset, entity_decl *spThisEntity)
 
abool bHasEntity (uint32_t *uipChars, uint32_t uiLen, uint32_t *uipEntityOffset, uint32_t *uipEntityLen)
 
int iCompNames (const uint32_t *uipLName, uint32_t uiLLen, const uint32_t *uipRName, uint32_t uiRLen)
 
void vXmlgrammarRuleCallbacks (void *vpParserCtx)
 

Detailed Description

Callback functions for basic rules common to all component parsers.

Definition in file basics.c.

Macro Definition Documentation

◆ CLOSE_BRACKET

#define CLOSE_BRACKET   62

Definition at line 36 of file basics.c.

◆ HYPHEN

#define HYPHEN   45

Definition at line 37 of file basics.c.

Function Documentation

◆ bCompNames()

abool bCompNames ( const uint32_t *  uipLName,
uint32_t  uiLLen,
const uint32_t *  uipRName,
uint32_t  uiRLen 
)

Definition at line 676 of file basics.c.

◆ bHasEntity()

abool bHasEntity ( uint32_t *  uipChars,
uint32_t  uiLen,
uint32_t *  uipEntityOffset,
uint32_t *  uipEntityLen 
)

Definition at line 946 of file basics.c.

◆ bValidateChar()

abool bValidateChar ( uint32_t  uiChar)

Definition at line 124 of file basics.c.

◆ iAttComp()

int iAttComp ( const void *  vpL,
const void *  vpR 
)

Definition at line 808 of file basics.c.

◆ iCompNames()

int iCompNames ( const uint32_t *  uipLName,
uint32_t  uiLLen,
const uint32_t *  uipRName,
uint32_t  uiRLen 
)

Definition at line 969 of file basics.c.

◆ iEntityComp()

int iEntityComp ( const void *  vpL,
const void *  vpR 
)

Definition at line 832 of file basics.c.

◆ sCapturePhrase()

cdata_id sCapturePhrase ( xml spXml,
achar acpPhrase,
aint  uiPhraseLength,
aint  uiOffset 
)

Definition at line 192 of file basics.c.

◆ sNormalizeAttributeValue()

cdata_id sNormalizeAttributeValue ( xml spXml,
aint  uiOffset,
uint32_t *  uipAttValue,
uint32_t  uiLength,
abool  bIsCDATA 
)

Definition at line 682 of file basics.c.

◆ spEntityNameLookup()

entity_decl* spEntityNameLookup ( xml spXml,
aint  uiOffset,
uint32_t *  uipName,
uint32_t  uiNameLen 
)

Find the left-most occurrence of the given entity name.

If the list of entity names are alphabetical this binary algorithm will find the given name. If there is more than one identical name in the list, this algorithm will find the left-most occurrence of that name. https://en.wikipedia.org/wiki/Binary_search_algorithm#Procedure_for_finding_the_leftmost_element

Definition at line 645 of file basics.c.

◆ spLeftMostElement()

att_decl* spLeftMostElement ( xml spXml,
att_decl spAttList 
)

Definition at line 606 of file basics.c.

◆ ui2byte()

uint32_t ui2byte ( const achar acpBytes)

Definition at line 101 of file basics.c.

◆ ui3byte()

uint32_t ui3byte ( const achar acpBytes)

Definition at line 108 of file basics.c.

◆ ui4byte()

uint32_t ui4byte ( const achar acpBytes)

Definition at line 116 of file basics.c.

◆ uiDecValue32()

uint32_t uiDecValue32 ( xml spXml,
aint  uiOffset,
uint32_t *  uipChars,
uint32_t  uiCount 
)

Definition at line 581 of file basics.c.

◆ uiHexValue32()

uint32_t uiHexValue32 ( xml spXml,
aint  uiOffset,
uint32_t *  uipChars,
uint32_t  uiCount 
)

Definition at line 544 of file basics.c.

◆ vAscii()

void vAscii ( callback_data spData)

Definition at line 402 of file basics.c.

◆ vComment()

void vComment ( callback_data spData)

Definition at line 273 of file basics.c.

◆ vConvertParsedData()

void vConvertParsedData ( xml spXml,
const achar acpData,
aint  uiDataLen,
uint32_t *  uipOffset,
uint32_t *  uipLength 
)

Converts parsed UTF-8 data to UTF-32 code points.

At times content is needed and it is necessary to convert the raw UTF-8 input data to internal 32-bit code points.

Parameters
spXmlAn XML context pointer
acpDataPointer to the UTF-8 data to convert. Note that achar may not necessarily be 8-bit characters.
uiDataLenThe number of input characters to convert.
uipOffsetpointer to receive the offset into vpVec32 of the first converted code point
uipLengthPointer to receive the number of 32-bit code points.

Definition at line 234 of file basics.c.

◆ vDoubleh()

void vDoubleh ( callback_data spData)

Definition at line 267 of file basics.c.

◆ vExpandEntity()

void vExpandEntity ( xml spXml,
aint  uiOffset,
entity_decl spThisEntity 
)

Definition at line 855 of file basics.c.

◆ vLogMsg()

void vLogMsg ( xml spXml,
aint  uiOffset,
char *  cpTitle 
)

Definition at line 61 of file basics.c.

◆ vMakeCDataDisplay()

void vMakeCDataDisplay ( xml spXml,
cdata_id spDataId,
u32_phrase spCData,
aint  uiOffset 
)

Definition at line 156 of file basics.c.

◆ vMakeCDataIdFromInput()

void vMakeCDataIdFromInput ( xml spXml,
const achar acpInput,
aint  uiLen,
aint  uiOffset,
cdata_id spCDataId 
)

Definition at line 167 of file basics.c.

◆ vName()

void vName ( callback_data spData)

Definition at line 426 of file basics.c.

◆ vNameOtherChar()

void vNameOtherChar ( callback_data spData)

Definition at line 503 of file basics.c.

◆ vNameStartChar()

void vNameStartChar ( callback_data spData)

Definition at line 432 of file basics.c.

◆ vPIClose()

void vPIClose ( callback_data spData)

Definition at line 332 of file basics.c.

◆ vPIForbidden()

void vPIForbidden ( callback_data spData)

Definition at line 383 of file basics.c.

◆ vPIInfo()

void vPIInfo ( callback_data spData)

Definition at line 360 of file basics.c.

◆ vPIInfoa()

void vPIInfoa ( callback_data spData)

Definition at line 376 of file basics.c.

◆ vPIInfoq()

void vPIInfoq ( callback_data spData)

Definition at line 367 of file basics.c.

◆ vPIOpen()

void vPIOpen ( callback_data spData)

Definition at line 324 of file basics.c.

◆ vPIReserved()

void vPIReserved ( callback_data spData)

Definition at line 389 of file basics.c.

◆ vPITarget()

void vPITarget ( callback_data spData)

Definition at line 346 of file basics.c.

◆ vPopFrame()

void vPopFrame ( callback_data spData)

Definition at line 86 of file basics.c.

◆ vPushFrame()

void vPushFrame ( callback_data spData)

Definition at line 77 of file basics.c.

◆ vThrowError()

void vThrowError ( xml spXml,
const char *  cpMsg,
aint  uiOffset,
unsigned int  uiLine,
const char *  cpFile,
const char *  cpFunc 
)

Definition at line 47 of file basics.c.

◆ vUtf82()

void vUtf82 ( callback_data spData)

Definition at line 408 of file basics.c.

◆ vUtf83()

void vUtf83 ( callback_data spData)

Definition at line 414 of file basics.c.

◆ vUtf84()

void vUtf84 ( callback_data spData)

Definition at line 420 of file basics.c.

◆ vXmlgrammarRuleCallbacks()

void vXmlgrammarRuleCallbacks ( void *  vpParserCtx)

Definition at line 993 of file basics.c.

APG Version 7.0 is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.