APG
… an ABNF Parser Generator
|
This example will demonstrate basic parser tracing, the primary debugging tool. When a parser unexpectedly fails it could be that the grammar is in error or that input string is an invalid grammar phase or both. The best way to find out what is going on is to examine each step the parser takes. The default trace will show every step, but it is highly configurable to eliminate unneeded steps and zero in on the error.
APG also has detailed statistics gathering capabilities. Parser, memory and vector statistics are available.
Note that trace and statistics have display functions and therefore require <stdio.h>. The APG library specifically excludes all I/O functions except when trace and/or statistics are enabled.
The compiled example will execute the following cases. Run the application with no arguments for application usage.