APG
… an ABNF Parser Generator
|
The APG library is designed for minimum footprint with no I/O and the ability to exclude unneeded pieces of code through configuration in apg.h. However, for a desktop application visuals are usually required and many of the utilities here are simply pretty printers of APG structures and results.
For a full list and descriptions of utility functions see utilities.h & utilities.c.
Additionally, there are a number of more complex facilities that are used in two or more places in APG and may be of use in user applications as well. These are all implemented as classes, each with its own constructor and destructor.
conv.h & conv.c
Many applications require data format conversions on the fly. This data conversion object provides conversions to and from Latin1 (ISO-8859-1), UTF-8, UTF-16 and UTF-32. Base64 decoding and encoding can be added as a prefix or postfix operation for any of these formats.
format.h & format.c
APG phrases are often not printable as ASCII characters. This utility object will display arbitrary 8-bit bytes and 32-bit Unicode characters in hexdump-style formats. For 8-bit byte data, this is similar to the Linux command hexdump
. For 32-bit word data, similar formatting is provided.
lines.h & lines.c
Often it is convenient to parse ASCII data into lines and to be able to easily iterate through the lines and/or normalize the line endings. The lines
object provides such a parser.
linesu.h & linesu.c
Often it is convenient to parse Unicode data into lines and to be able to easily iterate through the lines and/or normalize the line endings. The linesu
object provides such a parser.
msglog.h & msglog.c
Often an application will need to collect error or warning messages for display at the end, rather that stopping on each error or warning. The msglog
object provides a consistent and reusable means of doing this throughout APG and any other application that has a need for it.