예제 #1
0
        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);
        }
예제 #2
0
 private NativeMethod LoadNativeFunc(ElfClass @class, FuncDef funcDef)
 {
     var native = new NativeMethod(funcDef, @class);
     native.Body = VM.Compiler.Compile(native.FuncDef);
     return native;
 }
예제 #3
0
 public UnexpectedCompilerException(FuncDef func, AstNode node, Exception innerException) 
     : base(String.Empty, innerException) 
 {
     Func = func;
     Node = node;
 }
예제 #4
0
 public ElfVmInstruction[] Compile(FuncDef func)
 {
     /* hello bad code */ Func = func;
     return CompileImpl(func).ToArray();
 }