예제 #1
0
        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);
            }
        }
예제 #2
0
 public override void Interpret(Context2 context)
 {
     Console.WriteLine("非终端解释器");
 }
예제 #3
0
 public abstract void Interpret(Context2 context);