public void Run() { string input = ""; while ((input = Console.ReadLine()) != "end") { string[] data = input.Split(' '); string result = commandInterpreter.ParseCommand(data, context); Console.WriteLine(result); } }
public void Run() { string input; while ((input = Console.ReadLine()) != "END") { var args = input.Split(';'); var commandName = args[0]; var data = args.Skip(1).ToArray(); ICommand command = interpreter.ParseCommand(commandName, data); command.Execute(); } }
public void Run() { var input = Console.ReadLine(); var inputArgs = input.Split(" ").ToArray(); while (input != "END") { try { commandInterpreter.ParseCommand(inputArgs); } catch (Exception ex) { Console.WriteLine(ex.Message); } } }
public void Run() { int n = int.Parse(Console.ReadLine()); for (int i = 0; i < n; i++) { string[] args = Console.ReadLine().Split(); commandInterpreter.AddAppender(args); } string command; while ((command = Console.ReadLine()) != "END") { string[] args = command.Split("|"); commandInterpreter.ParseCommand(args); } commandInterpreter.LoggerInfo(); }
public void Run() { while (isRunning) { var input = Console.ReadLine(); if (input == "END") { isRunning = false; break; } try { commandInterpreter.ParseCommand(input); } catch (Exception ex) { Console.WriteLine(ex.Message); } } }