Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
|
Go to the documentation of this file.
62 #include "../utilities/utilities.h"
108 const char*
cpApiInFile(
void *vpCtx,
const char *cpFileName);
109 const char*
cpApiInString(
void *vpCtx,
const char *cpString);
112 void vApiInToHtml(
void *vpCtx,
const char *cpFileName,
const char *cpTitle);
132 void vApiRulesToAscii(
void *vpCtx,
const char *cpMode,
const char *cpFileName);
144 void vApiAttrsToAscii(
void *vpCtx,
const char *cpMode,
const char *cpFileName);
153 void vApiPppt(
void *vpCtx,
char **cppProtectedRules,
aint uiProtectedRules);
178 void vApiOutput(
void *vpCtx,
const char *cpOutput);
void vApiOpcodesToAscii(void *vpCtx, const char *cpFileName)
Display all opcodes in human-readable format.
void vApiOutput(void *vpCtx, const char *cpOutput)
Generate a source and header file that can be used to construct a parser for the specified SABNF gram...
abool bFinite
APG_TRUE if the rule is finite.
void vApiAttrsToAscii(void *vpCtx, const char *cpMode, const char *cpFileName)
Display all rule attributes.
void vApiPpptSize(void *vpCtx, pppt_size *spSize)
Compute the size of the PPPT maps and the number of bytes for the entire table.
void vApiInClear(void *vpCtx)
Clears the input and related memory.
abool bEmpty
APG_TRUE if the rule can be empty.
void vApiInValidate(void *vpCtx, abool bStrict)
Scans the input SABNF grammar for invalid characters and line ends.
void vApiString(void *vpCtx, const char *cpString, abool bStrict, abool bPppt)
Quicky way to generate a parser from a grammar string.
luint luiMapSize
The size, in bytes, of a single PPPT table entry (map).
void vApiOpcodes(void *vpCtx)
Parse the SABNF grammar and translate its AST into opcodes for all the rules.
aint uiMRGroup
the group number, if this is a member of a mutually-recursive group (there may be multiple groups)
void vApiFile(void *vpCtx, const char *cpFileName, abool bStrict, abool bPppt)
Quicky way to generate a parser from a grammar file.
abool bNested
APG_TRUE if the rule is nested recursive.
The recursive attributes of a single SABNF grammra rule.
luint luiAcharMax
The maximum character size in the grammar alphabet.
const char * cpRuleName
the rule name for these attributes
void vApiRulesToHtml(void *vpCtx, const char *cpFileName)
Display the grammar rules in human-readable, HTML format.
uint_fast32_t aint
The APG parser's unsigned integer type.
void vApiRulesToAscii(void *vpCtx, const char *cpMode, const char *cpFileName)
Display rules and UDTs in human-readable format in ASCII format.
luint luiMaps
The number of maps needed.
void vApiSyntax(void *vpCtx, abool bStrict)
Parse the SABNF grammar to validate that the grammar structure is valid.
void * vpApiCtor(exception *spEx)
Construct an API component context (object).
A structure to describe the type and location of a caught exception.
luint luiTableSize
The memory requirement, in bytes, of the full table.
uintmax_t luint
luint is used to cast integers suitable for the %"PRIuMAX" printf format.
void * vpApiOutputParser(void *vpCtx)
Generate a parser object directly from the specified SABNF grammar.
aint uiRecursiveType
ID_ATTR_N, ID_ATTR_R, ID_ATTR_MR, ID_ATTR_NMR, or ID_ATTR_RMR.
abool bApiAttrs(void *vpCtx)
Computes the grammar's attributes.
Size information for the **P**artially-**P**redictive **P**arsing **T**ables (PPPT) data.
abool bLeft
APG_TRUE if the rule is left recursive.
abool bRight
APG_TRUE if the rule is right recursive.
const char * cpApiInFile(void *vpCtx, const char *cpFileName)
Reads an SABNF grammar byte stream from a file.
abool bCyclic
APG_TRUE if the rule is cyclic.
void vApiDtor(void *vpCtx)
The API component destructor.
luint luiAcharMin
The minimum character size in the grammar alphabet.
void vApiAttrsErrorsToAscii(void *vpCtx, const char *cpMode, const char *cpFileName)
Display all rule attributes with errors.
void vApiInToAscii(void *vpCtx, const char *cpFileName)
Display the input lines with line numbers and character offsets.
const char * cpApiInString(void *vpCtx, const char *cpString)
Reads an SABNF grammar byte stream from a string.
uint8_t abool
abool is the APG bool type.
void vApiInToHtml(void *vpCtx, const char *cpFileName, const char *cpTitle)
Display the input lines with line numbers and character offsets.
abool bApiValidate(void *vpCtx)
Validates an API context pointer.
void * vpApiGetErrorLog(void *vpCtx)
Get the internal message log.
aint uiRuleIndex
the index of the rule for these attributes
void vApiPppt(void *vpCtx, char **cppProtectedRules, aint uiProtectedRules)
Compute the Partially-Predictive Parsing Tables.
APG Version 7.0 is licensed under the
2-Clause BSD License,
an Open Source Initiative Approved License.