package org.ojlang.runtime;

/**
 * @author Bahman Movaqar [Bahman AT BahmanM.com]
 */
public class Executor {
}

@@ -26,88 +26,728 @@
 e;%0A%0A
-/**%0A * @author Bahman Movaqar %5BBahman AT BahmanM.com%5D%0A */%0Apublic class Executor %7B
+import org.ojlang.models.Xt;%0Aimport org.ojlang.models.contracts.SystemState;%0A%0A/**%0A * The executor infinite loop.%0A *%0A * @author Bahman Movaqar %5BBahman AT BahmanM.com%5D%0A */%0Apublic class Executor %7B%0A%0A  static public void%0A  run(%0A    SystemState systat%0A  ) %7B%0A    while (true) %7B%0A      Object obj = systat.mem().get(systat.xp());%0A      if (obj.getClass().equals(Xt.class)) %7B%0A        systat.rs().push(%0A          systat.xp() + 1%0A        );%0A        systat.xp(%0A          ((Xt)obj).value()%0A        );%0A      %7D else if (obj.getClass().equals(Return.class)) %7B%0A        systat.xp(%0A          systat.rs().pop()%0A        );%0A      %7D else %7B%0A        systat.ps().push(obj);%0A        systat.xp(%0A          systat.xp() + 1%0A        );%0A      %7D%0A    %7D%0A  %7D%0A
 %0A%7D%0A

add Executor (initial impl)