public IEnumerable<ElfVmInstruction> CompileImpl(FuncDef func) { foreach (var evi in Compile(func.Body)) yield return evi; // todo. implement stack non-corruption verification yield return new PopAll().BindToAstNode(func); yield return new Ret().BindToAstNode(func); }
private NativeMethod LoadNativeFunc(ElfClass @class, FuncDef funcDef) { var native = new NativeMethod(funcDef, @class); native.Body = VM.Compiler.Compile(native.FuncDef); return native; }
public UnexpectedCompilerException(FuncDef func, AstNode node, Exception innerException) : base(String.Empty, innerException) { Func = func; Node = node; }
public ElfVmInstruction[] Compile(FuncDef func) { /* hello bad code */ Func = func; return CompileImpl(func).ToArray(); }