0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.HLE/HOS/Diagnostics/Demangler/Ast/BaseNode.cs

113 lines
2.5 KiB
C#
Raw Normal View History

using System.IO;
namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public enum NodeType
{
CVQualifierType,
SimpleReferenceType,
NameType,
EncodedFunction,
NestedName,
SpecialName,
LiteralOperator,
NodeArray,
ElaboratedType,
PostfixQualifiedType,
SpecialSubstitution,
ExpandedSpecialSubstitution,
CtorDtorNameType,
EnclosedExpression,
ForwardTemplateReference,
NameTypeWithTemplateArguments,
PackedTemplateArgument,
TemplateArguments,
BooleanExpression,
CastExpression,
CallExpression,
IntegerCastExpression,
PackedTemplateParameter,
PackedTemplateParameterExpansion,
IntegerLiteral,
DeleteExpression,
MemberExpression,
ArraySubscriptingExpression,
InitListExpression,
PostfixExpression,
ConditionalExpression,
ThrowExpression,
FunctionParameter,
ConversionExpression,
BinaryExpression,
PrefixExpression,
BracedExpression,
BracedRangeExpression,
NewExpression,
QualifiedName,
StdQualifiedName,
DtOrName,
GlobalQualifiedName,
NoexceptSpec,
DynamicExceptionSpec,
FunctionType,
PointerType,
ReferenceType,
ConversionOperatorType,
LocalName,
CtorVtableSpecialName,
ArrayType
}
public abstract class BaseNode
{
public NodeType Type { get; protected set; }
public BaseNode(NodeType Type)
{
this.Type = Type;
}
public virtual void Print(TextWriter Writer)
{
PrintLeft(Writer);
if (HasRightPart())
{
PrintRight(Writer);
}
}
public abstract void PrintLeft(TextWriter Writer);
public virtual bool HasRightPart()
{
return false;
}
public virtual bool IsArray()
{
return false;
}
public virtual bool HasFunctions()
{
return false;
}
public virtual string GetName()
{
return null;
}
public virtual void PrintRight(TextWriter Writer) {}
public override string ToString()
{
StringWriter Writer = new StringWriter();
Print(Writer);
return Writer.ToString();
}
}
}