Beispiel #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);
        }
Beispiel #2
0
 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;
 }
Beispiel #4
0
 public ElfVmInstruction[] Compile(FuncDef func)
 {
     /* hello bad code */ Func = func;
     return CompileImpl(func).ToArray();
 }