IfStatement

Overview

The IfStatement class represents a plain if <condition> then <statement> else <statement> statement. The compiler will eliminate the true or false branch if the value can be evaluated at compile-time in the case that branch could not be reached at runtime. For values, the IIfValue class can be used.

Location


 

constructor

Constructor that does not initialize any fields.

 

constructor

 

IfStatement()

 

init()

 

IfStatement()

 

Sub New()

constructor (Value, Statement)

Create a new if statement with only a true statement.

 

constructor(aCondition: Value; aTrueCode: Statement)

 

IfStatement(Value aCondition, Statement aTrueCode)

 

init(_ aCondition: Value, _ aTrueCode: Statement)

 

IfStatement(Value aCondition, Statement aTrueCode)

 

Sub New(aCondition As Value, aTrueCode As Statement)

Parameters:

  • aCondition: Condition
  • aTrueCode: Statement to execute if this condition is true

constructor (Value, Statement, Statement)

Initialize a new statement

 

constructor(aCondition: Value; aTrueCode: Statement; aFalseCode: Statement)

 

IfStatement(Value aCondition, Statement aTrueCode, Statement aFalseCode)

 

init(_ aCondition: Value, _ aTrueCode: Statement, _ aFalseCode: Statement)

 

IfStatement(Value aCondition, Statement aTrueCode, Statement aFalseCode)

 

Sub New(aCondition As Value, aTrueCode As Statement, aFalseCode As Statement)

Parameters:

  • aCondition: If condition
  • aTrueCode: Code to run if the condition is true
  • aFalseCode: Code to run if the condition is false

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.

Condition

Condition for this if

 

property Condition: Value read write;

 

Value Condition { get; set; }

 

var Condition: Value { get{} set{} }

 

Value Condition { __get; __set; }

 

Property Condition() As Value

FalseCode

Code to be executed when the condition is not met

 

property FalseCode: Statement read write;

 

Statement FalseCode { get; set; }

 

var FalseCode: Statement { get{} set{} }

 

Statement FalseCode { __get; __set; }

 

Property FalseCode() As Statement

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 (Boolean)

 

method SetOverflowCheckRecursive(aValue: Boolean)

 

void SetOverflowCheckRecursive(Boolean aValue)

 

func SetOverflowCheckRecursive(_ aValue: Boolean)

 

void SetOverflowCheckRecursive(Boolean aValue)

 

Sub SetOverflowCheckRecursive(aValue As Boolean)

Parameters:

  • aValue:

SetOverflowCheckRecursive (Boolean)    (declared in Statement)

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.

TrueCode

Code to be executed if the condition is met

 

property TrueCode: Statement read write;

 

Statement TrueCode { get; set; }

 

var TrueCode: Statement { get{} set{} }

 

Statement TrueCode { __get; __set; }

 

Property TrueCode() As Statement

 

Condition

Condition for this if

 

property Condition: Value read write;

 

Value Condition { get; set; }

 

var Condition: Value { get{} set{} }

 

Value Condition { __get; __set; }

 

Property Condition() As Value

FalseCode

Code to be executed when the condition is not met

 

property FalseCode: Statement read write;

 

Statement FalseCode { get; set; }

 

var FalseCode: Statement { get{} set{} }

 

Statement FalseCode { __get; __set; }

 

Property FalseCode() As Statement

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

TrueCode

Code to be executed if the condition is met

 

property TrueCode: Statement read write;

 

Statement TrueCode { get; set; }

 

var TrueCode: Statement { get{} set{} }

 

Statement TrueCode { __get; __set; }

 

Property TrueCode() As Statement

 

constructor

Constructor that does not initialize any fields.

 

constructor

 

IfStatement()

 

init()

 

IfStatement()

 

Sub New()

constructor (Value, Statement)

Create a new if statement with only a true statement.

 

constructor(aCondition: Value; aTrueCode: Statement)

 

IfStatement(Value aCondition, Statement aTrueCode)

 

init(_ aCondition: Value, _ aTrueCode: Statement)

 

IfStatement(Value aCondition, Statement aTrueCode)

 

Sub New(aCondition As Value, aTrueCode As Statement)

Parameters:

  • aCondition: Condition
  • aTrueCode: Statement to execute if this condition is true

constructor (Value, Statement, Statement)

Initialize a new statement

 

constructor(aCondition: Value; aTrueCode: Statement; aFalseCode: Statement)

 

IfStatement(Value aCondition, Statement aTrueCode, Statement aFalseCode)

 

init(_ aCondition: Value, _ aTrueCode: Statement, _ aFalseCode: Statement)

 

IfStatement(Value aCondition, Statement aTrueCode, Statement aFalseCode)

 

Sub New(aCondition As Value, aTrueCode As Statement, aFalseCode As Statement)

Parameters:

  • aCondition: If condition
  • aTrueCode: Code to run if the condition is true
  • aFalseCode: Code to run if the condition is false

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 (Boolean)

 

method SetOverflowCheckRecursive(aValue: Boolean)

 

void SetOverflowCheckRecursive(Boolean aValue)

 

func SetOverflowCheckRecursive(_ aValue: Boolean)

 

void SetOverflowCheckRecursive(Boolean aValue)

 

Sub SetOverflowCheckRecursive(aValue As Boolean)

Parameters:

  • aValue:

SetOverflowCheckRecursive (Boolean)    (declared in Statement)

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.