2018-09-15 13:29:18 +00:00
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
|
|
|
|
{
|
|
|
|
public class BinaryExpression : BaseNode
|
|
|
|
{
|
2018-12-04 20:23:37 +00:00
|
|
|
private BaseNode _leftPart;
|
|
|
|
private string _name;
|
|
|
|
private BaseNode _rightPart;
|
2018-09-15 13:29:18 +00:00
|
|
|
|
2018-12-04 20:23:37 +00:00
|
|
|
public BinaryExpression(BaseNode leftPart, string name, BaseNode rightPart) : base(NodeType.BinaryExpression)
|
2018-09-15 13:29:18 +00:00
|
|
|
{
|
2018-12-04 20:23:37 +00:00
|
|
|
_leftPart = leftPart;
|
|
|
|
_name = name;
|
|
|
|
_rightPart = rightPart;
|
2018-09-15 13:29:18 +00:00
|
|
|
}
|
|
|
|
|
2018-12-04 20:23:37 +00:00
|
|
|
public override void PrintLeft(TextWriter writer)
|
2018-09-15 13:29:18 +00:00
|
|
|
{
|
2018-12-04 20:23:37 +00:00
|
|
|
if (_name.Equals(">"))
|
2018-09-15 13:29:18 +00:00
|
|
|
{
|
2018-12-04 20:23:37 +00:00
|
|
|
writer.Write("(");
|
2018-09-15 13:29:18 +00:00
|
|
|
}
|
|
|
|
|
2018-12-04 20:23:37 +00:00
|
|
|
writer.Write("(");
|
|
|
|
_leftPart.Print(writer);
|
|
|
|
writer.Write(") ");
|
2018-09-15 13:29:18 +00:00
|
|
|
|
2018-12-04 20:23:37 +00:00
|
|
|
writer.Write(_name);
|
2018-09-15 13:29:18 +00:00
|
|
|
|
2018-12-04 20:23:37 +00:00
|
|
|
writer.Write(" (");
|
|
|
|
_rightPart.Print(writer);
|
|
|
|
writer.Write(")");
|
2018-09-15 13:29:18 +00:00
|
|
|
|
2018-12-04 20:23:37 +00:00
|
|
|
if (_name.Equals(">"))
|
2018-09-15 13:29:18 +00:00
|
|
|
{
|
2018-12-04 20:23:37 +00:00
|
|
|
writer.Write(")");
|
2018-09-15 13:29:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|