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