Пример #1
0
 public void Run()
 {
     var context = new Context("Hello World");
     var root = new NonTerminalExpression
     {
         Expression1 = new TerminalExpression(),
         Expression2 = new TerminalExpression()
     };
     root.Interpret(context);
 }
Пример #2
0
 public override void Interpret(Context context)
 {
     Console.WriteLine("Terminal Symbol {0}.", context.Name);
 }
Пример #3
0
 public override void Interpret(Context context)
 {
     Console.WriteLine("Non Terminal Symbol {0}.", context.Name);
     Expression1.Interpret(context);
     Expression2.Interpret(context);
 }
Пример #4
0
 public abstract void Interpret(Context context);