Which Behavioral Pattern would help in parsing and translate a Specific Expression?
-
Command
-
Interpreter
-
Observer
-
Iterator.
B
Correct answer
Explanation
The Interpreter Pattern is designed to parse and evaluate sentences in a language according to a grammar. It defines a representation for the grammar and an interpreter that uses that representation to interpret sentences. Command encapsulates requests, Observer defines notification updates, and Iterator traverses collections - none handle parsing and translation like Interpreter.