From c174e4d6b106c9f8dcf93b9c9cc9b179cc76ba06 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Tue, 6 May 2025 20:01:47 +0200 Subject: [PATCH] Add the AST source generator for the C# syntax tree Introduce a Roslyn source generator that emits the visitor boilerplate for the C# AST from [DecompilerAstNode]-tagged node declarations: the IAstVisitor interface, the AcceptVisitor overloads, the pattern-placeholder nodes, and the initial DoMatch support. AccessorKind lets an accessor's keyword be chosen independently of its role, an early step toward shedding the NRefactory role model. --- Directory.Packages.props | 1 + .../DecompilerSyntaxTreeGenerator.cs | 383 ++++++++++++++++++ .../ICSharpCode.Decompiler.Generators.csproj | 21 + .../IsExternalInit.cs | 3 + .../NuGet.config | 17 + .../RoslynHelpers.cs | 32 ++ .../TreeTraversal.cs | 125 ++++++ .../packages.lock.json | 120 ++++++ .../packages.lock.json | 17 +- .../CSharp/Syntax/AstNode.cs | 1 + .../CSharp/Syntax/AstType.cs | 3 +- .../CSharp/Syntax/CSharpModifierToken.cs | 3 +- .../CSharp/Syntax/CSharpTokenNode.cs | 3 +- .../CSharp/Syntax/ComposedType.cs | 6 +- .../CSharp/Syntax/DocumentationReference.cs | 3 +- .../Expressions/AnonymousMethodExpression.cs | 3 +- .../AnonymousTypeCreateExpression.cs | 3 +- .../Expressions/ArrayCreateExpression.cs | 3 +- .../Expressions/ArrayInitializerExpression.cs | 3 +- .../CSharp/Syntax/Expressions/AsExpression.cs | 3 +- .../Expressions/AssignmentExpression.cs | 3 +- .../Expressions/BaseReferenceExpression.cs | 3 +- .../Expressions/BinaryOperatorExpression.cs | 3 +- .../Syntax/Expressions/CastExpression.cs | 3 +- .../Syntax/Expressions/CheckedExpression.cs | 3 +- .../Expressions/ConditionalExpression.cs | 3 +- .../Expressions/DeclarationExpression.cs | 3 +- .../Expressions/DecompilerAstNodeAttribute.cs | 30 ++ .../Expressions/DefaultValueExpression.cs | 3 +- .../Syntax/Expressions/DirectionExpression.cs | 3 +- .../Syntax/Expressions/ErrorExpression.cs | 3 +- .../CSharp/Syntax/Expressions/Expression.cs | 3 +- .../Expressions/IdentifierExpression.cs | 3 +- .../Syntax/Expressions/IndexerExpression.cs | 3 +- .../InterpolatedStringExpression.cs | 12 +- .../Expressions/InvocationExpression.cs | 3 +- .../CSharp/Syntax/Expressions/IsExpression.cs | 3 +- .../Syntax/Expressions/LambdaExpression.cs | 3 +- .../Expressions/MemberReferenceExpression.cs | 3 +- .../Expressions/NamedArgumentExpression.cs | 3 +- .../Syntax/Expressions/NamedExpression.cs | 3 +- .../Expressions/NullReferenceExpression.cs | 3 +- .../Expressions/ObjectCreateExpression.cs | 3 +- .../OutVarDeclarationExpression.cs | 3 +- .../Expressions/ParenthesizedExpression.cs | 3 +- .../Expressions/PointerReferenceExpression.cs | 3 +- .../Syntax/Expressions/PrimitiveExpression.cs | 3 +- .../Syntax/Expressions/QueryExpression.cs | 30 +- .../Expressions/RecursivePatternExpression.cs | 3 +- .../Syntax/Expressions/SizeOfExpression.cs | 3 +- .../Expressions/StackAllocExpression.cs | 3 +- .../Syntax/Expressions/SwitchExpression.cs | 6 +- .../Expressions/ThisReferenceExpression.cs | 3 +- .../Syntax/Expressions/ThrowExpression.cs | 3 +- .../Syntax/Expressions/TupleExpression.cs | 3 +- .../Syntax/Expressions/TypeOfExpression.cs | 3 +- .../Expressions/TypeReferenceExpression.cs | 3 +- .../Expressions/UnaryOperatorExpression.cs | 3 +- .../Syntax/Expressions/UncheckedExpression.cs | 3 +- .../Expressions/UndocumentedExpression.cs | 3 +- .../Expressions/WithInitializerExpression.cs | 3 +- .../CSharp/Syntax/FunctionPointerAstType.cs | 3 +- .../CSharp/Syntax/GeneralScope/Attribute.cs | 3 +- .../Syntax/GeneralScope/AttributeSection.cs | 3 +- .../CSharp/Syntax/GeneralScope/Comment.cs | 3 +- .../CSharp/Syntax/GeneralScope/Constraint.cs | 3 +- .../GeneralScope/DelegateDeclaration.cs | 3 +- .../GeneralScope/ExternAliasDeclaration.cs | 3 +- .../GeneralScope/NamespaceDeclaration.cs | 3 +- .../GeneralScope/PreProcessorDirective.cs | 9 +- .../Syntax/GeneralScope/TypeDeclaration.cs | 3 +- .../GeneralScope/TypeParameterDeclaration.cs | 3 +- .../GeneralScope/UsingAliasDeclaration.cs | 3 +- .../Syntax/GeneralScope/UsingDeclaration.cs | 3 +- .../CSharp/Syntax/Identifier.cs | 3 +- .../CSharp/Syntax/InvocationAstType.cs | 3 +- .../CSharp/Syntax/MemberType.cs | 3 +- .../CSharp/Syntax/PrimitiveType.cs | 3 +- .../CSharp/Syntax/SimpleType.cs | 3 +- .../Syntax/Statements/BlockStatement.cs | 3 +- .../Syntax/Statements/BreakStatement.cs | 3 +- .../Syntax/Statements/CheckedStatement.cs | 3 +- .../Syntax/Statements/ContinueStatement.cs | 3 +- .../Syntax/Statements/DoWhileStatement.cs | 3 +- .../Syntax/Statements/EmptyStatement.cs | 3 +- .../Syntax/Statements/ExpressionStatement.cs | 3 +- .../Syntax/Statements/FixedStatement.cs | 3 +- .../CSharp/Syntax/Statements/ForStatement.cs | 3 +- .../Syntax/Statements/ForeachStatement.cs | 3 +- .../CSharp/Syntax/Statements/GotoStatement.cs | 9 +- .../Syntax/Statements/IfElseStatement.cs | 3 +- .../Syntax/Statements/LabelStatement.cs | 3 +- .../LocalFunctionDeclarationStatement.cs | 3 +- .../CSharp/Syntax/Statements/LockStatement.cs | 3 +- .../Syntax/Statements/ReturnStatement.cs | 3 +- .../CSharp/Syntax/Statements/Statement.cs | 3 +- .../Syntax/Statements/SwitchStatement.cs | 9 +- .../Syntax/Statements/ThrowStatement.cs | 3 +- .../Syntax/Statements/TryCatchStatement.cs | 6 +- .../Syntax/Statements/UncheckedStatement.cs | 3 +- .../Syntax/Statements/UnsafeStatement.cs | 3 +- .../Syntax/Statements/UsingStatement.cs | 3 +- .../VariableDeclarationStatement.cs | 3 +- .../Syntax/Statements/WhileStatement.cs | 3 +- .../Syntax/Statements/YieldBreakStatement.cs | 3 +- .../Syntax/Statements/YieldReturnStatement.cs | 3 +- .../CSharp/Syntax/SyntaxTree.cs | 3 +- .../CSharp/Syntax/TupleAstType.cs | 6 +- .../CSharp/Syntax/TypeMembers/Accessor.cs | 3 +- .../TypeMembers/ConstructorDeclaration.cs | 6 +- .../TypeMembers/DestructorDeclaration.cs | 3 +- .../TypeMembers/EnumMemberDeclaration.cs | 3 +- .../Syntax/TypeMembers/EventDeclaration.cs | 6 +- .../TypeMembers/ExtensionDeclaration.cs | 3 +- .../Syntax/TypeMembers/FieldDeclaration.cs | 3 +- .../TypeMembers/FixedFieldDeclaration.cs | 3 +- .../TypeMembers/FixedVariableInitializer.cs | 3 +- .../Syntax/TypeMembers/IndexerDeclaration.cs | 3 +- .../Syntax/TypeMembers/MethodDeclaration.cs | 3 +- .../Syntax/TypeMembers/OperatorDeclaration.cs | 3 +- .../TypeMembers/ParameterDeclaration.cs | 3 +- .../Syntax/TypeMembers/PropertyDeclaration.cs | 3 +- .../Syntax/TypeMembers/VariableInitializer.cs | 3 +- .../CSharp/Syntax/VariableDesignation.cs | 9 +- .../ICSharpCode.Decompiler.csproj | 17 +- ILSpy.sln | 17 +- 126 files changed, 1044 insertions(+), 157 deletions(-) create mode 100644 ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs create mode 100644 ICSharpCode.Decompiler.Generators/ICSharpCode.Decompiler.Generators.csproj create mode 100644 ICSharpCode.Decompiler.Generators/IsExternalInit.cs create mode 100644 ICSharpCode.Decompiler.Generators/NuGet.config create mode 100644 ICSharpCode.Decompiler.Generators/RoslynHelpers.cs create mode 100644 ICSharpCode.Decompiler.Generators/TreeTraversal.cs create mode 100644 ICSharpCode.Decompiler.Generators/packages.lock.json create mode 100644 ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DecompilerAstNodeAttribute.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index 91709764a..0a816c3da 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,6 +40,7 @@ + diff --git a/ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs b/ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs new file mode 100644 index 000000000..86ea7df0d --- /dev/null +++ b/ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs @@ -0,0 +1,383 @@ +// Copyright (c) 2026 Siegfried Pammer +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +using System.Collections; +using System.Collections.Immutable; +using System.Text; + +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Text; + +namespace ICSharpCode.Decompiler.Generators; + +[Generator] +internal class DecompilerSyntaxTreeGenerator : IIncrementalGenerator +{ + record AstNodeAdditions(string NodeName, bool NeedsAcceptImpls, bool NeedsVisitor, bool NeedsNullNode, bool NeedsPatternPlaceholder, int NullNodeBaseCtorParamCount, bool IsTypeNode, string VisitMethodName, string VisitMethodParamType, EquatableArray<(string Member, string TypeName, bool RecursiveMatch, bool MatchAny)>? MembersToMatch); + + AstNodeAdditions GetAstNodeAdditions(GeneratorAttributeSyntaxContext context, CancellationToken ct) + { + var targetSymbol = (INamedTypeSymbol)context.TargetSymbol; + var attribute = context.Attributes.SingleOrDefault(ad => ad.AttributeClass?.Name == "DecompilerAstNodeAttribute")!; + var (visitMethodName, paramTypeName) = targetSymbol.Name switch { + "ErrorExpression" => ("ErrorNode", "AstNode"), + string s when s.Contains("AstType") => (s.Replace("AstType", "Type"), s), + _ => (targetSymbol.Name, targetSymbol.Name), + }; + + List<(string Member, string TypeName, bool RecursiveMatch, bool MatchAny)>? membersToMatch = null; + + if (!targetSymbol.MemberNames.Contains("DoMatch")) + { + membersToMatch = new(); + + var astNodeType = (INamedTypeSymbol)context.SemanticModel.GetSpeculativeSymbolInfo(context.TargetNode.Span.Start, SyntaxFactory.ParseTypeName("AstNode"), SpeculativeBindingOption.BindAsTypeOrNamespace).Symbol!; + + if (targetSymbol.BaseType!.MemberNames.Contains("MatchAttributesAndModifiers")) + membersToMatch.Add(("MatchAttributesAndModifiers", null!, false, false)); + + foreach (var m in targetSymbol.GetMembers()) + { + if (m is not IPropertySymbol property || property.IsIndexer || property.IsOverride) + continue; + if (property.GetAttributes().Any(a => a.AttributeClass?.Name == "ExcludeFromMatchAttribute")) + continue; + if (property.Type.MetadataName is "CSharpTokenNode" or "TextLocation") + continue; + switch (property.Type) + { + case INamedTypeSymbol named when named.IsDerivedFrom(astNodeType) || named.MetadataName == "AstNodeCollection`1": + membersToMatch.Add((property.Name, named.Name, true, false)); + break; + case INamedTypeSymbol { TypeKind: TypeKind.Enum } named when named.GetMembers().Any(_ => _.Name == "Any"): + membersToMatch.Add((property.Name, named.Name, false, true)); + break; + default: + membersToMatch.Add((property.Name, property.Type.Name, false, false)); + break; + } + } + } + + return new(targetSymbol.Name, !targetSymbol.MemberNames.Contains("AcceptVisitor"), + NeedsVisitor: !targetSymbol.IsAbstract && targetSymbol.BaseType!.IsAbstract, + NeedsNullNode: (bool)attribute.ConstructorArguments[0].Value!, + NeedsPatternPlaceholder: (bool)attribute.ConstructorArguments[1].Value!, + NullNodeBaseCtorParamCount: targetSymbol.InstanceConstructors.Min(m => m.Parameters.Length), + IsTypeNode: targetSymbol.Name == "AstType" || targetSymbol.BaseType?.Name == "AstType", + visitMethodName, paramTypeName, membersToMatch?.ToEquatableArray()); + } + + void WriteGeneratedMembers(SourceProductionContext context, AstNodeAdditions source) + { + var builder = new StringBuilder(); + + builder.AppendLine("namespace ICSharpCode.Decompiler.CSharp.Syntax;"); + builder.AppendLine(); + + if (source.NeedsPatternPlaceholder) + { + builder.AppendLine("using ICSharpCode.Decompiler.CSharp.Syntax.PatternMatching;"); + } + + builder.AppendLine(); + + builder.AppendLine("#nullable enable"); + builder.AppendLine(); + + builder.AppendLine($"partial class {source.NodeName}"); + builder.AppendLine("{"); + + if (source.NeedsNullNode) + { + bool needsNew = source.NodeName != "AstNode"; + + builder.AppendLine($" {(needsNew ? "new " : "")}public static readonly {source.NodeName} Null = new Null{source.NodeName}();"); + + builder.AppendLine($@" + sealed class Null{source.NodeName} : {source.NodeName} + {{ + public override NodeType NodeType => NodeType.Unknown; + + public override bool IsNull => true; + + public override void AcceptVisitor(IAstVisitor visitor) + {{ + visitor.VisitNullNode(this); + }} + + public override T AcceptVisitor(IAstVisitor visitor) + {{ + return visitor.VisitNullNode(this); + }} + + public override S AcceptVisitor(IAstVisitor visitor, T data) + {{ + return visitor.VisitNullNode(this, data); + }} + + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) + {{ + return other == null || other.IsNull; + }}"); + + if (source.NullNodeBaseCtorParamCount > 0) + { + builder.AppendLine($@" + + public Null{source.NodeName}() : base({string.Join(", ", Enumerable.Repeat("default", source.NullNodeBaseCtorParamCount))}) {{ }}"); + } + + builder.AppendLine($@" + }} + +"); + + } + + if (source.NeedsPatternPlaceholder) + { + builder.Append( + $@" public static implicit operator {source.NodeName}?(PatternMatching.Pattern? pattern) + {{ + return pattern != null ? new PatternPlaceholder(pattern) : null; + }} + + sealed class PatternPlaceholder : {source.NodeName}, INode + {{ + readonly PatternMatching.Pattern child; + + public PatternPlaceholder(PatternMatching.Pattern child) + {{ + this.child = child; + }} + + public override NodeType NodeType {{ + get {{ return NodeType.Pattern; }} + }} + + public override void AcceptVisitor(IAstVisitor visitor) + {{ + visitor.VisitPatternPlaceholder(this, child); + }} + + public override T AcceptVisitor(IAstVisitor visitor) + {{ + return visitor.VisitPatternPlaceholder(this, child); + }} + + public override S AcceptVisitor(IAstVisitor visitor, T data) + {{ + return visitor.VisitPatternPlaceholder(this, child, data); + }} + + protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) + {{ + return child.DoMatch(other, match); + }} + + bool PatternMatching.INode.DoMatchCollection(Role? role, PatternMatching.INode? pos, PatternMatching.Match match, PatternMatching.BacktrackingInfo backtrackingInfo) + {{ + return child.DoMatchCollection(role, pos, match, backtrackingInfo); + }} + }} +" + ); + } + + if (source.NeedsAcceptImpls && source.NeedsVisitor) + { + builder.Append($@" public override void AcceptVisitor(IAstVisitor visitor) + {{ + visitor.Visit{source.VisitMethodName}(this); + }} + + public override T AcceptVisitor(IAstVisitor visitor) + {{ + return visitor.Visit{source.VisitMethodName}(this); + }} + + public override S AcceptVisitor(IAstVisitor visitor, T data) + {{ + return visitor.Visit{source.VisitMethodName}(this, data); + }} +"); + } + + if (source.MembersToMatch != null) + { + builder.Append($@" protected internal override bool DoMatch(AstNode? other, PatternMatching.Match match) + {{ + return other is {source.NodeName} o && !o.IsNull"); + + foreach (var (member, typeName, recursive, hasAny) in source.MembersToMatch) + { + if (member == "MatchAttributesAndModifiers") + { + builder.Append($"\r\n\t\t\t&& this.MatchAttributesAndModifiers(o, match)"); + } + else if (recursive) + { + builder.Append($"\r\n\t\t\t&& this.{member}.DoMatch(o.{member}, match)"); + } + else if (hasAny) + { + builder.Append($"\r\n\t\t\t&& (this.{member} == {typeName}.Any || this.{member} == o.{member})"); + } + else if (typeName == "String") + { + builder.Append($"\r\n\t\t\t&& MatchString(this.{member}, o.{member})"); + } + else + { + builder.Append($"\r\n\t\t\t&& this.{member} == o.{member}"); + } + } + + builder.Append(@"; + } +"); + } + + builder.AppendLine("}"); + + context.AddSource(source.NodeName + ".g.cs", SourceText.From(builder.ToString(), Encoding.UTF8)); + } + + void WriteVisitors(SourceProductionContext context, ImmutableArray source) + { + var builder = new StringBuilder(); + + builder.AppendLine("namespace ICSharpCode.Decompiler.CSharp.Syntax;"); + + source = source + .Concat([new("NullNode", false, true, false, false, 0, false, "NullNode", "AstNode", null), new("PatternPlaceholder", false, true, false, false, 0, false, "PatternPlaceholder", "AstNode", null)]) + .ToImmutableArray(); + + WriteInterface("IAstVisitor", "void", ""); + WriteInterface("IAstVisitor", "S", ""); + WriteInterface("IAstVisitor", "S", ", T data"); + + context.AddSource("IAstVisitor.g.cs", SourceText.From(builder.ToString(), Encoding.UTF8)); + + void WriteInterface(string name, string ret, string param) + { + builder.AppendLine($"public interface {name}"); + builder.AppendLine("{"); + + foreach (var type in source.OrderBy(t => t.VisitMethodName)) + { + if (!type.NeedsVisitor) + continue; + + string extParams, paramName; + if (type.VisitMethodName == "PatternPlaceholder") + { + paramName = "placeholder"; + extParams = ", PatternMatching.Pattern pattern" + param; + } + else + { + paramName = char.ToLowerInvariant(type.VisitMethodName[0]) + type.VisitMethodName.Substring(1); + extParams = param; + } + + builder.AppendLine($"\t{ret} Visit{type.VisitMethodName}({type.VisitMethodParamType} {paramName}{extParams});"); + } + + builder.AppendLine("}"); + } + } + + public void Initialize(IncrementalGeneratorInitializationContext context) + { + var astNodeAdditions = context.SyntaxProvider.ForAttributeWithMetadataName( + "ICSharpCode.Decompiler.CSharp.Syntax.DecompilerAstNodeAttribute", + (n, ct) => n is ClassDeclarationSyntax, + GetAstNodeAdditions); + + var visitorMembers = astNodeAdditions.Collect(); + + context + .RegisterPostInitializationOutput(i => i.AddSource("DecompilerSyntaxTreeGeneratorAttributes.g.cs", @" + +using System; + +namespace Microsoft.CodeAnalysis +{ + internal sealed partial class EmbeddedAttribute : global::System.Attribute + { + } +} + +namespace ICSharpCode.Decompiler.CSharp.Syntax +{ + [global::Microsoft.CodeAnalysis.EmbeddedAttribute] + sealed class DecompilerAstNodeAttribute : global::System.Attribute + { + public DecompilerAstNodeAttribute(bool hasNullNode = false, bool hasPatternPlaceholder = false) { } + } + + [global::Microsoft.CodeAnalysis.EmbeddedAttribute] + sealed class ExcludeFromMatchAttribute : global::System.Attribute + { + } +} + +")); + + context.RegisterSourceOutput(astNodeAdditions, WriteGeneratedMembers); + context.RegisterSourceOutput(visitorMembers, WriteVisitors); + } +} + +readonly struct EquatableArray : IEquatable>, IEnumerable + where T : IEquatable +{ + readonly T[] array; + + public EquatableArray(T[] array) + { + this.array = array ?? throw new ArgumentNullException(nameof(array)); + } + + public bool Equals(EquatableArray other) + { + return other.array.AsSpan().SequenceEqual(this.array); + } + + public IEnumerator GetEnumerator() + { + return ((IEnumerable)array).GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return array.GetEnumerator(); + } +} + +static class EquatableArrayExtensions +{ + public static EquatableArray ToEquatableArray(this List array) where T : IEquatable + { + return new EquatableArray(array.ToArray()); + } +} \ No newline at end of file diff --git a/ICSharpCode.Decompiler.Generators/ICSharpCode.Decompiler.Generators.csproj b/ICSharpCode.Decompiler.Generators/ICSharpCode.Decompiler.Generators.csproj new file mode 100644 index 000000000..0449c2168 --- /dev/null +++ b/ICSharpCode.Decompiler.Generators/ICSharpCode.Decompiler.Generators.csproj @@ -0,0 +1,21 @@ + + + + netstandard2.0 + enable + enable + true + 12 + + false + + + + + + + diff --git a/ICSharpCode.Decompiler.Generators/IsExternalInit.cs b/ICSharpCode.Decompiler.Generators/IsExternalInit.cs new file mode 100644 index 000000000..d39d3061d --- /dev/null +++ b/ICSharpCode.Decompiler.Generators/IsExternalInit.cs @@ -0,0 +1,3 @@ +namespace System.Runtime.CompilerServices; + +class IsExternalInit { } diff --git a/ICSharpCode.Decompiler.Generators/NuGet.config b/ICSharpCode.Decompiler.Generators/NuGet.config new file mode 100644 index 000000000..edb927d0b --- /dev/null +++ b/ICSharpCode.Decompiler.Generators/NuGet.config @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + diff --git a/ICSharpCode.Decompiler.Generators/RoslynHelpers.cs b/ICSharpCode.Decompiler.Generators/RoslynHelpers.cs new file mode 100644 index 000000000..fa198a98d --- /dev/null +++ b/ICSharpCode.Decompiler.Generators/RoslynHelpers.cs @@ -0,0 +1,32 @@ +using Microsoft.CodeAnalysis; + +namespace ICSharpCode.Decompiler.Generators; + +public static class RoslynHelpers +{ + public static IEnumerable GetTopLevelTypes(this IAssemblySymbol assembly) + { + foreach (var ns in TreeTraversal.PreOrder(assembly.GlobalNamespace, ns => ns.GetNamespaceMembers())) + { + foreach (var t in ns.GetTypeMembers()) + { + yield return t; + } + } + } + + public static bool IsDerivedFrom(this INamedTypeSymbol type, INamedTypeSymbol baseType) + { + INamedTypeSymbol? t = type; + + while (t != null) + { + if (SymbolEqualityComparer.Default.Equals(t, baseType)) + return true; + + t = t.BaseType; + } + + return false; + } +} diff --git a/ICSharpCode.Decompiler.Generators/TreeTraversal.cs b/ICSharpCode.Decompiler.Generators/TreeTraversal.cs new file mode 100644 index 000000000..3485768bb --- /dev/null +++ b/ICSharpCode.Decompiler.Generators/TreeTraversal.cs @@ -0,0 +1,125 @@ +#nullable enable +// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +namespace ICSharpCode.Decompiler.Generators; + +/// +/// Static helper methods for traversing trees. +/// +internal static class TreeTraversal +{ + /// + /// Converts a tree data structure into a flat list by traversing it in pre-order. + /// + /// The root element of the tree. + /// The function that gets the children of an element. + /// Iterator that enumerates the tree structure in pre-order. + public static IEnumerable PreOrder(T root, Func?> recursion) + { + return PreOrder(new T[] { root }, recursion); + } + + /// + /// Converts a tree data structure into a flat list by traversing it in pre-order. + /// + /// The root elements of the forest. + /// The function that gets the children of an element. + /// Iterator that enumerates the tree structure in pre-order. + public static IEnumerable PreOrder(IEnumerable input, Func?> recursion) + { + Stack> stack = new Stack>(); + try + { + stack.Push(input.GetEnumerator()); + while (stack.Count > 0) + { + while (stack.Peek().MoveNext()) + { + T element = stack.Peek().Current; + yield return element; + IEnumerable? children = recursion(element); + if (children != null) + { + stack.Push(children.GetEnumerator()); + } + } + stack.Pop().Dispose(); + } + } + finally + { + while (stack.Count > 0) + { + stack.Pop().Dispose(); + } + } + } + + /// + /// Converts a tree data structure into a flat list by traversing it in post-order. + /// + /// The root element of the tree. + /// The function that gets the children of an element. + /// Iterator that enumerates the tree structure in post-order. + public static IEnumerable PostOrder(T root, Func?> recursion) + { + return PostOrder(new T[] { root }, recursion); + } + + /// + /// Converts a tree data structure into a flat list by traversing it in post-order. + /// + /// The root elements of the forest. + /// The function that gets the children of an element. + /// Iterator that enumerates the tree structure in post-order. + public static IEnumerable PostOrder(IEnumerable input, Func?> recursion) + { + Stack> stack = new Stack>(); + try + { + stack.Push(input.GetEnumerator()); + while (stack.Count > 0) + { + while (stack.Peek().MoveNext()) + { + T element = stack.Peek().Current; + IEnumerable? children = recursion(element); + if (children != null) + { + stack.Push(children.GetEnumerator()); + } + else + { + yield return element; + } + } + stack.Pop().Dispose(); + if (stack.Count > 0) + yield return stack.Peek().Current; + } + } + finally + { + while (stack.Count > 0) + { + stack.Pop().Dispose(); + } + } + } +} diff --git a/ICSharpCode.Decompiler.Generators/packages.lock.json b/ICSharpCode.Decompiler.Generators/packages.lock.json new file mode 100644 index 000000000..0f466391f --- /dev/null +++ b/ICSharpCode.Decompiler.Generators/packages.lock.json @@ -0,0 +1,120 @@ +{ + "version": 1, + "dependencies": { + ".NETStandard,Version=v2.0": { + "Microsoft.CodeAnalysis.CSharp": { + "type": "Direct", + "requested": "[5.0.0, )", + "resolved": "5.0.0", + "contentHash": "5DSyJ9bk+ATuDy7fp2Zt0mJStDVKbBoiz1DyfAwSa+k4H4IwykAUcV3URelw5b8/iVbfSaOwkwmPUZH6opZKCw==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.11.0", + "Microsoft.CodeAnalysis.Common": "[5.0.0]", + "System.Buffers": "4.6.0", + "System.Collections.Immutable": "9.0.0", + "System.Memory": "4.6.0", + "System.Numerics.Vectors": "4.6.0", + "System.Reflection.Metadata": "9.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.1.0", + "System.Text.Encoding.CodePages": "8.0.0", + "System.Threading.Tasks.Extensions": "4.6.0" + } + }, + "NETStandard.Library": { + "type": "Direct", + "requested": "[2.0.3, )", + "resolved": "2.0.3", + "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "Microsoft.CodeAnalysis.Analyzers": { + "type": "Transitive", + "resolved": "3.11.0", + "contentHash": "v/EW3UE8/lbEYHoC2Qq7AR/DnmvpgdtAMndfQNmpuIMx/Mto8L5JnuCfdBYtgvalQOtfNCnxFejxuRrryvUTsg==" + }, + "Microsoft.CodeAnalysis.Common": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "ZXRAdvH6GiDeHRyd3q/km8Z44RoM6FBWHd+gen/la81mVnAdHTEsEkO5J0TCNXBymAcx5UYKt5TvgKBhaLJEow==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.11.0", + "System.Buffers": "4.6.0", + "System.Collections.Immutable": "9.0.0", + "System.Memory": "4.6.0", + "System.Numerics.Vectors": "4.6.0", + "System.Reflection.Metadata": "9.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.1.0", + "System.Text.Encoding.CodePages": "8.0.0", + "System.Threading.Tasks.Extensions": "4.6.0" + } + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + }, + "System.Buffers": { + "type": "Transitive", + "resolved": "4.6.0", + "contentHash": "lN6tZi7Q46zFzAbRYXTIvfXcyvQQgxnY7Xm6C6xQ9784dEL1amjM6S6Iw4ZpsvesAKnRVsM4scrDQaDqSClkjA==" + }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "9.0.0", + "contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.6.0", + "contentHash": "OEkbBQoklHngJ8UD8ez2AERSk2g+/qpAaSWWCBFbpH727HxDq5ydVkuncBaKcKfwRqXGWx64dS6G1SUScMsitg==", + "dependencies": { + "System.Buffers": "4.6.0", + "System.Numerics.Vectors": "4.6.0", + "System.Runtime.CompilerServices.Unsafe": "6.1.0" + } + }, + "System.Numerics.Vectors": { + "type": "Transitive", + "resolved": "4.6.0", + "contentHash": "t+SoieZsRuEyiw/J+qXUbolyO219tKQQI0+2/YI+Qv7YdGValA6WiuokrNKqjrTNsy5ABWU11bdKOzUdheteXg==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "9.0.0", + "contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==", + "dependencies": { + "System.Collections.Immutable": "9.0.0", + "System.Memory": "4.5.5" + } + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.1.0", + "contentHash": "5o/HZxx6RVqYlhKSq8/zronDkALJZUT2Vz0hx43f0gwe8mwlM0y2nYlqdBwLMzr262Bwvpikeb/yEwkAa5PADg==" + }, + "System.Text.Encoding.CodePages": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "OZIsVplFGaVY90G2SbpgU7EnCoOO5pw1t4ic21dBF3/1omrJFpAGoNAVpPyMVOC90/hvgkGG3VFqR13YgZMQfg==", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.6.0", + "contentHash": "I5G6Y8jb0xRtGUC9Lahy7FUvlYlnGMMkbuKAQBy8Jb7Y6Yn8OlBEiUOY0PqZ0hy6Ua8poVA1ui1tAIiXNxGdsg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.1.0" + } + } + } + } +} \ No newline at end of file diff --git a/ICSharpCode.Decompiler.Tests/packages.lock.json b/ICSharpCode.Decompiler.Tests/packages.lock.json index 5652b9c4d..da8e45fa7 100644 --- a/ICSharpCode.Decompiler.Tests/packages.lock.json +++ b/ICSharpCode.Decompiler.Tests/packages.lock.json @@ -214,14 +214,6 @@ "resolved": "5.6.0-2.26172.2", "contentHash": "xRPIwva1u2UuX46lfccAl8+86YnjzXjoCD83KanidOq/qHXHt4UdhWj4oPGtAcVnYWiiQPnYwi16wD6SSuLZUw==" }, - "Microsoft.CodeAnalysis.Common": { - "type": "Transitive", - "resolved": "5.8.0-1.26302.115", - "contentHash": "GVNztynnvtpOh19LGlhwQTNOBKoSsaJ+Q+fA80AMKJNDXw25mCTJLM4TEJfyTolJj6DesIK78Xlu3iG7y8sIMg==", - "dependencies": { - "Microsoft.CodeAnalysis.Analyzers": "5.6.0-2.26172.2" - } - }, "Microsoft.DiaSymReader.PortablePdb": { "type": "Transitive", "resolved": "1.7.0-beta-21525-03", @@ -1254,6 +1246,15 @@ "resolved": "1.3.8", "contentHash": "LhwlPa7c1zs1OV2XadMtAWdImjLIsqFJPoRcIWAadSRn0Ri1DepK65UbWLPmt4riLqx2d40xjXRk0ogpqNtK7g==" }, + "Microsoft.CodeAnalysis.Common": { + "type": "CentralTransitive", + "requested": "[5.8.0-1.26302.115, )", + "resolved": "5.8.0-1.26302.115", + "contentHash": "GVNztynnvtpOh19LGlhwQTNOBKoSsaJ+Q+fA80AMKJNDXw25mCTJLM4TEJfyTolJj6DesIK78Xlu3iG7y8sIMg==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "5.6.0-2.26172.2" + } + }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "CentralTransitive", "requested": "[10.0.9, )", diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/AstNode.cs b/ICSharpCode.Decompiler/CSharp/Syntax/AstNode.cs index eab3341fe..5ba259a5f 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/AstNode.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/AstNode.cs @@ -37,6 +37,7 @@ using ICSharpCode.Decompiler.TypeSystem; namespace ICSharpCode.Decompiler.CSharp.Syntax { + [DecompilerAstNode(hasNullNode: true, hasPatternPlaceholder: true)] public abstract partial class AstNode : AbstractAnnotatable, INode, ICloneable { // the Root role must be available when creating the null nodes, so we can't put it in the Roles class diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/AstType.cs b/ICSharpCode.Decompiler/CSharp/Syntax/AstType.cs index 35b419f86..ce2952641 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/AstType.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/AstType.cs @@ -26,7 +26,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// A type reference in the C# AST. /// - public abstract class AstType : AstNode + [DecompilerAstNode(hasNullNode: true, hasPatternPlaceholder: true)] + public abstract partial class AstType : AstNode { #region Null public new static readonly AstType Null = new NullAstType(); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/CSharpModifierToken.cs b/ICSharpCode.Decompiler/CSharp/Syntax/CSharpModifierToken.cs index 540309dd9..335fc6431 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/CSharpModifierToken.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/CSharpModifierToken.cs @@ -31,7 +31,8 @@ using ICSharpCode.Decompiler.CSharp.OutputVisitor; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class CSharpModifierToken : CSharpTokenNode + [DecompilerAstNode(hasNullNode: false)] + public partial class CSharpModifierToken : CSharpTokenNode { Modifiers modifier; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/CSharpTokenNode.cs b/ICSharpCode.Decompiler/CSharp/Syntax/CSharpTokenNode.cs index a01368774..b939d3c7d 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/CSharpTokenNode.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/CSharpTokenNode.cs @@ -34,7 +34,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// In all non null c# token nodes the Role of a CSharpToken must be a TokenRole. /// - public class CSharpTokenNode : AstNode + [DecompilerAstNode(hasNullNode: true)] + public partial class CSharpTokenNode : AstNode { public static new readonly CSharpTokenNode Null = new NullCSharpTokenNode(); class NullCSharpTokenNode : CSharpTokenNode diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/ComposedType.cs b/ICSharpCode.Decompiler/CSharp/Syntax/ComposedType.cs index ae8901193..06a2edda7 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/ComposedType.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/ComposedType.cs @@ -32,7 +32,8 @@ using ICSharpCode.Decompiler.CSharp.OutputVisitor; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class ComposedType : AstType + [DecompilerAstNode(hasNullNode: false)] + public partial class ComposedType : AstType { public static readonly Role AttributeRole = EntityDeclaration.AttributeRole; public static readonly TokenRole RefRole = new TokenRole("ref"); @@ -203,7 +204,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// [,,,] /// - public class ArraySpecifier : AstNode + [DecompilerAstNode(hasNullNode: false)] + public partial class ArraySpecifier : AstNode { public override NodeType NodeType { get { diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/DocumentationReference.cs b/ICSharpCode.Decompiler/CSharp/Syntax/DocumentationReference.cs index 926f06745..2b73da869 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/DocumentationReference.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/DocumentationReference.cs @@ -23,7 +23,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Represents a 'cref' reference in XML documentation. /// - public class DocumentationReference : AstNode + [DecompilerAstNode(hasNullNode: false)] + public partial class DocumentationReference : AstNode { public static readonly Role DeclaringTypeRole = new Role("DeclaringType", AstType.Null); public static readonly Role ConversionOperatorReturnTypeRole = new Role("ConversionOperatorReturnType", AstType.Null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AnonymousMethodExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AnonymousMethodExpression.cs index 3514242ca..2d5b94324 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AnonymousMethodExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AnonymousMethodExpression.cs @@ -32,7 +32,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// [async] delegate(Parameters) {Body} /// - public class AnonymousMethodExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class AnonymousMethodExpression : Expression { public readonly static TokenRole DelegateKeywordRole = new TokenRole("delegate"); public readonly static TokenRole AsyncModifierRole = LambdaExpression.AsyncModifierRole; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AnonymousTypeCreateExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AnonymousTypeCreateExpression.cs index 669b65930..d5149857b 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AnonymousTypeCreateExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AnonymousTypeCreateExpression.cs @@ -30,7 +30,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// new { [ExpressionList] } /// - public class AnonymousTypeCreateExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class AnonymousTypeCreateExpression : Expression { public readonly static TokenRole NewKeywordRole = new TokenRole("new"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ArrayCreateExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ArrayCreateExpression.cs index ac54b23c3..f3fc46482 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ArrayCreateExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ArrayCreateExpression.cs @@ -21,7 +21,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// new Type[Dimensions] /// - public class ArrayCreateExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class ArrayCreateExpression : Expression { public readonly static TokenRole NewKeywordRole = new TokenRole("new"); public readonly static Role AdditionalArraySpecifierRole = new Role("AdditionalArraySpecifier", null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ArrayInitializerExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ArrayInitializerExpression.cs index aa980d67e..60dbbaa0f 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ArrayInitializerExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ArrayInitializerExpression.cs @@ -31,7 +31,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// { Elements } /// - public class ArrayInitializerExpression : Expression + [DecompilerAstNode(hasNullNode: true, hasPatternPlaceholder: true)] + public partial class ArrayInitializerExpression : Expression { /// /// For ease of use purposes in the resolver the ast representation diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AsExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AsExpression.cs index d805f5850..1d34f54fc 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AsExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AsExpression.cs @@ -30,7 +30,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Expression as TypeReference /// - public class AsExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class AsExpression : Expression { public readonly static TokenRole AsKeywordRole = new TokenRole("as"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AssignmentExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AssignmentExpression.cs index f23dae1fd..acf26e619 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AssignmentExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AssignmentExpression.cs @@ -33,7 +33,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Left Operator= Right /// - public class AssignmentExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class AssignmentExpression : Expression { // reuse roles from BinaryOperatorExpression public readonly static Role LeftRole = BinaryOperatorExpression.LeftRole; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/BaseReferenceExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/BaseReferenceExpression.cs index 0bba79264..3a1cc743a 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/BaseReferenceExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/BaseReferenceExpression.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// base /// - public class BaseReferenceExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class BaseReferenceExpression : Expression { public TextLocation Location { get; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/BinaryOperatorExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/BinaryOperatorExpression.cs index b9a9b9f20..deb3b9558 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/BinaryOperatorExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/BinaryOperatorExpression.cs @@ -32,7 +32,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Left Operator Right /// - public class BinaryOperatorExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class BinaryOperatorExpression : Expression { public readonly static TokenRole BitwiseAndRole = new TokenRole("&"); public readonly static TokenRole BitwiseOrRole = new TokenRole("|"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CastExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CastExpression.cs index ed0e2a81c..92b1545f6 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CastExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CastExpression.cs @@ -30,7 +30,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// (CastTo)Expression /// - public class CastExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class CastExpression : Expression { public CSharpTokenNode LParToken { get { return GetChildByRole(Roles.LPar); } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CheckedExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CheckedExpression.cs index 593954a7a..6b33305bb 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CheckedExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CheckedExpression.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// checked(Expression) /// - public class CheckedExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class CheckedExpression : Expression { public readonly static TokenRole CheckedKeywordRole = new TokenRole("checked"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ConditionalExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ConditionalExpression.cs index 52d668e35..63f386917 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ConditionalExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ConditionalExpression.cs @@ -30,7 +30,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Condition ? TrueExpression : FalseExpression /// - public class ConditionalExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class ConditionalExpression : Expression { public readonly static Role ConditionRole = Roles.Condition; public readonly static TokenRole QuestionMarkRole = new TokenRole("?"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DeclarationExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DeclarationExpression.cs index 89a4f6a1a..aea6e6976 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DeclarationExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DeclarationExpression.cs @@ -23,7 +23,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// TypeName VariableDesignation /// - public class DeclarationExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class DeclarationExpression : Expression { public AstType Type { get { return GetChildByRole(Roles.Type); } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DecompilerAstNodeAttribute.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DecompilerAstNodeAttribute.cs new file mode 100644 index 000000000..a0dd2b2ae --- /dev/null +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DecompilerAstNodeAttribute.cs @@ -0,0 +1,30 @@ +// Copyright (c) 2017 Siegfried Pammer +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + + + + + + + +namespace ICSharpCode.Decompiler.CSharp.Syntax +{ + class DecompilerAstNodeAttribute : System.Attribute + { + } +} \ No newline at end of file diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DefaultValueExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DefaultValueExpression.cs index d8b12a5da..c328e789e 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DefaultValueExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DefaultValueExpression.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// default(Type) /// - public class DefaultValueExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class DefaultValueExpression : Expression { public readonly static TokenRole DefaultKeywordRole = new TokenRole("default"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DirectionExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DirectionExpression.cs index f58186236..12a693744 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DirectionExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DirectionExpression.cs @@ -37,7 +37,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// ref Expression /// - public class DirectionExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class DirectionExpression : Expression { public readonly static TokenRole RefKeywordRole = new TokenRole("ref"); public readonly static TokenRole OutKeywordRole = new TokenRole("out"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs index 0415adceb..947bf4e9f 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs @@ -27,7 +27,8 @@ using System; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class ErrorExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class ErrorExpression : Expression { public TextLocation Location { get; set; } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/Expression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/Expression.cs index c5d73352e..5e15a5103 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/Expression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/Expression.cs @@ -28,7 +28,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// This class is useful even though it doesn't provide any additional functionality: /// It can be used to communicate more information in APIs, e.g. "this subnode will always be an expression" /// - public abstract class Expression : AstNode + [DecompilerAstNode(hasNullNode: true, hasPatternPlaceholder: true)] + public abstract partial class Expression : AstNode { #region Null public new static readonly Expression Null = new NullExpression(); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IdentifierExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IdentifierExpression.cs index fc329b61b..bc55923d8 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IdentifierExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IdentifierExpression.cs @@ -26,7 +26,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class IdentifierExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class IdentifierExpression : Expression { public IdentifierExpression() { diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IndexerExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IndexerExpression.cs index 301ee8341..324a08191 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IndexerExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IndexerExpression.cs @@ -31,7 +31,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Target[Arguments] /// - public class IndexerExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class IndexerExpression : Expression { public Expression Target { get { return GetChildByRole(Roles.TargetExpression); } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/InterpolatedStringExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/InterpolatedStringExpression.cs index 2e1989836..c97414e3d 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/InterpolatedStringExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/InterpolatedStringExpression.cs @@ -6,7 +6,8 @@ using ICSharpCode.Decompiler.CSharp.Syntax.PatternMatching; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class InterpolatedStringExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class InterpolatedStringExpression : Expression { public static readonly TokenRole OpenQuote = new TokenRole("$\""); public static readonly TokenRole CloseQuote = new TokenRole("\""); @@ -47,7 +48,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } } - public abstract class InterpolatedStringContent : AstNode + [DecompilerAstNode(hasNullNode: true)] + public abstract partial class InterpolatedStringContent : AstNode { #region Null public new static readonly InterpolatedStringContent Null = new NullInterpolatedStringContent(); @@ -90,7 +92,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// { Expression , Alignment : Suffix } /// - public class Interpolation : InterpolatedStringContent + [DecompilerAstNode(hasNullNode: false)] + public partial class Interpolation : InterpolatedStringContent { public static readonly TokenRole LBrace = new TokenRole("{"); public static readonly TokenRole RBrace = new TokenRole("}"); @@ -146,7 +149,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } } - public class InterpolatedStringText : InterpolatedStringContent + [DecompilerAstNode(hasNullNode: false)] + public partial class InterpolatedStringText : InterpolatedStringContent { public string Text { get; set; } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/InvocationExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/InvocationExpression.cs index d7a73c498..43a3a89f6 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/InvocationExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/InvocationExpression.cs @@ -31,7 +31,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Target(Arguments) /// - public class InvocationExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class InvocationExpression : Expression { public Expression Target { get { return GetChildByRole(Roles.TargetExpression); } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IsExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IsExpression.cs index 66c03460d..7f034fa31 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IsExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IsExpression.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Expression is Type /// - public class IsExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class IsExpression : Expression { public readonly static TokenRole IsKeywordRole = new TokenRole("is"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/LambdaExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/LambdaExpression.cs index b465624af..d55b98fe5 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/LambdaExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/LambdaExpression.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// [async] Parameters => Body /// - public class LambdaExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class LambdaExpression : Expression { public static readonly Role AttributeRole = new Role("Attribute", null); public readonly static TokenRole AsyncModifierRole = new TokenRole("async"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/MemberReferenceExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/MemberReferenceExpression.cs index 49933e719..29bf11cd4 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/MemberReferenceExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/MemberReferenceExpression.cs @@ -31,7 +31,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Target.MemberName /// - public class MemberReferenceExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class MemberReferenceExpression : Expression { public Expression Target { get { diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NamedArgumentExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NamedArgumentExpression.cs index 72cd3f7de..9093395e0 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NamedArgumentExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NamedArgumentExpression.cs @@ -22,7 +22,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// Represents a named argument passed to a method or attribute. /// name: expression /// - public class NamedArgumentExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class NamedArgumentExpression : Expression { public NamedArgumentExpression() { diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NamedExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NamedExpression.cs index 574afe711..30cb1312e 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NamedExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NamedExpression.cs @@ -31,7 +31,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// This isn't the same as 'assign' even though it has the same syntax. /// This expression is used in object initializers and for named attribute arguments [Attr(FieldName = value)]. /// - public class NamedExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class NamedExpression : Expression { public NamedExpression() { diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NullReferenceExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NullReferenceExpression.cs index 0fd9e13fd..a263879b4 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NullReferenceExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/NullReferenceExpression.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// null /// - public class NullReferenceExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class NullReferenceExpression : Expression { TextLocation location; public override TextLocation StartLocation { diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ObjectCreateExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ObjectCreateExpression.cs index e5372ee25..9eeb69e07 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ObjectCreateExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ObjectCreateExpression.cs @@ -31,7 +31,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// new Type(Arguments) { Initializer } /// - public class ObjectCreateExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class ObjectCreateExpression : Expression { public readonly static TokenRole NewKeywordRole = new TokenRole("new"); public readonly static Role InitializerRole = ArrayCreateExpression.InitializerRole; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/OutVarDeclarationExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/OutVarDeclarationExpression.cs index 414f2dbde..e607eeda2 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/OutVarDeclarationExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/OutVarDeclarationExpression.cs @@ -21,7 +21,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// out type expression /// - public class OutVarDeclarationExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class OutVarDeclarationExpression : Expression { public readonly static TokenRole OutKeywordRole = DirectionExpression.OutKeywordRole; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ParenthesizedExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ParenthesizedExpression.cs index a7184246b..52699fb1b 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ParenthesizedExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ParenthesizedExpression.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// ( Expression ) /// - public class ParenthesizedExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class ParenthesizedExpression : Expression { public CSharpTokenNode LParToken { get { return GetChildByRole(Roles.LPar); } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/PointerReferenceExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/PointerReferenceExpression.cs index 3c36b9a25..f6004b870 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/PointerReferenceExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/PointerReferenceExpression.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Target->MemberName /// - public class PointerReferenceExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class PointerReferenceExpression : Expression { public readonly static TokenRole ArrowRole = new TokenRole("->"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/PrimitiveExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/PrimitiveExpression.cs index 68083c52c..b2b069f9c 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/PrimitiveExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/PrimitiveExpression.cs @@ -46,7 +46,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Represents a literal value. /// - public class PrimitiveExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class PrimitiveExpression : Expression { public static readonly object AnyValue = new object(); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/QueryExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/QueryExpression.cs index fa1aacacc..f79e4ed36 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/QueryExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/QueryExpression.cs @@ -18,7 +18,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class QueryExpression : Expression + [DecompilerAstNode(hasNullNode: true)] + public partial class QueryExpression : Expression { public static readonly Role ClauseRole = new Role("Clause", null); @@ -106,7 +107,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// new QuerySelectClause(e) /// } /// - public class QueryContinuationClause : QueryClause + [DecompilerAstNode(hasNullNode: false)] + public partial class QueryContinuationClause : QueryClause { public static readonly Role PrecedingQueryRole = new Role("PrecedingQuery", QueryExpression.Null); public static readonly TokenRole IntoKeywordRole = new TokenRole("into"); @@ -155,7 +157,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } } - public class QueryFromClause : QueryClause + [DecompilerAstNode(hasNullNode: false)] + public partial class QueryFromClause : QueryClause { public static readonly TokenRole FromKeywordRole = new TokenRole("from"); public static readonly TokenRole InKeywordRole = new TokenRole("in"); @@ -214,7 +217,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } } - public class QueryLetClause : QueryClause + [DecompilerAstNode(hasNullNode: false)] + public partial class QueryLetClause : QueryClause { public readonly static TokenRole LetKeywordRole = new TokenRole("let"); @@ -266,7 +270,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } } - public class QueryWhereClause : QueryClause + [DecompilerAstNode(hasNullNode: false)] + public partial class QueryWhereClause : QueryClause { public readonly static TokenRole WhereKeywordRole = new TokenRole("where"); @@ -304,7 +309,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Represents a join or group join clause. /// - public class QueryJoinClause : QueryClause + [DecompilerAstNode(hasNullNode: false)] + public partial class QueryJoinClause : QueryClause { public static readonly TokenRole JoinKeywordRole = new TokenRole("join"); public static readonly Role TypeRole = Roles.Type; @@ -414,7 +420,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } } - public class QueryOrderClause : QueryClause + [DecompilerAstNode(hasNullNode: false)] + public partial class QueryOrderClause : QueryClause { public static readonly TokenRole OrderbyKeywordRole = new TokenRole("orderby"); public static readonly Role OrderingRole = new Role("Ordering", null); @@ -449,7 +456,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } } - public class QueryOrdering : AstNode + [DecompilerAstNode(hasNullNode: false)] + public partial class QueryOrdering : AstNode { public readonly static TokenRole AscendingKeywordRole = new TokenRole("ascending"); public readonly static TokenRole DescendingKeywordRole = new TokenRole("descending"); @@ -501,7 +509,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax Descending } - public class QuerySelectClause : QueryClause + [DecompilerAstNode(hasNullNode: false)] + public partial class QuerySelectClause : QueryClause { public readonly static TokenRole SelectKeywordRole = new TokenRole("select"); @@ -536,7 +545,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } } - public class QueryGroupClause : QueryClause + [DecompilerAstNode(hasNullNode: false)] + public partial class QueryGroupClause : QueryClause { public static readonly TokenRole GroupKeywordRole = new TokenRole("group"); public static readonly Role ProjectionRole = new Role("Projection", Expression.Null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/RecursivePatternExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/RecursivePatternExpression.cs index 9f9c0d2e1..1e974d12d 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/RecursivePatternExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/RecursivePatternExpression.cs @@ -20,7 +20,8 @@ using ICSharpCode.Decompiler.CSharp.Syntax.PatternMatching; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class RecursivePatternExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class RecursivePatternExpression : Expression { public static readonly Role SubPatternRole = new Role("SubPattern", Syntax.Expression.Null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/SizeOfExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/SizeOfExpression.cs index 5ec9b2d88..dc2f626d5 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/SizeOfExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/SizeOfExpression.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// sizeof(Type) /// - public class SizeOfExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class SizeOfExpression : Expression { public readonly static TokenRole SizeofKeywordRole = new TokenRole("sizeof"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/StackAllocExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/StackAllocExpression.cs index 552e9ac39..9ff7aacf5 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/StackAllocExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/StackAllocExpression.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// stackalloc Type[Count] /// - public class StackAllocExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class StackAllocExpression : Expression { public readonly static TokenRole StackallocKeywordRole = new TokenRole("stackalloc"); public readonly static Role InitializerRole = new Role("Initializer", ArrayInitializerExpression.Null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/SwitchExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/SwitchExpression.cs index 227aca8b6..647dee882 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/SwitchExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/SwitchExpression.cs @@ -21,7 +21,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Expression switch { SwitchSections } /// - public class SwitchExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class SwitchExpression : Expression { public static readonly TokenRole SwitchKeywordRole = new TokenRole("switch"); public static readonly Role SwitchSectionRole = new Role("SwitchSection", null); @@ -72,7 +73,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Pattern => Expression /// - public class SwitchExpressionSection : AstNode + [DecompilerAstNode(hasNullNode: false)] + public partial class SwitchExpressionSection : AstNode { public static readonly Role PatternRole = new Role("Pattern", Expression.Null); public static readonly Role BodyRole = new Role("Body", Expression.Null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ThisReferenceExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ThisReferenceExpression.cs index 9bf0b2a9e..89a81fbec 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ThisReferenceExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ThisReferenceExpression.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// this /// - public class ThisReferenceExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class ThisReferenceExpression : Expression { public TextLocation Location { get; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ThrowExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ThrowExpression.cs index 32a4cc084..05b2b1612 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ThrowExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ThrowExpression.cs @@ -21,7 +21,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// throw Expression /// - public class ThrowExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class ThrowExpression : Expression { public static readonly TokenRole ThrowKeywordRole = ThrowStatement.ThrowKeywordRole; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TupleExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TupleExpression.cs index c7f0ec401..67c8c4c3e 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TupleExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TupleExpression.cs @@ -22,7 +22,8 @@ using ICSharpCode.Decompiler.CSharp.Syntax.PatternMatching; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class TupleExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class TupleExpression : Expression { public AstNodeCollection Elements { get { return GetChildrenByRole(Roles.Expression); } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TypeOfExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TypeOfExpression.cs index 748a412d6..c2fb2ba91 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TypeOfExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TypeOfExpression.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// typeof(Type) /// - public class TypeOfExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class TypeOfExpression : Expression { public readonly static TokenRole TypeofKeywordRole = new TokenRole("typeof"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TypeReferenceExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TypeReferenceExpression.cs index 36434b703..16448747c 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TypeReferenceExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/TypeReferenceExpression.cs @@ -22,7 +22,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// Represents an AstType as an expression. /// This is used when calling a method on a primitive type: "int.Parse()" /// - public class TypeReferenceExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class TypeReferenceExpression : Expression { public AstType Type { get { return GetChildByRole(Roles.Type); } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UnaryOperatorExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UnaryOperatorExpression.cs index 67d70e919..5754a9eb8 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UnaryOperatorExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UnaryOperatorExpression.cs @@ -32,7 +32,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Operator Expression /// - public class UnaryOperatorExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class UnaryOperatorExpression : Expression { public readonly static TokenRole NotRole = new TokenRole("!"); public readonly static TokenRole BitNotRole = new TokenRole("~"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UncheckedExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UncheckedExpression.cs index baf9b0ec1..3056d5e34 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UncheckedExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UncheckedExpression.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// unchecked(Expression) /// - public class UncheckedExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class UncheckedExpression : Expression { public readonly static TokenRole UncheckedKeywordRole = new TokenRole("unchecked"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UndocumentedExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UndocumentedExpression.cs index eb06c47fd..7e5461bec 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UndocumentedExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/UndocumentedExpression.cs @@ -38,7 +38,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Represents undocumented expressions. /// - public class UndocumentedExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class UndocumentedExpression : Expression { public readonly static TokenRole ArglistKeywordRole = new TokenRole("__arglist"); public readonly static TokenRole RefvalueKeywordRole = new TokenRole("__refvalue"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/WithInitializerExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/WithInitializerExpression.cs index 21b077187..9b771f303 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/WithInitializerExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/WithInitializerExpression.cs @@ -23,7 +23,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Expression with Initializer /// - public class WithInitializerExpression : Expression + [DecompilerAstNode(hasNullNode: false)] + public partial class WithInitializerExpression : Expression { public readonly static TokenRole WithKeywordRole = new TokenRole("with"); public readonly static Role InitializerRole = ArrayCreateExpression.InitializerRole; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/FunctionPointerAstType.cs b/ICSharpCode.Decompiler/CSharp/Syntax/FunctionPointerAstType.cs index efac43fa3..8cf6ec3fb 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/FunctionPointerAstType.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/FunctionPointerAstType.cs @@ -26,7 +26,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class FunctionPointerAstType : AstType + [DecompilerAstNode(hasNullNode: false)] + public partial class FunctionPointerAstType : AstType { public static readonly TokenRole PointerRole = new TokenRole("*"); public static readonly Role CallingConventionRole = new Role("CallConv", AstType.Null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Attribute.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Attribute.cs index b271d3410..df4261ae9 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Attribute.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Attribute.cs @@ -31,7 +31,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Attribute(Arguments) /// - public class Attribute : AstNode + [DecompilerAstNode(hasNullNode: false)] + public partial class Attribute : AstNode { public override NodeType NodeType { get { diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/AttributeSection.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/AttributeSection.cs index 89c000a26..98011a430 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/AttributeSection.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/AttributeSection.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// [AttributeTarget: Attributes] /// - public class AttributeSection : AstNode + [DecompilerAstNode(hasNullNode: false, hasPatternPlaceholder: true)] + public partial class AttributeSection : AstNode { #region PatternPlaceholder public static implicit operator AttributeSection(PatternMatching.Pattern pattern) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Comment.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Comment.cs index 3924dbeed..c50475d93 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Comment.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Comment.cs @@ -50,7 +50,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax MultiLineDocumentation } - public class Comment : AstNode + [DecompilerAstNode(hasNullNode: false)] + public partial class Comment : AstNode { public override NodeType NodeType { get { diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Constraint.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Constraint.cs index cfa69d101..8bdbb0ba6 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Constraint.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/Constraint.cs @@ -32,7 +32,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// new(), struct and class constraints are represented using a PrimitiveType "new", "struct" or "class" /// - public class Constraint : AstNode + [DecompilerAstNode(hasNullNode: true)] + public partial class Constraint : AstNode { public override NodeType NodeType { get { return NodeType.Unknown; } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/DelegateDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/DelegateDeclaration.cs index c75b30e8f..ea9bda7b1 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/DelegateDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/DelegateDeclaration.cs @@ -31,7 +31,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// delegate ReturnType Name<TypeParameters>(Parameters) where Constraints; /// - public class DelegateDeclaration : EntityDeclaration + [DecompilerAstNode(hasNullNode: false)] + public partial class DelegateDeclaration : EntityDeclaration { public override NodeType NodeType { get { return NodeType.TypeDeclaration; } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/ExternAliasDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/ExternAliasDeclaration.cs index c8ab82091..6263323f9 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/ExternAliasDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/ExternAliasDeclaration.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// extern alias IDENTIFIER; /// - public class ExternAliasDeclaration : AstNode + [DecompilerAstNode(hasNullNode: false)] + public partial class ExternAliasDeclaration : AstNode { public override NodeType NodeType { get { diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/NamespaceDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/NamespaceDeclaration.cs index b8b4cdd06..12765f6ee 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/NamespaceDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/NamespaceDeclaration.cs @@ -31,7 +31,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// namespace Name { Members } /// - public class NamespaceDeclaration : AstNode + [DecompilerAstNode(hasNullNode: false)] + public partial class NamespaceDeclaration : AstNode { public static readonly Role MemberRole = SyntaxTree.MemberRole; public static readonly Role NamespaceNameRole = new Role("NamespaceName", AstType.Null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/PreProcessorDirective.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/PreProcessorDirective.cs index 080d7e474..1006d0d88 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/PreProcessorDirective.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/PreProcessorDirective.cs @@ -46,7 +46,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax Line = 12 } - public class LinePreprocessorDirective : PreProcessorDirective + [DecompilerAstNode(hasNullNode: false)] + public partial class LinePreprocessorDirective : PreProcessorDirective { public int LineNumber { get; @@ -67,7 +68,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } } - public class PragmaWarningPreprocessorDirective : PreProcessorDirective + [DecompilerAstNode(hasNullNode: false)] + public partial class PragmaWarningPreprocessorDirective : PreProcessorDirective { public static readonly Role WarningRole = new Role("Warning", null); @@ -125,7 +127,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } } - public class PreProcessorDirective : AstNode + [DecompilerAstNode(hasNullNode: false)] + public partial class PreProcessorDirective : AstNode { public override NodeType NodeType { get { diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/TypeDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/TypeDeclaration.cs index 2c396778f..fc03b3836 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/TypeDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/TypeDeclaration.cs @@ -47,7 +47,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// class Name<TypeParameters> : BaseTypes where Constraints; /// - public class TypeDeclaration : EntityDeclaration + [DecompilerAstNode(hasNullNode: false)] + public partial class TypeDeclaration : EntityDeclaration { public override NodeType NodeType { get { return NodeType.TypeDeclaration; } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/TypeParameterDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/TypeParameterDeclaration.cs index aa4ce4cf1..783e9dc4b 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/TypeParameterDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/TypeParameterDeclaration.cs @@ -27,7 +27,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// Note: mirroring the C# syntax, constraints are not part of the type parameter declaration, but belong /// to the parent type or method. /// - public class TypeParameterDeclaration : AstNode + [DecompilerAstNode(hasNullNode: false)] + public partial class TypeParameterDeclaration : AstNode { public static readonly Role AttributeRole = EntityDeclaration.AttributeRole; public static readonly TokenRole OutVarianceKeywordRole = new TokenRole("out"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/UsingAliasDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/UsingAliasDeclaration.cs index d56602b3c..73d4095a8 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/UsingAliasDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/UsingAliasDeclaration.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// using Alias = Import; /// - public class UsingAliasDeclaration : AstNode + [DecompilerAstNode(hasNullNode: false)] + public partial class UsingAliasDeclaration : AstNode { public static readonly TokenRole UsingKeywordRole = new TokenRole("using"); public static readonly Role AliasRole = new Role("Alias", Identifier.Null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/UsingDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/UsingDeclaration.cs index 6f0c0ccdd..4a390112f 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/UsingDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/GeneralScope/UsingDeclaration.cs @@ -32,7 +32,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// using Import; /// - public class UsingDeclaration : AstNode + [DecompilerAstNode(hasNullNode: false)] + public partial class UsingDeclaration : AstNode { public static readonly TokenRole UsingKeywordRole = new TokenRole("using"); public static readonly Role ImportRole = new Role("Import", AstType.Null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Identifier.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Identifier.cs index a698d9afc..5ebcabd3c 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Identifier.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Identifier.cs @@ -28,7 +28,8 @@ using System; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class Identifier : AstNode + [DecompilerAstNode(hasNullNode: true)] + public partial class Identifier : AstNode { public new static readonly Identifier Null = new NullIdentifier(); sealed class NullIdentifier : Identifier diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/InvocationAstType.cs b/ICSharpCode.Decompiler/CSharp/Syntax/InvocationAstType.cs index b3436438d..7c6eeb488 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/InvocationAstType.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/InvocationAstType.cs @@ -23,7 +23,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// BaseType "(" Argument { "," Argument } ")" /// - public class InvocationAstType : AstType + [DecompilerAstNode(hasNullNode: false)] + public partial class InvocationAstType : AstType { public AstNodeCollection Arguments { get { return GetChildrenByRole(Roles.Expression); } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/MemberType.cs b/ICSharpCode.Decompiler/CSharp/Syntax/MemberType.cs index ef175029a..059d7c0e3 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/MemberType.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/MemberType.cs @@ -28,7 +28,8 @@ using System.Collections.Generic; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class MemberType : AstType + [DecompilerAstNode(hasNullNode: false)] + public partial class MemberType : AstType { public static readonly Role TargetRole = new Role("Target", AstType.Null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/PrimitiveType.cs b/ICSharpCode.Decompiler/CSharp/Syntax/PrimitiveType.cs index 69e9b480d..781595765 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/PrimitiveType.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/PrimitiveType.cs @@ -31,7 +31,8 @@ using ICSharpCode.Decompiler.TypeSystem; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class PrimitiveType : AstType + [DecompilerAstNode(hasNullNode: false)] + public partial class PrimitiveType : AstType { TextLocation location; string keyword = string.Empty; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/SimpleType.cs b/ICSharpCode.Decompiler/CSharp/Syntax/SimpleType.cs index b1cbe7c2a..f283ffdd2 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/SimpleType.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/SimpleType.cs @@ -28,7 +28,8 @@ using System.Collections.Generic; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class SimpleType : AstType + [DecompilerAstNode(hasNullNode: true)] + public partial class SimpleType : AstType { #region Null public new static readonly SimpleType Null = new NullSimpleType(); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/BlockStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/BlockStatement.cs index a36e3f310..17caa7c8b 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/BlockStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/BlockStatement.cs @@ -31,7 +31,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// { Statements } /// - public class BlockStatement : Statement, IEnumerable + [DecompilerAstNode(hasNullNode: true, hasPatternPlaceholder: true)] + public partial class BlockStatement : Statement, IEnumerable { public static readonly Role StatementRole = new Role("Statement", Statement.Null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/BreakStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/BreakStatement.cs index 15b4c01cc..22f5e3675 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/BreakStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/BreakStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// break; /// - public class BreakStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class BreakStatement : Statement { public static readonly TokenRole BreakKeywordRole = new TokenRole("break"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/CheckedStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/CheckedStatement.cs index 109dbf27e..d6219b739 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/CheckedStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/CheckedStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// checked BodyBlock /// - public class CheckedStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class CheckedStatement : Statement { public static readonly TokenRole CheckedKeywordRole = new TokenRole("checked"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ContinueStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ContinueStatement.cs index bb8872c73..9b8948a74 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ContinueStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ContinueStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// continue; /// - public class ContinueStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class ContinueStatement : Statement { public static readonly TokenRole ContinueKeywordRole = new TokenRole("continue"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/DoWhileStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/DoWhileStatement.cs index 0e8c3f4b8..e61b32475 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/DoWhileStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/DoWhileStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// "do EmbeddedStatement while(Condition);" /// - public class DoWhileStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class DoWhileStatement : Statement { public static readonly TokenRole DoKeywordRole = new TokenRole("do"); public static readonly TokenRole WhileKeywordRole = new TokenRole("while"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/EmptyStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/EmptyStatement.cs index 47a035d37..c7f70a0fe 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/EmptyStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/EmptyStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// ; /// - public class EmptyStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class EmptyStatement : Statement { public TextLocation Location { get; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ExpressionStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ExpressionStatement.cs index 5d4e67685..dfb71e6f5 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ExpressionStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ExpressionStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Expression; /// - public class ExpressionStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class ExpressionStatement : Statement { public Expression Expression { get { return GetChildByRole(Roles.Expression); } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/FixedStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/FixedStatement.cs index 9ceb5e647..46c40ddf6 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/FixedStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/FixedStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// fixed (Type Variables) EmbeddedStatement /// - public class FixedStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class FixedStatement : Statement { public static readonly TokenRole FixedKeywordRole = new TokenRole("fixed"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ForStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ForStatement.cs index 6655cd86c..ba288c4c0 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ForStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ForStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// for (Initializers; Condition; Iterators) EmbeddedStatement /// - public class ForStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class ForStatement : Statement { public static readonly TokenRole ForKeywordRole = new TokenRole("for"); public readonly static Role InitializerRole = new Role("Initializer", Statement.Null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ForeachStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ForeachStatement.cs index 3e8d314e6..6d46a1a84 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ForeachStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ForeachStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// foreach (Type VariableName in InExpression) EmbeddedStatement /// - public class ForeachStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class ForeachStatement : Statement { public static readonly TokenRole AwaitRole = UnaryOperatorExpression.AwaitRole; public static readonly TokenRole ForeachKeywordRole = new TokenRole("foreach"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/GotoStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/GotoStatement.cs index feade0e24..c1de4b5bb 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/GotoStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/GotoStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// "goto Label;" /// - public class GotoStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class GotoStatement : Statement { public static readonly TokenRole GotoKeywordRole = new TokenRole("goto"); @@ -87,7 +88,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// or "goto case LabelExpression;" /// - public class GotoCaseStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class GotoCaseStatement : Statement { public static readonly TokenRole GotoKeywordRole = new TokenRole("goto"); public static readonly TokenRole CaseKeywordRole = new TokenRole("case"); @@ -137,7 +139,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// or "goto default;" /// - public class GotoDefaultStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class GotoDefaultStatement : Statement { public static readonly TokenRole GotoKeywordRole = new TokenRole("goto"); public static readonly TokenRole DefaultKeywordRole = new TokenRole("default"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/IfElseStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/IfElseStatement.cs index e1615aebd..d706a77a0 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/IfElseStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/IfElseStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// if (Condition) TrueStatement else FalseStatement /// - public class IfElseStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class IfElseStatement : Statement { public readonly static TokenRole IfKeywordRole = new TokenRole("if"); public readonly static Role ConditionRole = Roles.Condition; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LabelStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LabelStatement.cs index fa6392452..d21f5475c 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LabelStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LabelStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Label: /// - public class LabelStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class LabelStatement : Statement { public string Label { get { diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LocalFunctionDeclarationStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LocalFunctionDeclarationStatement.cs index dda899597..51b0788e8 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LocalFunctionDeclarationStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LocalFunctionDeclarationStatement.cs @@ -20,7 +20,8 @@ using ICSharpCode.Decompiler.CSharp.Syntax.PatternMatching; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class LocalFunctionDeclarationStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class LocalFunctionDeclarationStatement : Statement { public static readonly Role MethodDeclarationRole = new Role("Method", null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LockStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LockStatement.cs index 7c30ff6f8..bb414cbf5 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LockStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/LockStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// lock (Expression) EmbeddedStatement; /// - public class LockStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class LockStatement : Statement { public static readonly TokenRole LockKeywordRole = new TokenRole("lock"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ReturnStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ReturnStatement.cs index b26cfff29..4abeb4a32 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ReturnStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ReturnStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// return Expression; /// - public class ReturnStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class ReturnStatement : Statement { public static readonly TokenRole ReturnKeywordRole = new TokenRole("return"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/Statement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/Statement.cs index b278d1e3f..454177cd6 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/Statement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/Statement.cs @@ -27,7 +27,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// This class is useful even though it doesn't provide any additional functionality: /// It can be used to communicate more information in APIs, e.g. "this subnode will always be a statement" /// - public abstract class Statement : AstNode + [DecompilerAstNode(hasNullNode: true, hasPatternPlaceholder: true)] + public abstract partial class Statement : AstNode { #region Null public new static readonly Statement Null = new NullStatement(); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/SwitchStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/SwitchStatement.cs index 86c038a59..b2b552260 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/SwitchStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/SwitchStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// switch (Expression) { SwitchSections } /// - public class SwitchStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class SwitchStatement : Statement { public static readonly TokenRole SwitchKeywordRole = new TokenRole("switch"); public static readonly Role SwitchSectionRole = new Role("SwitchSection", null); @@ -85,7 +86,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } } - public class SwitchSection : AstNode + [DecompilerAstNode(hasNullNode: false, hasPatternPlaceholder: true)] + public partial class SwitchSection : AstNode { #region PatternPlaceholder public static implicit operator SwitchSection(PatternMatching.Pattern pattern) @@ -171,7 +173,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } } - public class CaseLabel : AstNode + [DecompilerAstNode(hasNullNode: false)] + public partial class CaseLabel : AstNode { public static readonly TokenRole CaseKeywordRole = new TokenRole("case"); public static readonly TokenRole DefaultKeywordRole = new TokenRole("default"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ThrowStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ThrowStatement.cs index bdc0d5cd8..2ca26f01a 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ThrowStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/ThrowStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// throw Expression; /// - public class ThrowStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class ThrowStatement : Statement { public static readonly TokenRole ThrowKeywordRole = new TokenRole("throw"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/TryCatchStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/TryCatchStatement.cs index 3f9d8aa69..7132261e0 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/TryCatchStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/TryCatchStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// try TryBlock CatchClauses finally FinallyBlock /// - public class TryCatchStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class TryCatchStatement : Statement { public static readonly TokenRole TryKeywordRole = new TokenRole("try"); public static readonly Role TryBlockRole = new Role("TryBlock", BlockStatement.Null); @@ -84,7 +85,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// catch (Type VariableName) { Body } /// - public class CatchClause : AstNode + [DecompilerAstNode(hasNullNode: true, hasPatternPlaceholder: true)] + public partial class CatchClause : AstNode { public static readonly TokenRole CatchKeywordRole = new TokenRole("catch"); public static readonly TokenRole WhenKeywordRole = new TokenRole("when"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UncheckedStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UncheckedStatement.cs index 08791d14c..957c57796 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UncheckedStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UncheckedStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// unchecked BodyBlock /// - public class UncheckedStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class UncheckedStatement : Statement { public static readonly TokenRole UncheckedKeywordRole = new TokenRole("unchecked"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UnsafeStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UnsafeStatement.cs index 45b3438dd..7206652d5 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UnsafeStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UnsafeStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// unsafe { Body } /// - public class UnsafeStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class UnsafeStatement : Statement { public static readonly TokenRole UnsafeKeywordRole = new TokenRole("unsafe"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UsingStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UsingStatement.cs index 2526a0842..86408ba16 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UsingStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/UsingStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// [ await ] using (ResourceAcquisition) EmbeddedStatement /// - public class UsingStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class UsingStatement : Statement { public static readonly TokenRole UsingKeywordRole = new TokenRole("using"); public static readonly TokenRole AwaitRole = UnaryOperatorExpression.AwaitRole; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/VariableDeclarationStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/VariableDeclarationStatement.cs index a67b09721..9a13ad757 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/VariableDeclarationStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/VariableDeclarationStatement.cs @@ -26,7 +26,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class VariableDeclarationStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class VariableDeclarationStatement : Statement { public static readonly Role ModifierRole = EntityDeclaration.ModifierRole; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/WhileStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/WhileStatement.cs index 23f11d1b0..ac6cc0430 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/WhileStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/WhileStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// "while (Condition) EmbeddedStatement" /// - public class WhileStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class WhileStatement : Statement { public static readonly TokenRole WhileKeywordRole = new TokenRole("while"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/YieldBreakStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/YieldBreakStatement.cs index 6c8633d1f..f9ff24f64 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/YieldBreakStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/YieldBreakStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// yield break; /// - public class YieldBreakStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class YieldBreakStatement : Statement { public static readonly TokenRole YieldKeywordRole = new TokenRole("yield"); public static readonly TokenRole BreakKeywordRole = new TokenRole("break"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/YieldReturnStatement.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/YieldReturnStatement.cs index 75255719b..cba0ad5da 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Statements/YieldReturnStatement.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Statements/YieldReturnStatement.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// yield return Expression; /// - public class YieldReturnStatement : Statement + [DecompilerAstNode(hasNullNode: false)] + public partial class YieldReturnStatement : Statement { public static readonly TokenRole YieldKeywordRole = new TokenRole("yield"); public static readonly TokenRole ReturnKeywordRole = new TokenRole("return"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/SyntaxTree.cs b/ICSharpCode.Decompiler/CSharp/Syntax/SyntaxTree.cs index 3d86bb345..e0b3f5982 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/SyntaxTree.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/SyntaxTree.cs @@ -31,7 +31,8 @@ using ICSharpCode.Decompiler.Util; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class SyntaxTree : AstNode + [DecompilerAstNode(hasNullNode: false)] + public partial class SyntaxTree : AstNode { public static readonly Role MemberRole = new Role("Member", AstNode.Null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TupleAstType.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TupleAstType.cs index fa9e9260c..b6e8c0bcd 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TupleAstType.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TupleAstType.cs @@ -20,7 +20,8 @@ using ICSharpCode.Decompiler.CSharp.Syntax.PatternMatching; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class TupleAstType : AstType + [DecompilerAstNode(hasNullNode: false)] + public partial class TupleAstType : AstType { public static readonly Role ElementRole = new Role("Element", TupleTypeElement.Null); @@ -49,7 +50,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } } - public class TupleTypeElement : AstNode + [DecompilerAstNode(hasNullNode: true)] + public partial class TupleTypeElement : AstNode { #region Null public new static readonly TupleTypeElement Null = new TupleTypeElement(); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/Accessor.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/Accessor.cs index 71c0fc55e..91442105a 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/Accessor.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/Accessor.cs @@ -31,7 +31,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// get/set/init/add/remove /// - public class Accessor : EntityDeclaration + [DecompilerAstNode(hasNullNode: true)] + public partial class Accessor : EntityDeclaration { public static readonly new Accessor Null = new NullAccessor(); sealed class NullAccessor : Accessor diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/ConstructorDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/ConstructorDeclaration.cs index 94a3d76e8..b78b13aed 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/ConstructorDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/ConstructorDeclaration.cs @@ -28,7 +28,8 @@ using ICSharpCode.Decompiler.TypeSystem; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class ConstructorDeclaration : EntityDeclaration + [DecompilerAstNode(hasNullNode: false)] + public partial class ConstructorDeclaration : EntityDeclaration { public static readonly Role InitializerRole = new Role("Initializer", ConstructorInitializer.Null); @@ -92,7 +93,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax This } - public class ConstructorInitializer : AstNode + [DecompilerAstNode(hasNullNode: true)] + public partial class ConstructorInitializer : AstNode { public static readonly TokenRole BaseKeywordRole = new TokenRole("base"); public static readonly TokenRole ThisKeywordRole = new TokenRole("this"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/DestructorDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/DestructorDeclaration.cs index 529ef1ba1..49322407a 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/DestructorDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/DestructorDeclaration.cs @@ -28,7 +28,8 @@ using ICSharpCode.Decompiler.TypeSystem; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class DestructorDeclaration : EntityDeclaration + [DecompilerAstNode(hasNullNode: false)] + public partial class DestructorDeclaration : EntityDeclaration { public static readonly TokenRole TildeRole = new TokenRole("~"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EnumMemberDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EnumMemberDeclaration.cs index df0346252..82ccc09c3 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EnumMemberDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EnumMemberDeclaration.cs @@ -28,7 +28,8 @@ using ICSharpCode.Decompiler.TypeSystem; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class EnumMemberDeclaration : EntityDeclaration + [DecompilerAstNode(hasNullNode: false)] + public partial class EnumMemberDeclaration : EntityDeclaration { public static readonly Role InitializerRole = new Role("Initializer", Expression.Null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EventDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EventDeclaration.cs index 55fa458b6..c9ab3e52d 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EventDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EventDeclaration.cs @@ -31,7 +31,8 @@ using ICSharpCode.Decompiler.TypeSystem; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class EventDeclaration : EntityDeclaration + [DecompilerAstNode(hasNullNode: false)] + public partial class EventDeclaration : EntityDeclaration { public static readonly TokenRole EventKeywordRole = new TokenRole("event"); @@ -84,7 +85,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } } - public class CustomEventDeclaration : EntityDeclaration + [DecompilerAstNode(hasNullNode: false)] + public partial class CustomEventDeclaration : EntityDeclaration { public static readonly TokenRole EventKeywordRole = new TokenRole("event"); public static readonly TokenRole AddKeywordRole = new TokenRole("add"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/ExtensionDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/ExtensionDeclaration.cs index 019fd4e74..3a7ee91e2 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/ExtensionDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/ExtensionDeclaration.cs @@ -20,7 +20,8 @@ using ICSharpCode.Decompiler.TypeSystem; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class ExtensionDeclaration : EntityDeclaration + [DecompilerAstNode(hasNullNode: false)] + public partial class ExtensionDeclaration : EntityDeclaration { public readonly static TokenRole ExtensionKeywordRole = new TokenRole("extension"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FieldDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FieldDeclaration.cs index 644f2c829..faf2a35a2 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FieldDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FieldDeclaration.cs @@ -31,7 +31,8 @@ using ICSharpCode.Decompiler.TypeSystem; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class FieldDeclaration : EntityDeclaration + [DecompilerAstNode(hasNullNode: false)] + public partial class FieldDeclaration : EntityDeclaration { public override SymbolKind SymbolKind { get { return SymbolKind.Field; } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FixedFieldDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FixedFieldDeclaration.cs index 18fffb175..2e6ea35f1 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FixedFieldDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FixedFieldDeclaration.cs @@ -27,7 +27,8 @@ using ICSharpCode.Decompiler.TypeSystem; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class FixedFieldDeclaration : EntityDeclaration + [DecompilerAstNode(hasNullNode: false)] + public partial class FixedFieldDeclaration : EntityDeclaration { public static readonly TokenRole FixedKeywordRole = new TokenRole("fixed"); public static readonly Role VariableRole = new Role("FixedVariable", null); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FixedVariableInitializer.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FixedVariableInitializer.cs index 111e45ad0..7486bf002 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FixedVariableInitializer.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/FixedVariableInitializer.cs @@ -29,7 +29,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Name [ CountExpression ] /// - public class FixedVariableInitializer : AstNode + [DecompilerAstNode(hasNullNode: false)] + public partial class FixedVariableInitializer : AstNode { public override NodeType NodeType { get { diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/IndexerDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/IndexerDeclaration.cs index 9ff71282e..b2f247cb8 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/IndexerDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/IndexerDeclaration.cs @@ -31,7 +31,8 @@ using ICSharpCode.Decompiler.TypeSystem; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class IndexerDeclaration : EntityDeclaration + [DecompilerAstNode(hasNullNode: false)] + public partial class IndexerDeclaration : EntityDeclaration { public static readonly TokenRole ThisKeywordRole = new TokenRole("this"); public static readonly Role GetterRole = PropertyDeclaration.GetterRole; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/MethodDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/MethodDeclaration.cs index 0016c421c..59ec66d1a 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/MethodDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/MethodDeclaration.cs @@ -28,7 +28,8 @@ using ICSharpCode.Decompiler.TypeSystem; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class MethodDeclaration : EntityDeclaration + [DecompilerAstNode(hasNullNode: false)] + public partial class MethodDeclaration : EntityDeclaration { public override SymbolKind SymbolKind { get { return SymbolKind.Method; } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/OperatorDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/OperatorDeclaration.cs index de2f6c501..79af9f4d6 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/OperatorDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/OperatorDeclaration.cs @@ -76,7 +76,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax CheckedExplicit } - public class OperatorDeclaration : EntityDeclaration + [DecompilerAstNode(hasNullNode: false)] + public partial class OperatorDeclaration : EntityDeclaration { public static readonly TokenRole OperatorKeywordRole = new TokenRole("operator"); public static readonly TokenRole CheckedKeywordRole = new TokenRole("checked"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/ParameterDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/ParameterDeclaration.cs index 9af73887f..2970f8bca 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/ParameterDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/ParameterDeclaration.cs @@ -30,7 +30,8 @@ using ICSharpCode.Decompiler.TypeSystem; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class ParameterDeclaration : AstNode + [DecompilerAstNode(hasNullNode: false, hasPatternPlaceholder: true)] + public partial class ParameterDeclaration : AstNode { public static readonly Role AttributeRole = EntityDeclaration.AttributeRole; public static readonly TokenRole ThisModifierRole = new TokenRole("this"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/PropertyDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/PropertyDeclaration.cs index 78d1be66d..50e40e697 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/PropertyDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/PropertyDeclaration.cs @@ -28,7 +28,8 @@ using ICSharpCode.Decompiler.TypeSystem; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class PropertyDeclaration : EntityDeclaration + [DecompilerAstNode(hasNullNode: false)] + public partial class PropertyDeclaration : EntityDeclaration { public static readonly TokenRole GetKeywordRole = new TokenRole("get"); public static readonly TokenRole SetKeywordRole = new TokenRole("set"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/VariableInitializer.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/VariableInitializer.cs index 99d75777d..8e9f8ffbf 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/VariableInitializer.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/VariableInitializer.cs @@ -26,7 +26,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax { - public class VariableInitializer : AstNode + [DecompilerAstNode(hasNullNode: true, hasPatternPlaceholder: true)] + public partial class VariableInitializer : AstNode { #region Null public new static readonly VariableInitializer Null = new NullVariableInitializer(); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/VariableDesignation.cs b/ICSharpCode.Decompiler/CSharp/Syntax/VariableDesignation.cs index 4bad6c233..e83aefdf2 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/VariableDesignation.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/VariableDesignation.cs @@ -20,7 +20,8 @@ using ICSharpCode.Decompiler.CSharp.Syntax.PatternMatching; namespace ICSharpCode.Decompiler.CSharp.Syntax { - public abstract class VariableDesignation : AstNode + [DecompilerAstNode(hasNullNode: true)] + public abstract partial class VariableDesignation : AstNode { public override NodeType NodeType => NodeType.Unknown; @@ -62,7 +63,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// Identifier /// - public class SingleVariableDesignation : VariableDesignation + [DecompilerAstNode(hasNullNode: false)] + public partial class SingleVariableDesignation : VariableDesignation { public string Identifier { @@ -99,7 +101,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax /// /// ( VariableDesignation (, VariableDesignation)* ) /// - public class ParenthesizedVariableDesignation : VariableDesignation + [DecompilerAstNode(hasNullNode: false)] + public partial class ParenthesizedVariableDesignation : VariableDesignation { public CSharpTokenNode LParToken { diff --git a/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj b/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj index 146f9b5a5..b7dcff801 100644 --- a/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj +++ b/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj @@ -105,6 +105,10 @@ + + + + @@ -118,6 +122,11 @@ + + True + True + Instructions.tt + @@ -238,9 +247,8 @@ - - + @@ -515,11 +523,6 @@ - - True - True - Instructions.tt - diff --git a/ILSpy.sln b/ILSpy.sln index 2cb248c06..8c0032716 100644 --- a/ILSpy.sln +++ b/ILSpy.sln @@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{F45DB999-7E7 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler", "ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj", "{984CC812-9470-4A13-AFF9-CC44068D666C}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler.Generators", "ICSharpCode.Decompiler.Generators\ICSharpCode.Decompiler.Generators.csproj", "{0792B524-622B-4B9D-8027-3531ED6A42EB}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler.Tests", "ICSharpCode.Decompiler.Tests\ICSharpCode.Decompiler.Tests.csproj", "{FEC0DA52-C4A6-4710-BE36-B484A20C5E22}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.ILSpyCmd", "ICSharpCode.ILSpyCmd\ICSharpCode.ILSpyCmd.csproj", "{743B439A-E7AD-4A0A-BAB6-222E1EA83C6D}" @@ -65,6 +67,18 @@ Global {984CC812-9470-4A13-AFF9-CC44068D666C}.Release|x64.Build.0 = Release|Any CPU {984CC812-9470-4A13-AFF9-CC44068D666C}.Release|x86.ActiveCfg = Release|Any CPU {984CC812-9470-4A13-AFF9-CC44068D666C}.Release|x86.Build.0 = Release|Any CPU + {0792B524-622B-4B9D-8027-3531ED6A42EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0792B524-622B-4B9D-8027-3531ED6A42EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0792B524-622B-4B9D-8027-3531ED6A42EB}.Debug|x64.ActiveCfg = Debug|Any CPU + {0792B524-622B-4B9D-8027-3531ED6A42EB}.Debug|x64.Build.0 = Debug|Any CPU + {0792B524-622B-4B9D-8027-3531ED6A42EB}.Debug|x86.ActiveCfg = Debug|Any CPU + {0792B524-622B-4B9D-8027-3531ED6A42EB}.Debug|x86.Build.0 = Debug|Any CPU + {0792B524-622B-4B9D-8027-3531ED6A42EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0792B524-622B-4B9D-8027-3531ED6A42EB}.Release|Any CPU.Build.0 = Release|Any CPU + {0792B524-622B-4B9D-8027-3531ED6A42EB}.Release|x64.ActiveCfg = Release|Any CPU + {0792B524-622B-4B9D-8027-3531ED6A42EB}.Release|x64.Build.0 = Release|Any CPU + {0792B524-622B-4B9D-8027-3531ED6A42EB}.Release|x86.ActiveCfg = Release|Any CPU + {0792B524-622B-4B9D-8027-3531ED6A42EB}.Release|x86.Build.0 = Release|Any CPU {FEC0DA52-C4A6-4710-BE36-B484A20C5E22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FEC0DA52-C4A6-4710-BE36-B484A20C5E22}.Debug|Any CPU.Build.0 = Debug|Any CPU {FEC0DA52-C4A6-4710-BE36-B484A20C5E22}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -201,7 +215,4 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {C764218F-7633-4412-923D-558CE7EE0560} - EndGlobalSection EndGlobal