CaseStatement

Overview

CaseStatement is the class used to represent Oxygene Case Statements. To construct an instance of this class, create 1 or more instances of the CaseItem, one for each statement in the case statement, and optionally create a statement that runs when none of the values match, the else statement.

Location





 


constructor

Constructor that does not initialize any fields.



 

constructor


 

CaseStatement()


 

init()


 

CaseStatement()


 

Sub New()


constructor (Value, Statement, array of CaseItem)

Initialize this case statement with no values



 

constructor(aWhat: Value; aElse: Statement := nil; params aItems: array of CaseItem)


 

CaseStatement(Value aWhat, Statement aElse = null, params CaseItem[] aItems)


 

init( aWhat: Value,  aElse: Statement = nil, _ aItems: CaseItem...)


 

CaseStatement(Value aWhat, Statement aElse, CaseItem[]... aItems)


 

Sub New(aWhat As Value, aElse As Statement = Null, ParamArray aItems As CaseItem())

Parameters:

  • aWhat: Case "condition" value
  • aElse: statement if none other hits.
  • aItems: Case items to add.

BuildStatement

Converts a statement to a string.



 

method BuildStatement(anIndent: Int32; sb: StringBuilder)


 

void BuildStatement(Int32 anIndent, StringBuilder sb)


 

func BuildStatement( anIndent: Int32,  sb: StringBuilder)


 

void BuildStatement(Int32 anIndent, StringBuilder sb)


 

Sub BuildStatement(anIndent As Int32, sb As StringBuilder)

Parameters:

  • anIndent: The nr of spaces to place before the start of this statement.
  • sb: Output string builder.

Else

Else statement, if nothing matches this will be called



 

property Else: Statement read write;


 

Statement Else { get; set; }


 

var Else: Statement { get{} set{} }


 

Statement Else { get; set; }


 

Property Else() As Statement


Items

List with all the items in them



 

property Items: List<CaseItem> read;


 

List<CaseItem> Items { get; }


 

var Items: List<CaseItem> { get{} }


 

List<CaseItem> Items { __get; }


 

ReadOnly Property Items() As List<CaseItem>


Kind

Returns what kind of statement this is; this can be used to find out if a statement is of a specific type without having to check all possible casts



 

property Kind: StatementKind read;


 

StatementKind Kind { get; }


 

var Kind: StatementKind { get{} }


 

StatementKind Kind { __get; }


 

ReadOnly Property Kind() As StatementKind


OverflowCheck    (declared in Statement)

Overflow checking for binary and unary operations in this statement



 

property OverflowCheck: Boolean read write;


 

Boolean OverflowCheck { get; set; }


 

var OverflowCheck: Boolean { get{} set{} }


 

Boolean OverflowCheck { get; set; }


 

Property OverflowCheck() As Boolean


Position    (declared in Statement)

Position this statement is defined at



 

property Position: IPosition read write;


 

IPosition Position { get; set; }


 

var Position: IPosition { get{} set{} }


 

IPosition Position { get; set; }


 

Property Position() As IPosition


SetOverflowCheckRecursive

Recursively sets the OverflowCheck flag



 

method SetOverflowCheckRecursive(value: Boolean)


 

void SetOverflowCheckRecursive(Boolean value)


 

func SetOverflowCheckRecursive(_ value: Boolean)


 

void SetOverflowCheckRecursive(Boolean value)


 

Sub SetOverflowCheckRecursive(value As Boolean)

Parameters:

  • value: new value

ToString    (declared in Statement)

Returns this statement as a string



 

method ToString: String


 

String ToString()


 

func ToString() -> String


 

String ToString()


 

Function ToString() As String


ToValue

Converts this statement to a value tree that creates these statements



 

method ToValue(aServicesParameter: Value; aServices: IServices): Value


 

Value ToValue(Value aServicesParameter, IServices aServices)


 

func ToValue( aServicesParameter: Value,  aServices: IServices) -> Value


 

Value ToValue(Value aServicesParameter, IServices aServices)


 

Function ToValue(aServicesParameter As Value, aServices As IServices) As Value

Parameters:

  • aServicesParameter: the value that contains where aServices is stored
  • aServices: Actual services instance.

What

Value to base the case statement on



 

property What: Value read write;


 

Value What { get; set; }


 

var What: Value { get{} set{} }


 

Value What { get; set; }


 

Property What() As Value



 


Else

Else statement, if nothing matches this will be called



 

property Else: Statement read write;


 

Statement Else { get; set; }


 

var Else: Statement { get{} set{} }


 

Statement Else { get; set; }


 

Property Else() As Statement


Items

List with all the items in them



 

property Items: List<CaseItem> read;


 

List<CaseItem> Items { get; }


 

var Items: List<CaseItem> { get{} }


 

List<CaseItem> Items { __get; }


 

ReadOnly Property Items() As List<CaseItem>


Kind

Returns what kind of statement this is; this can be used to find out if a statement is of a specific type without having to check all possible casts



 

property Kind: StatementKind read;


 

StatementKind Kind { get; }


 

var Kind: StatementKind { get{} }


 

StatementKind Kind { __get; }


 

ReadOnly Property Kind() As StatementKind


OverflowCheck    (declared in Statement)

Overflow checking for binary and unary operations in this statement



 

property OverflowCheck: Boolean read write;


 

Boolean OverflowCheck { get; set; }


 

var OverflowCheck: Boolean { get{} set{} }


 

Boolean OverflowCheck { get; set; }


 

Property OverflowCheck() As Boolean


Position    (declared in Statement)

Position this statement is defined at



 

property Position: IPosition read write;


 

IPosition Position { get; set; }


 

var Position: IPosition { get{} set{} }


 

IPosition Position { get; set; }


 

Property Position() As IPosition


What

Value to base the case statement on



 

property What: Value read write;


 

Value What { get; set; }


 

var What: Value { get{} set{} }


 

Value What { get; set; }


 

Property What() As Value


 


constructor

Constructor that does not initialize any fields.



 

constructor


 

CaseStatement()


 

init()


 

CaseStatement()


 

Sub New()


constructor (Value, Statement, array of CaseItem)

Initialize this case statement with no values



 

constructor(aWhat: Value; aElse: Statement := nil; params aItems: array of CaseItem)


 

CaseStatement(Value aWhat, Statement aElse = null, params CaseItem[] aItems)


 

init( aWhat: Value,  aElse: Statement = nil, _ aItems: CaseItem...)


 

CaseStatement(Value aWhat, Statement aElse, CaseItem[]... aItems)


 

Sub New(aWhat As Value, aElse As Statement = Null, ParamArray aItems As CaseItem())

Parameters:

  • aWhat: Case "condition" value
  • aElse: statement if none other hits.
  • aItems: Case items to add.

BuildStatement

Converts a statement to a string.



 

method BuildStatement(anIndent: Int32; sb: StringBuilder)


 

void BuildStatement(Int32 anIndent, StringBuilder sb)


 

func BuildStatement( anIndent: Int32,  sb: StringBuilder)


 

void BuildStatement(Int32 anIndent, StringBuilder sb)


 

Sub BuildStatement(anIndent As Int32, sb As StringBuilder)

Parameters:

  • anIndent: The nr of spaces to place before the start of this statement.
  • sb: Output string builder.

SetOverflowCheckRecursive

Recursively sets the OverflowCheck flag



 

method SetOverflowCheckRecursive(value: Boolean)


 

void SetOverflowCheckRecursive(Boolean value)


 

func SetOverflowCheckRecursive(_ value: Boolean)


 

void SetOverflowCheckRecursive(Boolean value)


 

Sub SetOverflowCheckRecursive(value As Boolean)

Parameters:

  • value: new value

ToString    (declared in Statement)

Returns this statement as a string



 

method ToString: String


 

String ToString()


 

func ToString() -> String


 

String ToString()


 

Function ToString() As String


ToValue

Converts this statement to a value tree that creates these statements



 

method ToValue(aServicesParameter: Value; aServices: IServices): Value


 

Value ToValue(Value aServicesParameter, IServices aServices)


 

func ToValue( aServicesParameter: Value,  aServices: IServices) -> Value


 

Value ToValue(Value aServicesParameter, IServices aServices)


 

Function ToValue(aServicesParameter As Value, aServices As IServices) As Value

Parameters:

  • aServicesParameter: the value that contains where aServices is stored
  • aServices: Actual services instance.