public static void InterpreterPrtternMain() { Context2 context = new Context2(); List <Expression1> expressions = new List <Expression1>(); expressions.Add(new TerminalExpression()); expressions.Add(new NonterminalExpression()); expressions.Add(new TerminalExpression()); expressions.Add(new TerminalExpression()); foreach (var expression in expressions) { expression.Interpret(context); } }
public override void Interpret(Context2 context) { Console.WriteLine("非终端解释器"); }
public abstract void Interpret(Context2 context);