EncodedFunction.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using System.IO;
  2. namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
  3. {
  4. public class EncodedFunction : BaseNode
  5. {
  6. private BaseNode Name;
  7. private BaseNode Params;
  8. private BaseNode CV;
  9. private BaseNode Ref;
  10. private BaseNode Attrs;
  11. private BaseNode Ret;
  12. public EncodedFunction(BaseNode Name, BaseNode Params, BaseNode CV, BaseNode Ref, BaseNode Attrs, BaseNode Ret) : base(NodeType.NameType)
  13. {
  14. this.Name = Name;
  15. this.Params = Params;
  16. this.CV = CV;
  17. this.Ref = Ref;
  18. this.Attrs = Attrs;
  19. this.Ret = Ret;
  20. }
  21. public override void PrintLeft(TextWriter Writer)
  22. {
  23. if (Ret != null)
  24. {
  25. Ret.PrintLeft(Writer);
  26. if (!Ret.HasRightPart())
  27. {
  28. Writer.Write(" ");
  29. }
  30. }
  31. Name.Print(Writer);
  32. }
  33. public override bool HasRightPart()
  34. {
  35. return true;
  36. }
  37. public override void PrintRight(TextWriter Writer)
  38. {
  39. Writer.Write("(");
  40. if (Params != null)
  41. {
  42. Params.Print(Writer);
  43. }
  44. Writer.Write(")");
  45. if (Ret != null)
  46. {
  47. Ret.PrintRight(Writer);
  48. }
  49. if (CV != null)
  50. {
  51. CV.Print(Writer);
  52. }
  53. if (Ref != null)
  54. {
  55. Ref.Print(Writer);
  56. }
  57. if (Attrs != null)
  58. {
  59. Attrs.Print(Writer);
  60. }
  61. }
  62. }
  63. }