Table of Contents

Class IfElseStatement

Namespace
ICSharpCode.Decompiler.CSharp.Syntax
Assembly
ICSharpCode.Decompiler.dll

if (Condition) TrueStatement else FalseStatement

public class IfElseStatement : Statement, IAnnotatable, IFreezable, INode, ICloneable
Inheritance
IfElseStatement
Implements
Inherited Members
Extension Methods

Constructors

IfElseStatement()

public IfElseStatement()

IfElseStatement(Expression, Statement, Statement)

public IfElseStatement(Expression condition, Statement trueStatement, Statement falseStatement = null)

Parameters

condition Expression
trueStatement Statement
falseStatement Statement

Fields

ConditionRole

public static readonly Role<Expression> ConditionRole

Field Value

Role<Expression>

ElseKeywordRole

public static readonly TokenRole ElseKeywordRole

Field Value

TokenRole

FalseRole

public static readonly Role<Statement> FalseRole

Field Value

Role<Statement>

IfKeywordRole

public static readonly TokenRole IfKeywordRole

Field Value

TokenRole

TrueRole

public static readonly Role<Statement> TrueRole

Field Value

Role<Statement>

Properties

Condition

public Expression Condition { get; set; }

Property Value

Expression

ElseToken

public CSharpTokenNode ElseToken { get; }

Property Value

CSharpTokenNode

FalseStatement

public Statement FalseStatement { get; set; }

Property Value

Statement

IfToken

public CSharpTokenNode IfToken { get; }

Property Value

CSharpTokenNode

LParToken

public CSharpTokenNode LParToken { get; }

Property Value

CSharpTokenNode

RParToken

public CSharpTokenNode RParToken { get; }

Property Value

CSharpTokenNode

TrueStatement

public Statement TrueStatement { get; set; }

Property Value

Statement

Methods

AcceptVisitor(IAstVisitor)

public override void AcceptVisitor(IAstVisitor visitor)

Parameters

visitor IAstVisitor

AcceptVisitor<T>(IAstVisitor<T>)

public override T AcceptVisitor<T>(IAstVisitor<T> visitor)

Parameters

visitor IAstVisitor<T>

Returns

T

Type Parameters

T

AcceptVisitor<T, S>(IAstVisitor<T, S>, T)

public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)

Parameters

visitor IAstVisitor<T, S>
data T

Returns

S

Type Parameters

T
S

DoMatch(AstNode, Match)

protected override bool DoMatch(AstNode other, Match match)

Parameters

other AstNode
match Match

Returns

bool