예제 #1
0
        public static void Main(string[] args)
        {
            var program = new ProgramState()
            {
                ExecutionStack = GetExampleProgram2()
            };
            IRepository repository = new Repository.Repository(
                "/home/bogdanboboc97/RiderProjects/ToyLanguage/ToyLanguage/logFile.txt",
                new List <ProgramState>(new[] { program }));
            var controller = new ToyLanguageController(repository);

            var menu = new TextMenu();

            menu.AddCommand(new ExitCommand(controller));
            menu.AddCommand(new RunProgramCommand(controller));

            menu.Run();
        }
예제 #2
0
 public ExitCommand(ToyLanguageController controller, string name = "exit", string description = "Exit program.") : base(controller, name, description)
 {
 }
예제 #3
0
 public RunProgramCommand(ToyLanguageController controller, string name = "run", string description = "Run program.") : base(controller, name, description)
 {
 }
예제 #4
0
 protected CommandBase(ToyLanguageController controller, string name, string description)
 {
     _controller = controller;
     Description = description;
     Name        = name;
 }