private void emitDirector(EmitterBase emitter)
        {
            //emitujeme instrukci pro uložení jména
            //assembly do proměnné
            emitter.AssignLiteral("result", _name);

            //instrukce pro vrácení uložené hodnoty
            emitter.Return("result");
        }
Example #2
0
        private static void emitPush <T>(object literal)
        {
            if ((literal != null) && !(literal is T))
            {
                throw new NotSupportedException("Wrong literal pushing");
            }

            var tmp = LocalTmpVar;

            E.AssignLiteral(tmp, literal, TypeDescriptor.Create <T>());
            emitPushFrom(tmp);
        }
Example #3
0
        /// <inheritdoc />
        protected override void generate(EmitterBase emitter)
        {
            //first and only argument is parametric
            var resolvedArguments = CILAssembly.ResolveCustomAttributeArgument(_attribute.ConstructorArguments[0]) as object[];

            for (var i = 0; i < resolvedArguments.Length; ++i)
            {
                var argumentStorage = "arg" + i;
                var argumentValue   = resolvedArguments[i];

                emitter.AssignLiteral(argumentStorage, argumentValue);
            }
        }