next up previous
Next: Abstract Syntax Tree Up: Tree Abstractions for Programs Previous: Introduction

   
A C++ Solution

The book Design Patterns is a collection of simple and elegant solutions to common problems in object-oriented software design. Designers gain leverage by re-using these solutions whenever they recognize the corresponding problems.

As shown in Section 2.1, representation of an abstract syntax tree is easily implemented by applying the ``Composite'' design pattern. Section 2.2 implements an interpreter by applying the ``Visitor'' pattern. Initialization and execution of the interpreter are discussed in Section 2.3. Finally, Section 2.4 collects the components and constructs the set of files making up the complete program.



 

William Waite
1998-08-30