2018-09-15 14:29:18 +01:00
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
|
|
|
|
{
|
|
|
|
public class BracedExpression : BaseNode
|
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
private BaseNode Element;
|
|
|
|
private BaseNode Expression;
|
|
|
|
private bool IsArrayExpression;
|
2018-09-15 14:29:18 +01:00
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public BracedExpression(BaseNode Element, BaseNode Expression, bool IsArrayExpression) : base(NodeType.BracedExpression)
|
2018-09-15 14:29:18 +01:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
this.Element = Element;
|
|
|
|
this.Expression = Expression;
|
|
|
|
this.IsArrayExpression = IsArrayExpression;
|
2018-09-15 14:29:18 +01:00
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public override void PrintLeft(TextWriter Writer)
|
2018-09-15 14:29:18 +01:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
if (IsArrayExpression)
|
2018-09-15 14:29:18 +01:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
Writer.Write("[");
|
|
|
|
Element.Print(Writer);
|
|
|
|
Writer.Write("]");
|
2018-09-15 14:29:18 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
Writer.Write(".");
|
|
|
|
Element.Print(Writer);
|
2018-09-15 14:29:18 +01:00
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
if (!Expression.GetType().Equals(NodeType.BracedExpression) || !Expression.GetType().Equals(NodeType.BracedRangeExpression))
|
2018-09-15 14:29:18 +01:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
Writer.Write(" = ");
|
2018-09-15 14:29:18 +01:00
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
Expression.Print(Writer);
|
2018-09-15 14:29:18 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|