next up previous
Next: 7 Examples Up: CLANGER : an interpreted Previous: 5 Control Flow

6 Implementation

The basic interpreter for CLANGER is very simple. It consists of a parser which generates a syntax tree, and code which takes a syntax tree and a Context interface and executes the code. This is the same mechanism as that used for function invocation. Indeed, the parser returns a Nemesis interface of type ClangerFunction just like the def statement.

The interface type ClangerFunction provides a method called Execute, which takes as its sole argument a Context interface which provides the name space and execution environment of the call.



T. Roscoe