C# Class Mono.CSharp.Switch

Inheritance: Statement
ファイルを表示 Open project: kumpera/mono Class Usage Examples

Public Properties

Property Type Description
Elements SwitchLabel>.IDictionary
Expr Mono.CSharp.Expression
Sections List
SwitchType System.TypeSpec

Public Methods

Method Description
DoEmitStringSwitch ( LocalTemporary value, EmitContext ec ) : void
EmitObjectInteger ( EmitContext ec, object k ) : void
Reset ( ) : void
Resolve ( BlockContext ec ) : bool
ResolveStringSwitchMap ( ResolveContext ec ) : void
Switch ( Mono.CSharp.Expression e, ExplicitBlock block, List sects, Mono.CSharp.Location l ) : System
TableSwitchEmit ( EmitContext ec, Mono.CSharp.Expression val ) : void

This method emits code for a lookup-based switch statement (non-string) Basically it groups the cases into blocks that are at least half full, and then spits out individual lookup opcodes for each block. It emits the longest blocks first, and short blocks are just handled with direct compares.

Protected Methods

Method Description
CloneTo ( CloneContext clonectx, Statement t ) : void
DoEmit ( EmitContext ec ) : void

Private Methods

Method Description
CheckSwitch ( ResolveContext ec ) : bool
FindSection ( SwitchLabel label ) : SwitchSection
SwitchGoverningType ( ResolveContext ec, Mono.CSharp.Expression expr ) : Mono.CSharp.Expression

Method Details

CloneTo() protected method

protected CloneTo ( CloneContext clonectx, Statement t ) : void
clonectx CloneContext
t Statement
return void

DoEmit() protected method

protected DoEmit ( EmitContext ec ) : void
ec EmitContext
return void

DoEmitStringSwitch() public method

public DoEmitStringSwitch ( LocalTemporary value, EmitContext ec ) : void
value LocalTemporary
ec EmitContext
return void

EmitObjectInteger() public method

public EmitObjectInteger ( EmitContext ec, object k ) : void
ec EmitContext
k object
return void

Reset() public static method

public static Reset ( ) : void
return void

Resolve() public method

public Resolve ( BlockContext ec ) : bool
ec BlockContext
return bool

ResolveStringSwitchMap() public method

public ResolveStringSwitchMap ( ResolveContext ec ) : void
ec ResolveContext
return void

Switch() public method

public Switch ( Mono.CSharp.Expression e, ExplicitBlock block, List sects, Mono.CSharp.Location l ) : System
e Mono.CSharp.Expression
block ExplicitBlock
sects List
l Mono.CSharp.Location
return System

TableSwitchEmit() public method

This method emits code for a lookup-based switch statement (non-string) Basically it groups the cases into blocks that are at least half full, and then spits out individual lookup opcodes for each block. It emits the longest blocks first, and short blocks are just handled with direct compares.
public TableSwitchEmit ( EmitContext ec, Mono.CSharp.Expression val ) : void
ec EmitContext
val Mono.CSharp.Expression
return void

Property Details

Elements public_oe property

Maps constants whose type type SwitchType to their SwitchLabels.
public IDictionary Elements
return SwitchLabel>.IDictionary

Expr public_oe property

public Expression,Mono.CSharp Expr
return Mono.CSharp.Expression

Sections public_oe property

public List Sections
return List

SwitchType public_oe property

The governing switch type
public TypeSpec,System SwitchType
return System.TypeSpec