April 2019
Intermediate to advanced
360 pages
9h 17m
English
We will demonstrate the interpreter design pattern by using a simple number-to-character scenario. Our Code Interpreter program will accept numeric input and translate it to a series of characters. For example, an input string of 319 might return a value of YES. We will use an expression interface and three classes to demonstrate this relatively simple use case.
The following screenshot shows the example program's output, given the user's input:

The preceding screenshot shows the user input as 319.
Read now
Unlock full access