2018-09-15 15:29:18 +02:00
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
|
|
|
|
{
|
|
|
|
public class EncodedFunction : BaseNode
|
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
private BaseNode _name;
|
|
|
|
private BaseNode _params;
|
|
|
|
private BaseNode _cv;
|
|
|
|
private BaseNode _ref;
|
|
|
|
private BaseNode _attrs;
|
|
|
|
private BaseNode _ret;
|
2018-09-15 15:29:18 +02:00
|
|
|
|
2018-12-06 12:16:24 +01:00
|
|
|
public EncodedFunction(BaseNode name, BaseNode Params, BaseNode cv, BaseNode Ref, BaseNode attrs, BaseNode ret) : base(NodeType.NameType)
|
2018-09-15 15:29:18 +02:00
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
_name = name;
|
|
|
|
_params = Params;
|
|
|
|
_cv = cv;
|
|
|
|
_ref = Ref;
|
|
|
|
_attrs = attrs;
|
|
|
|
_ret = ret;
|
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 (_ret != null)
|
2018-09-15 15:29:18 +02:00
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
_ret.PrintLeft(writer);
|
2018-09-15 15:29:18 +02:00
|
|
|
|
2018-12-06 12:16:24 +01:00
|
|
|
if (!_ret.HasRightPart())
|
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
|
|
|
_name.Print(writer);
|
2018-09-15 15:29:18 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public override bool HasRightPart()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-12-06 12:16:24 +01:00
|
|
|
public override void PrintRight(TextWriter writer)
|
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
|
|
|
if (_params != null)
|
2018-09-15 15:29:18 +02:00
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
_params.Print(writer);
|
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
|
|
|
if (_ret != null)
|
2018-09-15 15:29:18 +02:00
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
_ret.PrintRight(writer);
|
2018-09-15 15:29:18 +02:00
|
|
|
}
|
|
|
|
|
2018-12-06 12:16:24 +01:00
|
|
|
if (_cv != null)
|
2018-09-15 15:29:18 +02:00
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
_cv.Print(writer);
|
2018-09-15 15:29:18 +02:00
|
|
|
}
|
|
|
|
|
2018-12-06 12:16:24 +01:00
|
|
|
if (_ref != null)
|
2018-09-15 15:29:18 +02:00
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
_ref.Print(writer);
|
2018-09-15 15:29:18 +02:00
|
|
|
}
|
|
|
|
|
2018-12-06 12:16:24 +01:00
|
|
|
if (_attrs != null)
|
2018-09-15 15:29:18 +02:00
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
_attrs.Print(writer);
|
2018-09-15 15:29:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|