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