public void Compile(Compiler compiler) { mFuncExpr.Compile(compiler); foreach (IExpr argExpr in mArgExprs) { argExpr.Compile(compiler); } compiler.Push(new InsnCall(mArgExprs.Count, mInfo)); }
public void Compile(Compiler compiler) { RecvExpr.Compile(compiler); foreach (IExpr argExpr in ArgExprs) { argExpr.Compile(compiler); } compiler.Push(new InsnSend(Selector, ArgExprs.Count, mInfo)); }
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; } }
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)); }
public Compiler(Compiler compiler) : this() { }