March 2002
Intermediate to advanced
496 pages
8h 51m
English
The INTERPRETER pattern addresses how interpreters work but does not specify how you should compose new interpreters at runtime. In this chapter, you have built new interpreters “manually,” by writing lines of Java code. But by far the most common way to create a new interpreter is with a parser. A parser can read textual commands from a file or from a user prompt and can use the text to create an interpreter. Powerful! Another reason to learn about building parsers is that if you want to understand the INTERPRETER chapter in Design Patterns (Gamma et al. 1995), you really need to understand the interrelation of interpreters, parsers, and computer languages.
A parser is an object that can recognize text and ...
Read now
Unlock full access