Interpreter mode GOOD: Generally, when a language needs to be interpreted and executed, and you can represent sentences in the language as an abstract syntax tree, you can use the interpreter mode. [Html] # include <iostream> # include <string> # include <vector> using namespace std; class Context; class implements actexpression {public: virtual void Interpret (Context * context) = 0 ;}; class Expression: public extends actexpression {public: virtual void Interpret (Context * context) {cout <"terminal interpreter" <endl ;};}; class NonterminalExpression: public extends actexpression {public: virtual void Interpret (Conte Xt * context) {cout <"non-terminal interpreter" <endl ;}; class Context {public: string input; string output ;}; // client int main () {Context * context = new Context (); vector <your actexpression *> express; express. push_back (new Expression (); express. push_back (new NonterminalExpression (); express. push_back (new NonterminalExpression (); vector <effecactexpression * >:: iterator p = express. begin (); while (p! = Express. end () {(* p)-> Interpret (context); p ++;} return 0 ;}