2018-09-15 06:29:18 -07:00
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
|
|
|
|
{
|
|
|
|
public class IntegerLiteral : BaseNode
|
|
|
|
{
|
2018-12-04 16:52:39 -08:00
|
|
|
private string LitteralName;
|
|
|
|
private string LitteralValue;
|
2018-09-15 06:29:18 -07:00
|
|
|
|
2018-12-04 16:52:39 -08:00
|
|
|
public IntegerLiteral(string LitteralName, string LitteralValue) : base(NodeType.IntegerLiteral)
|
2018-09-15 06:29:18 -07:00
|
|
|
{
|
2018-12-04 16:52:39 -08:00
|
|
|
this.LitteralValue = LitteralValue;
|
|
|
|
this.LitteralName = LitteralName;
|
2018-09-15 06:29:18 -07:00
|
|
|
}
|
|
|
|
|
2018-12-04 16:52:39 -08:00
|
|
|
public override void PrintLeft(TextWriter Writer)
|
2018-09-15 06:29:18 -07:00
|
|
|
{
|
2018-12-04 16:52:39 -08:00
|
|
|
if (LitteralName.Length > 3)
|
2018-09-15 06:29:18 -07:00
|
|
|
{
|
2018-12-04 16:52:39 -08:00
|
|
|
Writer.Write("(");
|
|
|
|
Writer.Write(LitteralName);
|
|
|
|
Writer.Write(")");
|
2018-09-15 06:29:18 -07:00
|
|
|
}
|
|
|
|
|
2018-12-04 16:52:39 -08:00
|
|
|
if (LitteralValue[0] == 'n')
|
2018-09-15 06:29:18 -07:00
|
|
|
{
|
2018-12-04 16:52:39 -08:00
|
|
|
Writer.Write("-");
|
|
|
|
Writer.Write(LitteralValue.Substring(1));
|
2018-09-15 06:29:18 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-12-04 16:52:39 -08:00
|
|
|
Writer.Write(LitteralValue);
|
2018-09-15 06:29:18 -07:00
|
|
|
}
|
|
|
|
|
2018-12-04 16:52:39 -08:00
|
|
|
if (LitteralName.Length <= 3)
|
2018-09-15 06:29:18 -07:00
|
|
|
{
|
2018-12-04 16:52:39 -08:00
|
|
|
Writer.Write(LitteralName);
|
2018-09-15 06:29:18 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|