2018-09-15 15:29:18 +02:00
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
|
|
|
|
{
|
|
|
|
public class BracedExpression : BaseNode
|
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
private BaseNode _element;
|
|
|
|
private BaseNode _expression;
|
|
|
|
private bool _isArrayExpression;
|
2018-09-15 15:29:18 +02:00
|
|
|
|
2018-12-06 12:16:24 +01:00
|
|
|
public BracedExpression(BaseNode element, BaseNode expression, bool isArrayExpression) : base(NodeType.BracedExpression)
|
2018-09-15 15:29:18 +02:00
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
_element = element;
|
|
|
|
_expression = expression;
|
|
|
|
_isArrayExpression = isArrayExpression;
|
2018-09-15 15:29:18 +02:00
|
|
|
}
|
|
|
|
|
2018-12-06 12:16:24 +01:00
|
|
|
public override void PrintLeft(TextWriter writer)
|
2018-09-15 15:29:18 +02:00
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
if (_isArrayExpression)
|
2018-09-15 15:29:18 +02:00
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
writer.Write("[");
|
|
|
|
_element.Print(writer);
|
|
|
|
writer.Write("]");
|
2018-09-15 15:29:18 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
writer.Write(".");
|
|
|
|
_element.Print(writer);
|
2018-09-15 15:29:18 +02:00
|
|
|
}
|
|
|
|
|
2018-12-06 12:16:24 +01:00
|
|
|
if (!_expression.GetType().Equals(NodeType.BracedExpression) || !_expression.GetType().Equals(NodeType.BracedRangeExpression))
|
2018-09-15 15:29:18 +02:00
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
writer.Write(" = ");
|
2018-09-15 15:29:18 +02:00
|
|
|
}
|
|
|
|
|
2018-12-06 12:16:24 +01:00
|
|
|
_expression.Print(writer);
|
2018-09-15 15:29:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|