Rewrite the C++ Demangler (#416)
* Rewrite the C++ Demangler This new Demangler provides support to almost every possible mangled symbols and should behaves like GNU c++filt. It works on 98.9% of the sdk's symbols and 99.5% of Puyo Puyo Tetris's symbols. * Fix code style * Fix noexcept enclosed expression parsing issues * fix code style issues
This commit is contained in:
parent
7542f4a65f
commit
46a11460d4
54 changed files with 5113 additions and 417 deletions
113
Ryujinx.HLE/HOS/Diagnostics/Demangler/Ast/BaseNode.cs
Normal file
113
Ryujinx.HLE/HOS/Diagnostics/Demangler/Ast/BaseNode.cs
Normal file
|
@ -0,0 +1,113 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue