Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
Appendix B. Examples

Included with the release of APG Version 7.0 are a number of examples of its usage ranging from simple setups to complex applications. They are designed to illustrate the main features of APG 7.0 an how to put them into practice.

Since all samples are built as desktop, command-line applications with display capabilities, they will all use the utilities.h header file, included explicitly or implicitly through one of the other headers, such as api.h. For each example, the required header files, source code directories and defined macros required for compilation will be listed. Each example will have one or more cases and the application will require a case number as a command line argument. Executing the application with no arguments will present a synopsis of the example cases.

Input:
Many examples require pre-built input files, grammars and other data, and all of these input files are collected in the directory ./examples/input.

Output:
Some examples generate output which is considered temporary, "throw-away" data. For this purpose an output directory, ./examples/output, must exist. If it doesn't already exist it must be created before running these tests. Since files in this directory are temporary files which can be and should be cleaned out periodically, it is convenient on Linux and similar systems to create a symbolic link to the temporary directory. On a Linux system, for example, from the ./examples directory,

  rm -r output
  ln -s /tmp output
  

The Examples:

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