Parsifal Software


XIDEK
Extensible Interpreter Development Kit



Summary:

  • Baseline interpreters illustrate two baseline scripting languages and four interpreter architectures.
  • One language has C-like syntax, the other Pascal-like syntax.
  • All four interpreter architectures are functionally equivalent.
  • Interpreters are reentrant for thread safety.
  • Source code and full documentation included.
  • Interpreters are designed to be easily extended.
  • Five example extensions are implemented for both languages and all four architectures.
  • Makefiles for six different compilers are included.
  • Use any interpreter as a basis for your own development.
  • Technical support at support@parsifalsoft.com

Introduction

The Extensible Interpreter Development Kit is aimed at software developers interested in the practical aspects of designing an interpreter for a domain specific language, script language, or other "little language". It examines alternative approaches to the design of the interpreter and provides specific examples of interpreters, with source code and full documentation.

The kit is being made available by Parsifal Software under the zlib/libpng license, a simple license which permits free use, including use in commercial applications. See the listing of approved licenses maintained by the Open Source Initiative. A copy of the license may be viewed here.

The kit contains eight baseline interpreters and forty extended interpreters. Any of these can be used as a starting point for a custom interpreter, thus providing such standard language features as ifs, whiles, and arithmetic expression evaluation already built in. To minimize learning time for developers and to make technical comparisons easier, all interpreters share code, in the form of support modules, to the fullest extent possible. The interpreters do not require preliminary lexers.

The eight baseline interpreters illustrate four architectural approaches to two baseline languages. The first language, CLL, a C-Like Language, is a subset of the familiar C language. The second language, PLL, has a more Pascal-like syntax. In order to facilitate comparison of the four architectures and two languages, all eight of the baseline interpreters use a common base of support code. All the interpreters are reentrant, suitable for thread-safe applications.

The interpreters were designed to be easily extended. The forty extended interpreters that are provided in the kit actually consist of five simple extensions that are applied to each of the eight baseline interpreters. These extensions illustrate the techniques involved in extending an interpreter. You may wish to choose one of the interpreters provided as a basis for your own language interpreter. An advantage of this approach is that the features of the example language remain available and need not be re-implemented.

There are two intertwined parts to a language interpreter: one part for parsing the input scripts, the other for doing the work implied by the script. In our experience, use of a modern parser generator nearly eliminates the work required for the first part and greatly simplifies modification and maintenance. In fact, what makes this kit truly useful is that custom modifications to the interpreters are readily made, owing to the separation, provided by the parser generator, of syntactic features of the language from semantic features. Lack of this separation makes modification of hand-built parsers difficult at best.

All interpreters in the kit make use of the AnaGram LALR parser generator, and indeed Parsifal Software provides them to customers as examples of how to use AnaGram. However, you do not need to use AnaGram to understand the discussion of the different approaches to interpreter architecture. Nor do you need AnaGram to use the syntax (.syn) files in the download as is, since the parser files produced by AnaGram from these syntax files are included in the download. If you wish to try out a modified syntax, a free trial copy of AnaGram is available for immediate download at www.parsifalsoft.com. Notice, however, that distribution of an interpreter based on a modified syntax file will require a valid AnaGram license to generate the corresponding parser file.

Tech support is available by e-mail at support@parsifalsoft.com or by calling 1-508-358-2564.



Table of Contents | Parsifal Software Home Page


XIDEK
Extensible Interpreter Development Kit
Copyright © 1997-2002, Parsifal Software.
All Rights Reserved.