aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Diagnostics/Demangler/Ast/BinaryExpression.cs
blob: 9cd1dd779ae0c4c7e7dc2a49a538dcc86e437b33 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.IO;

namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
    public class BinaryExpression : BaseNode
    {
        private BaseNode LeftPart;
        private string   Name;
        private BaseNode RightPart;

        public BinaryExpression(BaseNode LeftPart, string Name, BaseNode RightPart) : base(NodeType.BinaryExpression)
        {
            this.LeftPart  = LeftPart;
            this.Name      = Name;
            this.RightPart = RightPart;
        }

        public override void PrintLeft(TextWriter Writer)
        {
            if (Name.Equals(">"))
            {
                Writer.Write("(");
            }

            Writer.Write("(");
            LeftPart.Print(Writer);
            Writer.Write(") ");

            Writer.Write(Name);

            Writer.Write(" (");
            RightPart.Print(Writer);
            Writer.Write(")");

            if (Name.Equals(">"))
            {
                Writer.Write(")");
            }
        }
    }
}