Skip navigation links

Java APG Version 1.0
Copyright © 2011 Lowell D. Thomas
Java APG is APG, an ABNF Parser Generator, written in the Java language.

See: Description

Packages 
Package Description
apg
This package contains APG, the parser generator, and the runtime library required by the generated parsers.
examples
This is the main driver function for all of the following Java APG test examples.
examples.anbn
A comparison of timing and node hit statistics between the CFG and UDT parsers for the anbn, n > 0, grammar.
examples.anbncn
A comparison of timing and node hit statistics between the CFG and UDT parsers for the anbncn, n > 0, grammar.
examples.demo
Some demonstrations of using the main features of Java APG and some timing tests using UDTs.
examples.expressions
A comparison of timing and node hit statistics between the CFG and UDT parsers for the expressions grammar.
examples.inifile
A comparison of timing and node hit statistics between the CFG and UDT parsers for the the "ini" file grammar.
examples.mailbox
A comparison of timing and node hit statistics between the CFG and UDT parsers for an email address grammar.
examples.testudtlib
A comparison of timing and node hit statistics between the CFG and UDT parsers for the suite of UdtLib UDTs.

Java APG is APG, an ABNF Parser Generator, written in the Java language.

The "apg" package contains the parser generator and the runtime library of functions required by all parsers that it generates.

The "examples" package contains a driver function to run any and all of the included tests. The tests themselves are in the examples sub-packages.
These examples demonstrate a variety of ways to use Java APG and its new UDT feature.

A summary of Java APG's new features is:

APG was originally written to fulfill a need for a parser generator that would generate parsers directly from ABNF grammars as defined by the IETF in RFC 5234. Since then the grammar syntax for APG has evolved from that standard 1) to generate unambiguous parsers and 2) to add capabilities beyond the class of context-free-languages. Because of 2) the APG grammars are called SABNF (Superset ABNF). ABNF and SABNF will often be used interchangably in this document. The differences between RFC 5234 grammars and SABNF are summarized here:

(*) The reason for the two designations u_ and e_ is a subtle but serious difference as to whether the UDT will accept empty strings or not. e_ indicates that the UDT will accept empty strings. u_ indicates that the UDT will not accept empty strings. The Parser enforces this distinction. If a UDT named u_my-udt, for example, returns an empty string the Parser will throw and exception. The reason for this has to do with the fact that left-recursive grammars will put the Parser into an infinite loop that will cause a stack-overflow. The check for left-recursiveness in the GeneratorAttributes class relies on knowing whether the rule name operators (and UDT operators as well) accept empty strings. The general properties of the UDT's are unknown to the Generator because they are user written. This naming convention and the Parser's enforcing of it is the only way to prevent a possible stack-overflow due to a hidden left-recursion.

For more information about APG, UDTs, its versions and downloads, you can visit the APG web site . For information on how to use Java APG you should consult the examples in this document and the source code.

Skip navigation links

Java APG Version 1.0
Copyright © 2011 Lowell D. Thomas

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.
If not see http://www.gnu.org/licenses/licenses.html
or write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.