Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
The OData Grammar and Test Cases

The OASIS Open Data Protocol (OData) Technical Committee has the stated purpose "...to define an open data protocol for sharing data and exposing data models interoperably on the Web." As part of that project, an OData ABNF grammar and a large set of test cases has been developed. Along with that is a test tool built from apg-java.

This example builds a C-language equivalent of the parser and test tool for the core grammar and test cases.

  • application code must include header files:
    • ../../library/lib.h
    • ../../utilities/utilities.h
    • ../../json/json.h
    • ../../xml/xml.h
    • ./odata.h
  • application compilation must include source code from the directories:
    • ../../json
    • ../../xml
    • ../../library
    • ../../utilities
  • application compilation must define macros:
    • APG_AST
    • APG_TRACE

The compiled example will execute the following cases. Run the application with no arguments for application usage.

  • case 1: Display application information. (type names, type sizes and defined macros)
  • case 2: Build the JSON test file from the XML test file using the APG XML parser. Must be run before other tests.
  • case 3: Parse all of the valid tests.
  • case 4: Parse all of the invalid tests.
  • case 5: Trace test with JSON ID number = arg2.
APG Version 7.0 is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.