Introduction

The Stratego/XT Grammar Engineering Tools is a collection of tools for the recovery,
development, testing, and maintenance of grammars. Currently, the package mainly provides tools to support the recovery and comparison of precedence rules from YACC and SDF grammars. Also, the package could be used as the basis of other tools that analyze YACC generated parsers.

Blogs

Samples

Examples of how to use the tools are available in the samples directory. The samples are currently not distributed in the tarball, so you need to check them out from their location in Subversion.

The samples/expr directory provides a series of examples based on a variety of simple expression grammars. The samples/c and samples/php grammars are used for larger examples of how to apply the tools to a series of C and PHP grammars.

Every sample directory has a script maak (Dutch for make) that you can invoke to run the tools on the sample.

Before you can configure the package as described above you have to run the ./bootstrap script.

Installation

Install the package with the usual sequence of commands:

$ ./configure
$ make
$ make install

You might need to set your PKG_CONFIG_PATH if you did not install the dependencies in a standard location. Configure will tell you to do this if it cannot find aterm, sdf or strategoxt.

Success Stories

Until now, the precedence tools have reported precedence issues for every single grammar that is a derivative from some standard (try your grammar and see if you can make this statement invalid ;) )

The precedence tools have reported a bug in the C-Transformers grammar for C99, which has now been fixed (revision 1613).

The precedence tools have reported several problems in the open source PHP Compiler, which was reported by us and fixed soon after by the developers. These problems have been found by comparing the precedence rules of the PHP Compiler to the official PHP implementation.

The precedence tools have reported several problems in the ANSI C grammar of the SDF Library, which have been reported to the maintainers as issues 669, 670, and 671.

In an ongoing effort to define the precise syntax of PHP in SDF (see PHP-front), the precedence tools are used to recover the precedence rules from the YACC grammar that is part of the official PHP implementation. These precedence rules are now being used to derive the appropriate SDF priority definitions.