APG
… ABNF Parser Generator
|
A small UDT callback function library. More...
#include "Apg.h"
Go to the source code of this file.
Functions | |
apg_uint | uiUdtLib_e_owsp (APG_CBDATA *spData) |
apg_uint | uiUdtLib_u_wsp (APG_CBDATA *spData) |
apg_uint | uiUdtLib_u_lineend (APG_CBDATA *spData) |
apg_uint | uiUdtLib_e_any (APG_CBDATA *spData) |
apg_uint | uiUdtLib_u_semi_comment (APG_CBDATA *spData) |
apg_uint | uiUdtLib_u_cpp_comment (APG_CBDATA *spData) |
apg_uint | uiUdtLib_u_c_comment (APG_CBDATA *spData) |
apg_uint | uiUdtLib_u_alphanum (APG_CBDATA *spData) |
apg_uint | uiUdtLib_u_alphanum_hyphen (APG_CBDATA *spData) |
apg_uint | uiUdtLib_u_alphanum_under (APG_CBDATA *spData) |
apg_uint | uiUdtLib_u_decnum (APG_CBDATA *spData) |
apg_uint | uiUdtLib_u_hexnum (APG_CBDATA *spData) |
apg_uint | uiUdtLib_u_quotedstring (APG_CBDATA *spData) |
apg_uint | uiUdtLib_u_singlequotedstring (APG_CBDATA *spData) |
apg_uint | uiUdtLib_u_doublequotedstring (APG_CBDATA *spData) |
A small UDT callback function library.
All functions take an APG_CBDATA struct passed to them by the Parser as input. They return the result in the struct member uiPhraseLength. The returned value of uiPhraseLength is interpreted by the Parser as follows:
uiPhraseLength = 0, an empty phrase was matched. Only returned by UDT functions beginning with "e_". uiPhraseLength > 0, a non-empty phrase was matched. uiPhraseLength = APG_UNDEFINED, no phrase was matched
Definition in file UdtLib.c.
apg_uint uiUdtLib_e_any | ( | APG_CBDATA * | spData | ) |
apg_uint uiUdtLib_e_owsp | ( | APG_CBDATA * | spData | ) |
Phrase recognizer for optional white space
Equivalent SABNF syntax:
WSP = *(TAB / SPACE) TAB = %d9 SPACE = %d32
NOTE: see UdtLib.c for the static function uiWsp() for more options. Line continuations and various types of comments may also be easily included as white space.
spData | data struct passed to this function by the Parser |
apg_uint uiUdtLib_u_alphanum | ( | APG_CBDATA * | spData | ) |
apg_uint uiUdtLib_u_alphanum_hyphen | ( | APG_CBDATA * | spData | ) |
Phrase recognizer for an alphanumeric string, including hyphen.
Equivalent SABNF syntax:
ALPHANUM = ALPHA *(ALPHA / DIGIT / HYPHEN) ALPHA = %d65-90 / %d97-122 DIGIT = %d48-57 HYPHEN = %d45
spData | data struct passed to this function by the Parser |
apg_uint uiUdtLib_u_alphanum_under | ( | APG_CBDATA * | spData | ) |
Phrase recognizer for an alphanumeric string, including underscore.
Equivalent SABNF syntax:
ALPHANUM = ALPHA *(ALPHA / DIGIT / UNDER) ALPHA = %d65-90 / %d97-122 DIGIT = %d48-57 UNDER = %d95
spData | data struct passed to this function by the Parser |
apg_uint uiUdtLib_u_c_comment | ( | APG_CBDATA * | spData | ) |
Phrase recognizer for a C-style comment. Comment runs from "/ *" to "* /".
Equivalent SABNF syntax:
CCOMMENT = BEGIN *(!END ANY) END BEGIN = %d47.42 END = %d42.47 ANY = TAB / CR / LF / %d32-127 TAB = %d9 LF = %d10 CF = %d13
spData | data struct passed to this function by the Parser |
apg_uint uiUdtLib_u_cpp_comment | ( | APG_CBDATA * | spData | ) |
apg_uint uiUdtLib_u_decnum | ( | APG_CBDATA * | spData | ) |
apg_uint uiUdtLib_u_doublequotedstring | ( | APG_CBDATA * | spData | ) |
Phrase recognizer for a double-quoted string, a string beginning and ending with a double quote (").
Equivalent SABNF syntax:
DOUBLEQUOTE = %d34 *(%d9 / %d32-33 / %d35-127) %d34
spData | data struct passed to this function by the Parser |
apg_uint uiUdtLib_u_hexnum | ( | APG_CBDATA * | spData | ) |
apg_uint uiUdtLib_u_lineend | ( | APG_CBDATA * | spData | ) |
Phrase recognizer for line ending. This is a "forgiving" line end allowing for the most commonly used values.
Equivalent SABNF syntax:
LINEEND = CR LF / CR / LF CR = %d13 LF = %d10
spData | data struct passed to this function by the Parser |
apg_uint uiUdtLib_u_quotedstring | ( | APG_CBDATA * | spData | ) |
Phrase recognizer for a quoted string, a string beginning and ending with a single (') or double (") quote.
Equivalent SABNF syntax:
QUOTEDSTRING = SINGLEQUOTE / DOUBLEQUOTE SINGLEQUOTE = %d39 *(%d9 / %d32-38 / %d40-127) %d39 DOUBLEQUOTE = %d34 *(%d9 / %d32-33 / %d35-127) %d34
spData | data struct passed to this function by the Parser |
apg_uint uiUdtLib_u_semi_comment | ( | APG_CBDATA * | spData | ) |
Phrase recognizer for a semicolon initialized comment. Comment runs from semicolon to end of line.
Equivalent SABNF syntax:
SEMICOMMENT = ";" ANY ANY = *(%d9 / %d32-127)
spData | data struct passed to this function by the Parser |
apg_uint uiUdtLib_u_singlequotedstring | ( | APG_CBDATA * | spData | ) |
Phrase recognizer for a single-quoted string, a string beginning and ending with a single quote (').
Equivalent SABNF syntax:
SINGLEQUOTE = %d39 *(%d9 / %d32-38 / %d40-127) %d39
spData | data struct passed to this function by the Parser |
apg_uint uiUdtLib_u_wsp | ( | APG_CBDATA * | spData | ) |
Phrase recognizer for required white space
Equivalent SABNF syntax:
WSP = 1*(TAB / SPACE) TAB = %d9 SPACE = %d32
NOTE: see UdtLib.c for the static function uiWsp() for more options. Line continuations and various types of comments may also be easily included as white space.
spData | data struct passed to this function by the Parser |