CodeArgument.cs 611 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // created on 28/08/2004 at 17:07
  2. using System;
  3. using System.Reflection;
  4. using System.Reflection.Emit;
  5. namespace Mono.CodeGeneration
  6. {
  7. public class CodeArgument: CodeExpression
  8. {
  9. int argument;
  10. public CodeArgument (int arg, Type type)
  11. {
  12. argument = arg;
  13. }
  14. public int Argument
  15. {
  16. get { return argument; }
  17. }
  18. public override void Generate (ILGenerator gen)
  19. {
  20. gen.Emit (OpCodes.Ldloc, var.LocalBuilder);
  21. }
  22. public override void PrintCode (CodeWriter cp)
  23. {
  24. cp.Write ("arg" + argument);
  25. }
  26. public override Type GetResultType ()
  27. {
  28. return var.Type;
  29. }
  30. }
  31. }