Exemple #1
0
        public MethodBody GetMethodBody()
        {
            var body    = new MethodBody();
            var emitter = new OpCodeEmitter(body);

            emitter.Emit(OpCodes.Ldarg_0);
            emitter.Emit(OpCodes.Call, KnownType.Object.GetConstructor());
            emitter.Emit(OpCodes.Ret);
            return(body);
        }
        public void VisitSyntaxTree(SyntaxTree node)
        {
            foreach (var statement in node.Statements)
            {
                statement.Accept(this);
            }

            _emitter.Emit(OpCodes.Ret);
        }