public BlockEvaluator(STBlock block, Compiler compiler, Context context) { Block = block; Compiler = compiler; Result = null; Context = context; }
public STNativeMethod(STMethodPrototype prototype, STBlock block) { Prototype = prototype; Block = block; Block.Context = new LocalContext(Block.Context, true); foreach (var name in prototype.ParameterNames) Block.Context.Declare(name.Name); }
public void With(STBlock block) { block.Context = new LocalContext(block.Context); block.Context.SetVariable("self", this); block.Evaluate(); }
public STClass SubclassNamespaceWith(STSymbol name, STObject nsObj, STBlock blockObj) { var @class = SubclassNamespace(name, nsObj); @class.With(blockObj as STBlock); return @class; }
public STCompiledMethod CompleteMethod(STMethodPrototype prototype, STBlock block) { return MethodDictionary[prototype.Selector] = new STNativeMethod(prototype, block); }
public STObject WhileTrue(STBlock aBlock) { STObject lastValue = this; while ((bool)Evaluate().Native) lastValue = aBlock.Evaluate(); return lastValue; }
void IBlockVisitor.VisitBlock(STBlock b) { }
public void VisitBlock(STBlock block) { }
public STCompiledMethod With(STBlock block) { return BuildingClass.CompleteMethod(this, block); }