headerphoto

Blog

10/16/12: Since version 3.1, APG rule callback functions have featured a type of semantic predicate allowing them to semantically override the Parser for a particular rule. They can do this by either simply negating a positive phrase match or completely replacing the Parser's result with a matched phrase of their own. The rule callback functions in the original release of Java APG did not have the ability to negate a positive Parser result. Java APG Version 1.0 has been updated to correct this omission in both the download of the software and the JavaDoc User Reference HTML. No change in the release version number has been made.

Thanks to RHA for pointing out this omission and contributing the fix for it.

-----------------------------------------------------------------------------

06/29/12: APG Version 6.3 has been released. Take a look at the documentation, download it and give it a try. Let me know what you think.

Any errors, omissions or comments please let us know here.

-----------------------------------------------------------------------------

10/23/11: It is a pleasure to announce the release of Java APG Version 1.0. I've almost always worked on server-side applications and never had a need or opportunity to use Java. With Android and other such OSs on the scene, writing a Java version of APG seemed like a good way to get my feet wet. So Java APG Version 1.0 is my first adventure with Java. But more than just rewriting in a new language I've added a new feature that I have been thinking of for a while now - User-Defined Terminals or UDTs. Take a look at the documentation, download it and give it a try. Let me know what you think.

Any errors, omissions or comments please let us know here.

-----------------------------------------------------------------------------

10/16/11: I've reformatted the documentation and download for Version 4.0 to the current web site format and restored their availablity here. Previously listed as obsolete, I decided it was a good idea to keep those things for reference. It is the last version that was written in C++ and introduces syntactic predicates (the "repeat-until" operator) to APG.

Eventually I would like to restore all of the previous versions now listed as obsolete. If you spot any typos, broken links or other errors, please let us know here.

-----------------------------------------------------------------------------

07/16/11: I noticed that the interactive examples were not working with the latest versions of Firefox and Chrome. I've fixed the problem and there is no change to the JavaScript APG library in the download.

In testing I noticed that the in IE 8 the Interactive APG scripts are very slow. The larger grammars resulting in "Stop script running?" dialogs. I'm not sure why, but in Firefox 3.6 and 5.0 the scripts are quite fast and in Chromium 14.0 (Ubuntu) they are lightning fast.

If you have any other problems viewing the Interactive APG page please contact us here.

-----------------------------------------------------------------------------

06/07/11: Thanks to ST for pointing out a bug in the MEGACO grammar. As written the message

MEGACO/1 MTP Reply=100{Context=200{Subtract=TMD}}

parses correctly but the similar message

MEGACO/1 MTP{A90000} Reply=100{Context=200{Subtract=TMD}}

does not. The problem is in the rule

mtpAddress = MTPToken LBRKT 4*8(HEXDIG) RBRKT

The final RBKT consumes all following linear white space whereas the context of mtpAddress requires a following space. Simply replacing the RBKT as follows fixes the problem.

mtpAddress = MTPToken LBRKT 4*8(HEXDIG) LWSP "}"

This correction has now been made to the MEGACO example on the Interactive APG page. Also note that the original rule definition for mtpAddress was taken directly from RFC 3525 which comes with this caveat:

"Users of this specification are advised to consult the H.248 Sub-
series Implementors' Guide at http://www.itu.int/itudoc/itu-
t/com16/implgd for additional corrections and clarifications."

-----------------------------------------------------------------------------

09/12/10: As noted by several users APG will not compile on a 64-bit OS. A work around is suggested below, but a true fix is complex - more difficult than it looks on the surface. Recently a true 64-bit version has been developed using 64-bit Ubuntu 9.10. This version was developed under a private commercial contract which prevents us from releasing it as Open Source. However, if you would like further information about how to get a licensed copy please contact us here.

-----------------------------------------------------------------------------

04/15/10: A bug was found in the algorithm for rule attributes. S = (S/"") "s" / "y" is left-recursive but went undetected due to the empty string alternative. This case has been fixed.

-----------------------------------------------------------------------------

12/02/09: A new Interactive APG web service for ABNF grammar development has been added to the site. This new service can help you debug ABNF grammars and the language sentences they define as well as generate JavaScript parsers. At the same time APG Version 6.1 has been released. Version 6.1 fixes a couple of bugs in Version 6.0 and also includes an option for generating parsers in JavaScript. Links to the documentation and downloads can be found here.

-----------------------------------------------------------------------------

07/05/09: Thanks to user EM for discovering and fixing a memory problem in the ApgLib operators. There is a pointer that requires refreshing after a memory allocation. In the file

./ApgLib/src/operators.c

following line 757

"PASSERT(spNodeUp);"

the pointer "spNodeDown" must be refreshed. It will be fixed in the next release.

-----------------------------------------------------------------------------

06/25/09: Congratulations to Thomas Miesch on the completion of his Open Source project SmallMGC. SmallMGC is a Media Gateway Controller for access and residential gateways. We are proud here that Thomas has selected APG as his parser of choice for SmallMGC 's MEGACO message handling. If you are interested in Next Generation Networks, take a look SmallMGC.

-----------------------------------------------------------------------------

06/23/09: Thanks again to Sebastian Pipping (http://www.hartwork.org/) for creating a Gentoo package for APG 6.0. Gentoo users can obtain APG 6.0 through the commands

  sudo layman -a sping
  sudo autounmask dev-util/apg-6.0
  sudo emerge -av dev-util/apg

The ebuild is hosted here.

-----------------------------------------------------------------------------

06/17/09: APG 6.0 has just been released. Version 6.0 updates APG 5.x with some significant new features.

  • Call back functions for any specific rule name during the syntax analysis phase can be used to completely overwrite the normal recursive-descent processing of the branch below the rule name node with a handwritten function.
  • The selection of syntax and semantic call back functions is removed from the grammar syntax and are specified at run time prior to syntax analysis.
  • The tracing facilities are significantly enhanced providing greater detailed control over the displayed output. Debugging parsers and the strings they parse is greatly simplified.

A more detailed description of APG 6.0 is given here. You can download it here.

-----------------------------------------------------------------------------

03/01/09: I've released a new minor version APG 5.1. The primary reason for this release is to update the Linux build to be autotools conforming. Thanks to Sebastian Pipping (http://www.hartwork.org/) for his time and effort in creating the necessary files for this. Additionally, I've migrated the IDE project files to Code::Blocks (www.codeblocks.org). Besides being Open Source, Code::Blocks has the big advantage that it works uniformly across the Linux and Windows platforms. The project files will build APG on either OS without modification. Check out the full details here.

-----------------------------------------------------------------------------

03/01/09: APG will not run on Linux x86_64 platforms. Among possible other problems, it assumes that both sizeof(ulong) = 4 and sizeof(void*) = sizeof(ulong). Thanks to user TJ for pointing out the work-around:

"However, if you add "-m32" to all compiler/linker calls and install the relevant 32bit libraries and compilers you can get everything to run on a x86_64bit as well."

-----------------------------------------------------------------------------

11/25/07: Its taken me a while, but I have finally created a GNU/Linux version of APG 5.0. You can read the description here and download it here. Your feedback is welcome.

-----------------------------------------------------------------------------

10/15/07: APG Version 5.0 has been released. You can check out its exciting new features here

-----------------------------------------------------------------------------

06/17/06: There are some peculiarities in the rules for writing ABNF grammars for APG (versions 1.0 - 4.0) that are not detailed in the write ups and can cause mysterious error messages when Apg.exe parses them. I've had some questions from users about problems that can occur because of them. I have no time table for fixing them (I'm flexible here. Hint: my consulting services are available.) and thought they might be of general interest. The problems are due to the circumstance that spaces in ABNF grammars are used both for the concatenation operator and for visual white space (extra spaces, comments, blank lines, line continuations, etc.) Here are a couple of rules to follow that, in my experience, will fix about 95% of the grammar errors encountered.

  1. Rule definitions: must not end in a space - strip all trailing spaces.
  2. Line continuations: If a continued line is broken at a concatenation between elements, the broken line must end in a space. A good habit is to end all continued lines except the last in a space.

Hope this helps. Your feedback is appreciated.

-----------------------------------------------------------------------------

06/02/06 : APG Version 4.0 has been released. The primary purpose of this release has been to demonstrate the use of APG for building C++ parsers. New sample applications are included which demonstrate a relatively complete C++ preprocessor and two simple C++ language abstractions designed to reproduce the most difficult-to-parse, non-context-free C++ language requirements. Several innovations were required to achieve this goal  - Superset ABNF (SABNF), Semantic-Free Syntax Analysis (SFSA)  parsing, recursive, re-entrant parsing and other exciting stuff. See the Version 4.0 description for all the details.

-----------------------------------------------------------------------------

11/25/05: APG Version 3.1 has been released. It adds an important new feature for context-sensitive parsing - "semantic predicates." That is, it is now possible to reject a rule after it has been syntactically matched based on semantic actions by the application. A new sample application, "PredicateActions" demonstrates this new feature for an abstraction of the C++ declaration/expression semantic ambiguity. It also features a complete rewrite of the recursion analysis - both the algorithms and the documentation section. This fixes a bug that was found for some grammars and expands the analysis considerably. 

-----------------------------------------------------------------------------

10/18/05: I've done an extensive study of the "dangling else" ambiguous grammar problem. It looks at the problem of dealing with multiple parse trees. APG disambiguates to a single parse tree in these cases. This study indicates that one should be enough if the grammar and the semantic actions are judiciously chosen. Have a look.

-----------------------------------------------------------------------------

09/15/05: APG Version 3.0 is released. Version 3.0 offers considerable performance enhancement by factors of 10-100.

-----------------------------------------------------------------------------

09/03/05: APG Version 2.0 is released. Includes asymptotic time vs string length studies for three different grammars including the prototypical non-regular cases anbn and arithmetic expression. Also includes an extensive case study of the famous "dangling else" problem.

-----------------------------------------------------------------------------

08/13/05: APG gets ported to Linux. According to Pradeep Kumar, who has use APG to develop a MEGACO text message parser, the port was simple with only a few modifications to the ApgStatus class. We hope to have a Linux port available for download here soon. Thanks Pradeep.

-----------------------------------------------------------------------------

06/06/05: APG is selected by the IETF for its ABNF verification tools page. Find us at http://tools.ietf.org/inventory/verif-tools.

-----------------------------------------------------------------------------

05/12/05: Our first Open Source software release. APG - an ABNF Parser Generator.

-----------------------------------------------------------------------------