Example #1
0
 public void Compile(Compiler compiler)
 {
     mFuncExpr.Compile(compiler);
     foreach (IExpr argExpr in mArgExprs)
     {
         argExpr.Compile(compiler);
     }
     compiler.Push(new InsnCall(mArgExprs.Count, mInfo));
 }
Example #2
0
 public void Compile(Compiler compiler)
 {
     RecvExpr.Compile(compiler);
     foreach (IExpr argExpr in ArgExprs)
     {
         argExpr.Compile(compiler);
     }
     compiler.Push(new InsnSend(Selector, ArgExprs.Count, mInfo));
 }
Example #3
0
 private ISList<IInsn> Compile(Parser parser)
 {
     try
     {
         IExpr expr = parser.Parse();
         if (expr == null)
         {
             throw new EndOfStreamException();
         }
         Compiler compiler = new Compiler();
         expr.Compile(compiler);
         return compiler.GetResult();
     }
     catch (RheaException e)
     {
         Console.WriteLine("{0}: {1}", e.Info, e.Message);
         return null;
     }
 }
Example #4
0
 public void Compile(Compiler compiler)
 {
     Compiler bodyCompiler = new Compiler(compiler);
     if (mBodyExprs.Count == 0)
     {
         bodyCompiler.Push(new InsnPush(ValueNil.Instance));
     }
     else
     {
         foreach (IExpr expr in mBodyExprs)
         {
             expr.Compile(bodyCompiler);
             bodyCompiler.Push(InsnPop.Instance);
         }
         bodyCompiler.Pop();
     }
     bodyCompiler.Push(new InsnCall(1, mInfo));
     ISList<IInsn> insns = bodyCompiler.GetResult();
     compiler.Push(new InsnMakeClosure(mParams, insns, mInfo));
 }
Example #5
0
 public Compiler(Compiler compiler)
     : this()
 {
 }