This package contains APG, the parser generator, and the runtime library required by the generated parsers.
This is the main driver function for all of the following Java APG test examples.
A comparison of timing and node hit statistics between the CFG and UDT parsers for the anbn, n > 0, grammar.
A comparison of timing and node hit statistics between the CFG and UDT parsers for the anbncn, n > 0, grammar.
Some demonstrations of using the main features of Java APG and some timing tests using UDTs.
A comparison of timing and node hit statistics between the CFG and UDT parsers for the expressions grammar.
A comparison of timing and node hit statistics between the CFG and UDT parsers for the the "ini" file grammar.
A comparison of timing and node hit statistics between the CFG and UDT parsers for an email address grammar.
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:
e_(* see below). The underscore insures that there will never be a name conflict with a rule name. No rule name definition is given for the UDTs.
(*) The reason for the two designations
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.
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.