public Routine Build() { if (!this.IsFinished) { throw new ApplicationException(); // todo2[ak] } if (_result == null) { _result = this.BuildImpl(); } return _result; }
public LispObject EvaluateSingle(LispObject obj, Context context) { // todo1[ak] check args Machine machine = this.Env.Machine; Routine main = new Routine("main", new Instruction[] { new EvalInstruction(), }); machine.Load(main); machine.SetRegisterValue(RegisterName.EvForm, obj); machine.Exec(); LispObject res = machine.GetRegisterValue(RegisterName.EvRes); return res; }
private Routine BuildImpl() { Routine routine = new Routine(this.Name, this.CreateInstructions()); return routine; }
internal Process(Routine routine) { this.Routine = routine; }
private void GoToRoutine(Routine callee) { ClrObject obj = new ClrObject { Value = _currentProcess, }; this.Push(obj); _gotos++; _currentProcess = new Process(callee); }
public void Load(Routine routine) { //_callStack.Clear(); _currentProcess = new Process(routine); _stack.Clear(); _gotos = 0; this.ClearRegisters(); }