Fix code style

This commit is contained in:
Thog 2018-09-13 23:48:42 +02:00
parent e9a99c0e0e
commit 2299ef0565
No known key found for this signature in database
GPG key ID: 0CD291558FAFDBC6
46 changed files with 1246 additions and 455 deletions

View file

@ -9,7 +9,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public ArraySubscriptingExpression(BaseNode LeftNode, BaseNode Subscript) : base(NodeType.ArraySubscriptingExpression)
{
this.LeftNode = LeftNode;
this.LeftNode = LeftNode;
this.Subscript = Subscript;
}

View file

@ -6,17 +6,17 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
private BaseNode Base;
private BaseNode DimensionExpression;
private string DimensionString;
private string DimensionString;
public ArrayType(BaseNode Base, BaseNode DimensionExpression = null) : base(NodeType.ArrayType)
{
this.Base = Base;
this.Base = Base;
this.DimensionExpression = DimensionExpression;
}
public ArrayType(BaseNode Base, string DimensionString) : base(NodeType.ArrayType)
{
this.Base = Base;
this.Base = Base;
this.DimensionString = DimensionString;
}
@ -39,14 +39,21 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
// FIXME: detect if previous char was a ].
Writer.Write(" ");
Writer.Write("[");
if (DimensionString != null)
Writer.Write(DimensionString);
else if (DimensionExpression != null)
DimensionExpression.Print(Writer);
Writer.Write("]");
Base.PrintRight(Writer);
Writer.Write("[");
if (DimensionString != null)
{
Writer.Write(DimensionString);
}
else if (DimensionExpression != null)
{
DimensionExpression.Print(Writer);
}
Writer.Write("]");
Base.PrintRight(Writer);
}
}
}

View file

@ -70,8 +70,11 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public virtual void Print(TextWriter Writer)
{
PrintLeft(Writer);
if (HasRightPart())
{
PrintRight(Writer);
}
}
public abstract void PrintLeft(TextWriter Writer);
@ -101,7 +104,9 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public override string ToString()
{
StringWriter Writer = new StringWriter();
Print(Writer);
return Writer.ToString();
}
}

View file

@ -5,32 +5,37 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public class BinaryExpression : BaseNode
{
private BaseNode LeftPart;
private string Name;
private string Name;
private BaseNode RightPart;
public BinaryExpression(BaseNode LeftPart, string Name, BaseNode RightPart) : base(NodeType.BinaryExpression)
{
this.LeftPart = LeftPart;
this.Name = Name;
this.LeftPart = LeftPart;
this.Name = Name;
this.RightPart = RightPart;
}
public override void PrintLeft(TextWriter Writer)
{
if (Name.Equals(">"))
{
Writer.Write("(");
}
Writer.Write("(");
LeftPart.Print(Writer);
Writer.Write(") ");
Writer.Write(Name);
Writer.Write(" (");
RightPart.Print(Writer);
Writer.Write(")");
if (Name.Equals(">"))
{
Writer.Write(")");
}
}
}
}

View file

@ -6,12 +6,12 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
private BaseNode Element;
private BaseNode Expression;
private bool IsArrayExpression;
private bool IsArrayExpression;
public BracedExpression(BaseNode Element, BaseNode Expression, bool IsArrayExpression) : base(NodeType.BracedExpression)
{
this.Element = Element;
this.Expression = Expression;
this.Element = Element;
this.Expression = Expression;
this.IsArrayExpression = IsArrayExpression;
}
@ -33,7 +33,9 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
Writer.Write(" = ");
}
Expression.Print(Writer);
}
}
}

View file

@ -10,8 +10,8 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public BracedRangeExpression(BaseNode FirstNode, BaseNode LastNode, BaseNode Expression) : base(NodeType.BracedRangeExpression)
{
this.FirstNode = FirstNode;
this.LastNode = LastNode;
this.FirstNode = FirstNode;
this.LastNode = LastNode;
this.Expression = Expression;
}
@ -27,6 +27,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
Writer.Write(" = ");
}
Expression.Print(Writer);
}

View file

@ -16,6 +16,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public override void PrintLeft(TextWriter Writer)
{
Callee.Print(Writer);
Writer.Write("(");
Writer.Write(string.Join<BaseNode>(", ", Nodes.ToArray()));
Writer.Write(")");

View file

@ -6,14 +6,14 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public class CastExpression : BaseNode
{
private string Kind;
private string Kind;
private BaseNode To;
private BaseNode From;
public CastExpression(string Kind, BaseNode To, BaseNode From) : base(NodeType.CastExpression)
{
this.Kind = Kind;
this.To = To;
this.To = To;
this.From = From;
}

View file

@ -10,9 +10,9 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public ConditionalExpression(BaseNode ConditionNode, BaseNode ThenNode, BaseNode ElseNode) : base(NodeType.ConditionalExpression)
{
this.ThenNode = ThenNode;
this.ThenNode = ThenNode;
this.ConditionNode = ConditionNode;
this.ElseNode = ElseNode;
this.ElseNode = ElseNode;
}
public override void PrintLeft(TextWriter Writer)

View file

@ -9,7 +9,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public ConversionExpression(BaseNode TypeNode, BaseNode Expressions) : base(NodeType.ConversionExpression)
{
this.TypeNode = TypeNode;
this.TypeNode = TypeNode;
this.Expressions = Expressions;
}

View file

@ -4,10 +4,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public class ConversionOperatorType : ParentNode
{
public ConversionOperatorType(BaseNode Child) : base(NodeType.ConversionOperatorType, Child)
{
}
public ConversionOperatorType(BaseNode Child) : base(NodeType.ConversionOperatorType, Child) { }
public override void PrintLeft(TextWriter Writer)
{

View file

@ -4,7 +4,8 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public class CtorDtorNameType : ParentNode
{
bool IsDestructor;
private bool IsDestructor;
public CtorDtorNameType(BaseNode Name, bool IsDestructor) : base(NodeType.CtorDtorNameType, Name)
{
this.IsDestructor = IsDestructor;
@ -13,7 +14,10 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public override void PrintLeft(TextWriter Writer)
{
if (IsDestructor)
{
Writer.Write("~");
}
Writer.Write(Child.GetName());
}
}

View file

@ -9,7 +9,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public CtorVtableSpecialName(BaseNode FirstType, BaseNode SecondType) : base(NodeType.CtorVtableSpecialName)
{
this.FirstType = FirstType;
this.FirstType = FirstType;
this.SecondType = SecondType;
}

View file

@ -9,17 +9,24 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public DeleteExpression(BaseNode Child, bool IsGlobal, bool IsArrayExpression) : base(NodeType.DeleteExpression, Child)
{
this.IsGlobal = IsGlobal;
this.IsGlobal = IsGlobal;
this.IsArrayExpression = IsArrayExpression;
}
public override void PrintLeft(TextWriter Writer)
{
if (IsGlobal)
{
Writer.Write("::");
}
Writer.Write("delete");
if (IsArrayExpression)
{
Writer.Write("[] ");
}
Child.Print(Writer);
}
}

View file

@ -4,9 +4,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public class DtorName : ParentNode
{
public DtorName(BaseNode Name) : base(NodeType.DtOrName, Name)
{
}
public DtorName(BaseNode Name) : base(NodeType.DtOrName, Name) { }
public override void PrintLeft(TextWriter Writer)
{

View file

@ -4,9 +4,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public class DynamicExceptionSpec : ParentNode
{
public DynamicExceptionSpec(BaseNode Child) : base(NodeType.DynamicExceptionSpec, Child)
{
}
public DynamicExceptionSpec(BaseNode Child) : base(NodeType.DynamicExceptionSpec, Child) { }
public override void PrintLeft(TextWriter Writer)
{

View file

@ -5,6 +5,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public class ElaboratedType : ParentNode
{
private string Elaborated;
public ElaboratedType(string Elaborated, BaseNode Type) : base(NodeType.ElaboratedType, Type)
{
this.Elaborated = Elaborated;

View file

@ -4,15 +4,15 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public class EnclosedExpression : BaseNode
{
private string Prefix;
private string Prefix;
private BaseNode Expression;
private string Postfix;
private string Postfix;
public EnclosedExpression(string Prefix, BaseNode Expression, string Postfix) : base(NodeType.EnclosedExpression)
{
this.Prefix = Prefix;
this.Prefix = Prefix;
this.Expression = Expression;
this.Postfix = Postfix;
this.Postfix = Postfix;
}
public override void PrintLeft(TextWriter Writer)

View file

@ -10,14 +10,15 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
private BaseNode Ref;
private BaseNode Attrs;
private BaseNode Ret;
public EncodedFunction(BaseNode Name, BaseNode Params, BaseNode CV, BaseNode Ref, BaseNode Attrs, BaseNode Ret) : base(NodeType.NameType)
{
this.Name = Name;
this.Name = Name;
this.Params = Params;
this.CV = CV;
this.Ref = Ref;
this.Attrs = Attrs;
this.Ret = Ret;
this.CV = CV;
this.Ref = Ref;
this.Attrs = Attrs;
this.Ret = Ret;
}
public override void PrintLeft(TextWriter Writer)
@ -25,10 +26,15 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
if (Ret != null)
{
Ret.PrintLeft(Writer);
if (!Ret.HasRightPart())
{
Writer.Write(" ");
}
}
Name.Print(Writer);
}
public override bool HasRightPart()
@ -39,21 +45,33 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public override void PrintRight(TextWriter Writer)
{
Writer.Write("(");
if (Params != null)
{
Params.Print(Writer);
}
Writer.Write(")");
if (Ret != null)
{
Ret.PrintRight(Writer);
}
if (CV != null)
{
CV.Print(Writer);
}
if (Ref != null)
{
Ref.Print(Writer);
}
if (Attrs != null)
{
Attrs.Print(Writer);
}
}
}
}

View file

@ -4,18 +4,17 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public class FoldExpression : BaseNode
{
private bool IsLeftFold;
private string OperatorName;
private bool IsLeftFold;
private string OperatorName;
private BaseNode Expression;
private BaseNode Initializer;
public FoldExpression(bool IsLeftFold, string OperatorName, BaseNode Expression, BaseNode Initializer) : base(NodeType.FunctionParameter)
{
this.IsLeftFold = IsLeftFold;
this.IsLeftFold = IsLeftFold;
this.OperatorName = OperatorName;
this.Expression = Expression;
this.Initializer = Initializer;
this.Expression = Expression;
this.Initializer = Initializer;
}
public override void PrintLeft(TextWriter Writer)

View file

@ -4,11 +4,11 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public class ForwardTemplateReference : BaseNode
{
private int Index;
// TOOD: Compute inside the Demangler
// TODO: Compute inside the Demangler
public BaseNode Reference;
private int Index;
public ForwardTemplateReference(int Index) : base(NodeType.ForwardTemplateReference)
{
this.Index = Index;

View file

@ -14,8 +14,11 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public override void PrintLeft(TextWriter Writer)
{
Writer.Write("fp ");
if (Number != null)
{
Writer.Write(Number);
}
}
}
}

View file

@ -4,18 +4,19 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public class FunctionType : BaseNode
{
private BaseNode ReturnType;
private BaseNode Params;
private BaseNode CVQualifier;
private BaseNode ReturnType;
private BaseNode Params;
private BaseNode CVQualifier;
private SimpleReferenceType ReferenceQualifier;
private BaseNode ExceptionSpec;
private BaseNode ExceptionSpec;
public FunctionType(BaseNode ReturnType, BaseNode Params, BaseNode CVQualifier, SimpleReferenceType ReferenceQualifier, BaseNode ExceptionSpec) : base(NodeType.FunctionType)
{
this.ReturnType = ReturnType;
this.Params = Params;
this.CVQualifier = CVQualifier;
this.ReturnType = ReturnType;
this.Params = Params;
this.CVQualifier = CVQualifier;
this.ReferenceQualifier = ReferenceQualifier;
this.ExceptionSpec = ExceptionSpec;
this.ExceptionSpec = ExceptionSpec;
}
public override void PrintLeft(TextWriter Writer)
@ -29,8 +30,11 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
Writer.Write("(");
Params.Print(Writer);
Writer.Write(")");
ReturnType.PrintRight(Writer);
CVQualifier.Print(Writer);
if (ReferenceQualifier.Qualifier != Reference.None)
{
Writer.Write(" ");

View file

@ -6,19 +6,22 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public class InitListExpression : BaseNode
{
private BaseNode TypeNode;
private BaseNode TypeNode;
private List<BaseNode> Nodes;
public InitListExpression(BaseNode TypeNode, List<BaseNode> Nodes) : base(NodeType.InitListExpression)
{
this.TypeNode = TypeNode;
this.Nodes = Nodes;
this.Nodes = Nodes;
}
public override void PrintLeft(TextWriter Writer)
{
if (TypeNode != null)
{
TypeNode.Print(Writer);
}
Writer.Write("{");
Writer.Write(string.Join<BaseNode>(", ", Nodes.ToArray()));
Writer.Write("}");

View file

@ -5,6 +5,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public class IntegerCastExpression : ParentNode
{
private string Number;
public IntegerCastExpression(BaseNode Type, string Number) : base(NodeType.IntegerCastExpression, Type)
{
this.Number = Number;

View file

@ -10,7 +10,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public IntegerLiteral(string LitteralName, string LitteralValue) : base(NodeType.IntegerLiteral)
{
this.LitteralValue = LitteralValue;
this.LitteralName = LitteralName;
this.LitteralName = LitteralName;
}
public override void PrintLeft(TextWriter Writer)

View file

@ -4,10 +4,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public class LiteralOperator : ParentNode
{
public LiteralOperator(BaseNode Child) : base(NodeType.LiteralOperator, Child)
{
}
public LiteralOperator(BaseNode Child) : base(NodeType.LiteralOperator, Child) { }
public override void PrintLeft(TextWriter Writer)
{

View file

@ -10,7 +10,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public LocalName(BaseNode Encoding, BaseNode Entity) : base(NodeType.LocalName)
{
this.Encoding = Encoding;
this.Entity = Entity;
this.Entity = Entity;
}
public override void PrintLeft(TextWriter Writer)

View file

@ -5,14 +5,13 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public class MemberExpression : BaseNode
{
private BaseNode LeftNode;
private string Kind;
private BaseNode RightNode;
private string Kind;
public MemberExpression(BaseNode LeftNode, string Kind, BaseNode RightNode) : base(NodeType.MemberExpression)
{
this.LeftNode = LeftNode;
this.Kind = Kind;
this.LeftNode = LeftNode;
this.Kind = Kind;
this.RightNode = RightNode;
}

View file

@ -10,6 +10,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
this.NameValue = NameValue;
}
public NameType(string NameValue) : base(NodeType.NameType)
{
this.NameValue = NameValue;

View file

@ -6,9 +6,10 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
private BaseNode Prev;
private BaseNode TemplateArgument;
public NameTypeWithTemplateArguments(BaseNode Prev, BaseNode TemplateArgument) : base(NodeType.NameTypeWithTemplateArguments)
{
this.Prev = Prev;
this.Prev = Prev;
this.TemplateArgument = TemplateArgument;
}

View file

@ -5,6 +5,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public class NestedName : ParentNode
{
private BaseNode Name;
public NestedName(BaseNode Name, BaseNode Type) : base(NodeType.NestedName, Type)
{
this.Name = Name;

View file

@ -5,7 +5,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public class NewExpression : BaseNode
{
private NodeArray Expressions;
private BaseNode TypeNode;
private BaseNode TypeNode;
private NodeArray Initializers;
private bool IsGlobal;
@ -13,21 +13,27 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public NewExpression(NodeArray Expressions, BaseNode TypeNode, NodeArray Initializers, bool IsGlobal, bool IsArrayExpression) : base(NodeType.NewExpression)
{
this.Expressions = Expressions;
this.TypeNode = TypeNode;
this.Initializers = Initializers;
this.IsGlobal = IsGlobal;
this.Expressions = Expressions;
this.TypeNode = TypeNode;
this.Initializers = Initializers;
this.IsGlobal = IsGlobal;
this.IsArrayExpression = IsArrayExpression;
}
public override void PrintLeft(TextWriter Writer)
{
if (IsGlobal)
{
Writer.Write("::operator ");
}
Writer.Write("new ");
if (IsArrayExpression)
{
Writer.Write("[] ");
}
if (Expressions.Nodes.Count != 0)
{

View file

@ -5,10 +5,8 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public class PackedTemplateParameter : NodeArray
{
public PackedTemplateParameter(List<BaseNode> Nodes) : base(Nodes, NodeType.PackedTemplateParameter)
{
public PackedTemplateParameter(List<BaseNode> Nodes) : base(Nodes, NodeType.PackedTemplateParameter) { }
}
public override void PrintLeft(TextWriter Writer)
{
foreach (BaseNode Node in Nodes)
@ -34,6 +32,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
return true;
}
}
return false;
}
}

View file

@ -4,10 +4,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public class PackedTemplateParameterExpansion : ParentNode
{
public PackedTemplateParameterExpansion(BaseNode Child) : base(NodeType.PackedTemplateParameterExpansion, Child)
{
}
public PackedTemplateParameterExpansion(BaseNode Child) : base(NodeType.PackedTemplateParameterExpansion, Child) {}
public override void PrintLeft(TextWriter Writer)
{

View file

@ -3,6 +3,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public abstract class ParentNode : BaseNode
{
public BaseNode Child { get; private set; }
public ParentNode(NodeType Type, BaseNode Child) : base(Type)
{
this.Child = Child;

View file

@ -5,6 +5,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public class PointerType : BaseNode
{
private BaseNode Child;
public PointerType(BaseNode Child) : base(NodeType.PointerType)
{
this.Child = Child;
@ -19,15 +20,25 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
Child.PrintLeft(Writer);
if (Child.IsArray())
{
Writer.Write(" ");
}
if (Child.IsArray() || Child.HasFunctions())
{
Writer.Write("(");
}
Writer.Write("*");
}
public override void PrintRight(TextWriter Writer)
{
if (Child.IsArray() || Child.HasFunctions())
{
Writer.Write(")");
}
Child.PrintRight(Writer);
}
}

View file

@ -5,6 +5,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public class PostfixExpression : ParentNode
{
private string Operator;
public PostfixExpression(BaseNode Type, string Operator) : base(NodeType.PostfixExpression, Type)
{
this.Operator = Operator;

View file

@ -5,6 +5,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public class PostfixQualifiedType : ParentNode
{
private string PostfixQualifier;
public PostfixQualifiedType(string PostfixQualifier, BaseNode Type) : base(NodeType.PostfixQualifiedType, Type)
{
this.PostfixQualifier = PostfixQualifier;

View file

@ -10,7 +10,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public QualifiedName(BaseNode Qualifier, BaseNode Name) : base(NodeType.QualifiedName)
{
this.Qualifier = Qualifier;
this.Name = Name;
this.Name = Name;
}
public override void PrintLeft(TextWriter Writer)

View file

@ -8,7 +8,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
Const,
Volatile,
Restricted = 4
};
}
public enum Reference
{
@ -32,10 +32,12 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
Writer.Write(" const");
}
if ((Qualifier & CV.Volatile) != 0)
{
Writer.Write(" volatile");
}
if ((Qualifier & CV.Restricted) != 0)
{
Writer.Write(" restrict");
@ -45,7 +47,10 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public override void PrintLeft(TextWriter Writer)
{
if (Child != null)
{
Child.PrintLeft(Writer);
}
PrintQualifier(Writer);
}
@ -57,7 +62,9 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public override void PrintRight(TextWriter Writer)
{
if (Child != null)
{
Child.PrintRight(Writer);
}
}
}
@ -76,6 +83,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
Writer.Write("&");
}
if ((Qualifier & Reference.RValue) != 0)
{
Writer.Write("&&");
@ -85,9 +93,14 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public override void PrintLeft(TextWriter Writer)
{
if (Child != null)
{
Child.PrintLeft(Writer);
}
else if (Qualifier != Reference.None)
{
Writer.Write(" ");
}
PrintQualifier(Writer);
}
@ -99,7 +112,9 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public override void PrintRight(TextWriter Writer)
{
if (Child != null)
{
Child.PrintRight(Writer);
}
}
}
}

View file

@ -4,13 +4,13 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public class ReferenceType : BaseNode
{
private string Reference;
private string Reference;
private BaseNode Child;
public ReferenceType(string Reference, BaseNode Child) : base(NodeType.ReferenceType)
{
this.Reference = Reference;
this.Child = Child;
this.Child = Child;
}
public override bool HasRightPart()
@ -21,16 +21,26 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public override void PrintLeft(TextWriter Writer)
{
Child.PrintLeft(Writer);
if (Child.IsArray())
{
Writer.Write(" ");
}
if (Child.IsArray() || Child.HasFunctions())
{
Writer.Write("(");
}
Writer.Write(Reference);
}
public override void PrintRight(TextWriter Writer)
{
if (Child.IsArray() || Child.HasFunctions())
{
Writer.Write(")");
}
Child.PrintRight(Writer);
}
}

View file

@ -5,6 +5,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
public class SpecialName : ParentNode
{
private string SpecialValue;
public SpecialName(string SpecialValue, BaseNode Type) : base(NodeType.SpecialName, Type)
{
this.SpecialValue = SpecialValue;

View file

@ -12,8 +12,8 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
IStream,
OStream,
IOStream,
}
private SpecialType SpecialSubstitutionKey;
public SpecialSubstitution(SpecialType SpecialSubstitutionKey) : base(NodeType.SpecialSubstitution)
@ -36,7 +36,10 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
return "basic_string";
case SpecialType.String:
if (Type == NodeType.ExpandedSpecialSubstitution)
{
return "basic_string";
}
return "string";
case SpecialType.IStream:
return "istream";
@ -45,6 +48,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
case SpecialType.IOStream:
return "iostream";
}
return null;
}
@ -65,6 +69,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
case SpecialType.IOStream:
return "std::basic_iostream<char, std::char_traits<char> >";
}
return null;
}

View file

@ -6,17 +6,20 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public class TemplateArguments : NodeArray
{
public TemplateArguments(List<BaseNode> Nodes) : base(Nodes, NodeType.TemplateArguments)
{
}
public TemplateArguments(List<BaseNode> Nodes) : base(Nodes, NodeType.TemplateArguments) { }
public override void PrintLeft(TextWriter Writer)
{
string Params = string.Join<BaseNode>(", ", Nodes.ToArray());
Writer.Write("<");
Writer.Write(Params);
if (Params.EndsWith(">"))
{
Writer.Write(" ");
}
Writer.Write(">");
}
}

File diff suppressed because it is too large Load diff