Norman Wilde
University of West Florida
Pensacola, Florida 32514, USA
e-mail: 
For the last seven years our research group
has been working on tools to aid the maintainer of old code. Not
surprisingly, we have developed a keen interest in ways of making
our own code easier to understand and maintain. Recently we have
found that the technique of grammar based programming seems
to provide good, maintainable solutions to many of our programming
problems.
Programs built around grammars seem to have
several benefits that enhance maintainability. They are readable
since the grammar acts as a working formal specification of program
behavior. They are robust since the grammar eliminates
many logic and " I didn't think of that " errors. They
are flexible, and can be easily grown or extended as experience
accumulates. And finally they are portable, since they
use ASCII text and standard C/C++ programming techniques.
We have used grammar-based programming for
several applications that do not much resemble traditional compiler
construction tasks. One system generated test drivers for unit
testing of C++ object classes. Another was a querying system to
help maintainers extract information about large software systems.
Still others have taken output from existing code analysis tools
and translated it to work with our program understanding tools.
For the last three years we have been using
the
AnaGram grammar-based programming environment and we
have found that it greatly helps us in developing these applications
quickly. AnaGram is a PC multi-window system for writing, analyzing,
and debugging programs that use grammars. We have had several
good experiences with inexperienced students who produced correct,
readable code using AnaGram.
This report, which describes some of the benefits
of grammar-based programming and the AnaGram environment, was
originally prepared at the request of SERC affiliate Siemens Corporate
Research for the Siemens CASELAB system, which distributes information
on CASE tools and methods to Siemens' employees worldwide. The
views presented are exclusively those of the author.
This report may be cited as SERC-TR-76F,
Software Engineering Research Center, University of Florida, CSE-301,
Gainesville, FL 32611, July/94