Пример #1
0
        static Command GetRunCommand(string key, string description, params IStatement[] statements)
        {
            IStatement statement = MakeCompoundStatement(statements);

            MyIStack <IStatement> executionStack = new MyStack <IStatement>();

            executionStack.Push(statement);

            MyIDictionary <string, int> symbolTable = new MyDictionary <string, int>();
            MyIList <int> output       = new MyList <int>();
            ProgramState  programState = new ProgramState(executionStack, symbolTable, output);
            IRepository   repository   = new MemoryRepository("log.txt");

            repository.Add(programState);
            InterpreterController controller = new InterpreterController(repository);

            return(new RunExampleCommand(key, description, controller));
        }
Пример #2
0
 public List <Employee> GetInterpreterList()
 {
     return(InterpreterController.GetInterpreterList());
 }
Пример #3
0
 public RunExampleCommand(string key, string description, InterpreterController controller) : base(key, description)
 {
     this.controller = controller;
 }
Пример #4
0
 public RunExample(string key, string description, InterpreterController ctrl) : base(key, description)
 {
     this.ctrl = ctrl;
 }