parse2

Augmented Parser

parse2 produces the aParse parser generator that reads Augmented BNF grammars and produces Java, C++ or C# classes that can build parse trees for valid instances of those grammars. aParse is free to download and use without any obligations or limitations.

Using an aParse generated parser, a Java, C++ or C# program can confirm whether a stream of characters represents a valid instance of a particular grammar, for example, a message passed between two programs that should comply with an agreed protocol. The parse tree of a compliant message can be used by the program to process the message content (see the examples for a number of working programs that employ aParse generated parsers).

Augmented BNF is particularly useful, compared to BNF or Extented BNF, when there are few or no delimiting separators between message elements and their identification relies on their length or format. This makes aParse parsers ideally suited to the interpretation of protocol messages.

aParse generates a Parser class that parses instances of the specified grammar, a Visitor interface, that implements the visitor design pattern, and must be implemented by classes that want to traverse a Parser generated rule tree, and a Displayer class that implements the Visitor interface and displays the contents of a Parser generated rule tree. The Displayer class can be used as the template for new classes that traverse Parser generated rule trees and perform some business relevant function with the content, for example, to create HTML source, SQL INSERT statements or an XML document. The steps involved in the production and use of an aParse generated parser are described in the Java, C++ and C# user manuals.