Inheritance: STRuntimeObject, IBlockVisitor
Beispiel #1
0
 public BlockEvaluator(STBlock block, Compiler compiler, Context context)
 {
     Block = block;
     Compiler = compiler;
     Result = null;
     Context = context;
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public void With(STBlock block)
 {
     block.Context = new LocalContext(block.Context);
     block.Context.SetVariable("self", this);
     block.Evaluate();
 }
Beispiel #4
0
 public STClass SubclassNamespaceWith(STSymbol name, STObject nsObj, STBlock blockObj)
 {
     var @class = SubclassNamespace(name, nsObj);
     @class.With(blockObj as STBlock);
     return @class;
 }
Beispiel #5
0
 public STCompiledMethod CompleteMethod(STMethodPrototype prototype, STBlock block)
 {
     return MethodDictionary[prototype.Selector] = new STNativeMethod(prototype, block);
 }
Beispiel #6
0
        public STObject WhileTrue(STBlock aBlock)
        {
            STObject lastValue = this;

            while ((bool)Evaluate().Native)
                lastValue = aBlock.Evaluate();

            return lastValue;
        }
Beispiel #7
0
 void IBlockVisitor.VisitBlock(STBlock b)
 {
 }
Beispiel #8
0
 public void VisitBlock(STBlock block)
 {
 }
Beispiel #9
0
 public STCompiledMethod With(STBlock block)
 {
     return BuildingClass.CompleteMethod(this, block);
 }