Table of Contents

Namespace ICSharpCode.Decompiler.CSharp.Syntax

Classes

AbstractAnnotatable

Base class used to implement the IAnnotatable interface. This implementation is thread-safe.

Accessor

get/set/init/add/remove

AnonymousMethodExpression

[async] delegate(Parameters) {Body}

AnonymousTypeCreateExpression

new { [ExpressionList] }

ArrayCreateExpression

new Type[Dimensions]

ArrayInitializerExpression

{ Elements }

ArraySpecifier

[,,,]

AsExpression

Expression as TypeReference

AssignmentExpression

Left Operator= Right

AstNode
AstNodeCollection<T>

Represents the children of an AstNode that have a specific role.

AstType

A type reference in the C# AST.

Attribute

Attribute(Arguments)

AttributeSection

[AttributeTarget: Attributes]

BaseReferenceExpression

base

BinaryOperatorExpression

Left Operator Right

BlockStatement

{ Statements }

BreakStatement

break;

CSharpModifierToken
CSharpTokenNode

Represents a token in C#. Note that the type of the token is defined through the TokenRole.

CaseLabel
CastExpression

(CastTo)Expression

CatchClause

catch (Type VariableName) { Body }

CheckedExpression

checked(Expression)

CheckedStatement

checked BodyBlock

Comment
ComposedType
ConditionalExpression

Condition ? TrueExpression : FalseExpression

Constraint

where TypeParameter : BaseTypes

ConstructorDeclaration
ConstructorInitializer
ContinueStatement

continue;

CustomEventDeclaration
DeclarationExpression

TypeName VariableDesignation

DefaultValueExpression

default(Type)

DelegateDeclaration

delegate ReturnType Name<TypeParameters>(Parameters) where Constraints;

DepthFirstAstVisitor

AST visitor with a default implementation that visits all node depth-first.

DepthFirstAstVisitor<T>

AST visitor with a default implementation that visits all node depth-first.

DepthFirstAstVisitor<T, S>

AST visitor with a default implementation that visits all node depth-first.

DestructorDeclaration
DirectionExpression

ref Expression

DoWhileStatement

"do EmbeddedStatement while(Condition);"

DocumentationReference

Represents a 'cref' reference in XML documentation.

EmptyStatement

;

EntityDeclaration
EnumMemberDeclaration
ErrorExpression
EventDeclaration
Expression

Base class for expressions.

ExpressionStatement

Expression;

ExternAliasDeclaration

extern alias IDENTIFIER;

FieldDeclaration
FixedFieldDeclaration
FixedStatement

fixed (Type Variables) EmbeddedStatement

FixedVariableInitializer

Name [ CountExpression ]

ForStatement

for (Initializers; Condition; Iterators) EmbeddedStatement

ForeachStatement

foreach (Type VariableName in InExpression) EmbeddedStatement

FunctionPointerAstType
GotoCaseStatement

or "goto case LabelExpression;"

GotoDefaultStatement

or "goto default;"

GotoStatement

"goto Label;"

Identifier
IdentifierExpression
IdentifierExpressionBackreference

Matches identifier expressions that have the same identifier as the referenced variable/type definition/method definition.

IfElseStatement

if (Condition) TrueStatement else FalseStatement

IndexerDeclaration
IndexerExpression

Target[Arguments]

InterpolatedStringContent
InterpolatedStringExpression
InterpolatedStringText
Interpolation

{ Expression , Alignment : Suffix }

InvocationAstType

BaseType "(" Argument { "," Argument } ")"

InvocationExpression

Target(Arguments)

IsExpression

Expression is Type

LabelStatement

Label:

LambdaExpression

[async] Parameters => Body

LinePreprocessorDirective
LocalFunctionDeclarationStatement
LockStatement

lock (Expression) EmbeddedStatement;

MemberReferenceExpression

Target.MemberName

MemberType
MethodDeclaration
NamedArgumentExpression

Represents a named argument passed to a method or attribute. name: expression

NamedExpression

name = expression 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)].

NamespaceDeclaration

namespace Name { Members }

NullReferenceExpression

null

ObjectCreateExpression

new Type(Arguments) { Initializer }

OperatorDeclaration
OutVarDeclarationExpression

out type expression

ParameterDeclaration
ParenthesizedExpression

( Expression )

ParenthesizedVariableDesignation

( VariableDesignation (, VariableDesignation)* )

PointerReferenceExpression

Target->MemberName

PragmaWarningPreprocessorDirective
PreProcessorDirective
PrimitiveExpression

Represents a literal value.

PrimitiveType
PropertyDeclaration
QueryClause
QueryContinuationClause

Represents a query continuation. "(from .. select ..) into Identifier" or "(from .. group .. by ..) into Identifier" Note that "join .. into .." is not a query continuation!

This is always the first(!!) clause in a query expression. The tree for "from a in b select c into d select e" looks like this: new QueryExpression { new QueryContinuationClause { PrecedingQuery = new QueryExpression { new QueryFromClause(a in b), new QuerySelectClause(c) }, Identifier = d }, new QuerySelectClause(e) }

QueryExpression
QueryFromClause
QueryGroupClause
QueryJoinClause

Represents a join or group join clause.

QueryLetClause
QueryOrderClause
QueryOrdering
QuerySelectClause
QueryWhereClause
RecursivePatternExpression
ReturnStatement

return Expression;

Role

Represents the role a node plays within its parent.

Role<T>

Represents the role a node plays within its parent. All nodes with this role have type T.

Roles
SimpleType
SingleVariableDesignation

Identifier

SizeOfExpression

sizeof(Type)

StackAllocExpression

stackalloc Type[Count]

Statement

Base class for statements.

SwitchExpression

Expression switch { SwitchSections }

SwitchExpressionSection

Pattern => Expression

SwitchSection
SwitchStatement

switch (Expression) { SwitchSections }

SyntaxExtensions

Extension methods for the syntax tree.

SyntaxTree
TextLocationConverter
ThisReferenceExpression

this

ThrowExpression

throw Expression

ThrowStatement

throw Expression;

TokenRole

A specific role only used for C# tokens

TryCatchStatement

try TryBlock CatchClauses finally FinallyBlock

TupleAstType
TupleExpression
TupleTypeElement
TypeDeclaration

class Name<TypeParameters> : BaseTypes where Constraints;

TypeOfExpression

typeof(Type)

TypeParameterDeclaration

[in|out] Name

Represents a type parameter. Note: mirroring the C# syntax, constraints are not part of the type parameter declaration, but belong to the parent type or method.

TypeReferenceExpression

Represents an AstType as an expression. This is used when calling a method on a primitive type: "int.Parse()"

TypeSystemAstBuilder

Converts from type system to the C# AST.

UnaryOperatorExpression

Operator Expression

UncheckedExpression

unchecked(Expression)

UncheckedStatement

unchecked BodyBlock

UndocumentedExpression

Represents undocumented expressions.

UnsafeStatement

unsafe { Body }

UsingAliasDeclaration

using Alias = Import;

UsingDeclaration

using Import;

UsingStatement

[ await ] using (ResourceAcquisition) EmbeddedStatement

VariableDeclarationStatement
VariableDesignation
VariableInitializer
WhileStatement

"while (Condition) EmbeddedStatement"

WithInitializerExpression

Expression with Initializer

YieldBreakStatement

yield break;

YieldReturnStatement

yield return Expression;

Structs

TextLocation

A line/column position. Text editor lines/columns are counted started from one.

Interfaces

IAnnotatable

Provides an interface to handle annotations in an object.

IAstVisitor

AST visitor.

IAstVisitor<S>

AST visitor.

IAstVisitor<T, S>

AST visitor.

Enums

AssignmentOperatorType
BinaryOperatorType
ClassType
CommentType
ConstructorInitializerType
FieldDirection
LiteralFormat

Form of a C# literal.

Modifiers
NodeType
OperatorType
ParameterModifier
PreProcessorDirectiveType
QueryOrderingDirection
UnaryOperatorType
UndocumentedExpressionType