posted on 2012-05-15, 14:40authored byJan Vrany, Alexandre Bergel
The use of Interpreter and Visitor design patterns has been widely adopted to implement programming language interpreters due to their expressive and simple design. However, no general approach to conceive a debugger is commonly adopted.
This paper presents the debuggable interpreter design pattern as a general approach to extend a language interpreter with debugging facilities such as step-over and step-into. Moreover, it enables multiple debuggers coexisting and extends the Interpreter and Visitor design patterns with a few hooks and a debugging service. SmallJS, an interpreter for Javascript-like language, serves as an illustration.