December 2015
Beginner to intermediate
195 pages
2h 52m
English
![]()
GoF Definition: Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.
Here, in general, we define a grammatical representation for a language and provide an interpreter to deal with that grammar (e.g., in our example we have interpreted a string input as binary data). In simple words, this pattern says how to evaluate sentences in a language.
A language translator who translates a language for us provides a classic example for this pattern. Or, we can also consider music notes as our grammar ...
Read now
Unlock full access