The interpreter pattern is well suited for situations when you want to represent a grandmother like
a new language, musical notations, math equations and so on, oftentimes compilers use this pattern
to interpret source code.
As you can see in this UML diagram, an abstract expression interface or abstract class is at the base
of this pattern.
The terminal in terminal expressions are extending the substraction.
The context contains the expression that will be evaluated using this design pattern, the terminal
expressions are evaluated in their current form, whereas the terminal ones are evaluated again until
the context is broken down into terminal expressions.
Some of the weaknesses of this pattern is a complexity as a grammar can be a very complex resource to
transpose in your code.
Also, this pattern can be difficult to maintain as it requires a class for each rule which can increase
the volume of the code.
Let's see how we can implement this pattern.