2018-09-15 13:29:18 +00:00
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
|
|
|
|
{
|
|
|
|
public class BinaryExpression : BaseNode
|
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
private BaseNode LeftPart;
|
|
|
|
private string Name;
|
|
|
|
private BaseNode RightPart;
|
2018-09-15 13:29:18 +00:00
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public BinaryExpression(BaseNode LeftPart, string Name, BaseNode RightPart) : base(NodeType.BinaryExpression)
|
2018-09-15 13:29:18 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
this.LeftPart = LeftPart;
|
|
|
|
this.Name = Name;
|
|
|
|
this.RightPart = RightPart;
|
2018-09-15 13:29:18 +00:00
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public override void PrintLeft(TextWriter Writer)
|
2018-09-15 13:29:18 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
if (Name.Equals(">"))
|
2018-09-15 13:29:18 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
Writer.Write("(");
|
2018-09-15 13:29:18 +00:00
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
Writer.Write("(");
|
|
|
|
LeftPart.Print(Writer);
|
|
|
|
Writer.Write(") ");
|
2018-09-15 13:29:18 +00:00
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
Writer.Write(Name);
|
2018-09-15 13:29:18 +00:00
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
Writer.Write(" (");
|
|
|
|
RightPart.Print(Writer);
|
|
|
|
Writer.Write(")");
|
2018-09-15 13:29:18 +00:00
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
if (Name.Equals(">"))
|
2018-09-15 13:29:18 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
Writer.Write(")");
|
2018-09-15 13:29:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|