예제 #1
0
        public void Run(InterpreterStorage storage)
        {
            Console.Write("Enter int value: ");
            int input = 0;

            while (!int.TryParse(Console.ReadLine(), out input))
            {
                Console.Write("Wrong value. Try again: ");
            }

            InterpreterUtils.SaveValue(storage, input);
        }
예제 #2
0
 public void Run(InterpreterStorage storage)
 {
     InterpreterUtils.SaveValue(storage, storage.stack.Pop());
 }
예제 #3
0
 public void Run(InterpreterStorage storage)
 {
     InterpreterUtils.RunJumpCondition(storage, (left, right) => left == right);
 }
예제 #4
0
 public void Run(InterpreterStorage storage)
 {
     storage.stack.Push(InterpreterUtils.ReadVar(storage));
 }
예제 #5
0
 public void Run(InterpreterStorage storage)
 {
     Console.WriteLine(InterpreterUtils.ReadVar(storage));
 }
예제 #6
0
 public void Run(InterpreterStorage storage)
 {
     InterpreterUtils.RunDestSrc(storage, (dest, src) => dest + src);
 }