WithStatement

Overview

A with statement evaluates the value passed and stores it in the local it creates as part of the with statement. The WithItem class offers an option called "Matching". When this is true, it checks if the value is <> nil, if it is, it won't execute the body.

Location


 

constructor

Initialize an empty with statement

 

constructor

 

WithStatement()

 

init()

 

WithStatement()

 

Sub New()

constructor (Statement, array of WithItem)

Initialize a new with statement

 

constructor(aBody: Statement; params aItems: array of WithItem)

 

WithStatement(Statement aBody, params WithItem[] aItems)

 

init(_ aBody: Statement, _ aItems: WithItem...)

 

WithStatement(Statement aBody, WithItem[]... aItems)

 

Sub New(aBody As Statement, ParamArray aItems As WithItem())

Parameters:

  • aBody: Body for this with
  • aItems: with items

constructor (String, IType, Value, Statement)

Initialize a new with statement

 

constructor(aName: String; aType: IType; aValue: Value; aBody: Statement)

 

WithStatement(String aName, IType aType, Value aValue, Statement aBody)

 

init(_ aName: String, _ aType: IType, _ aValue: Value, _ aBody: Statement)

 

WithStatement(String aName, IType aType, Value aValue, Statement aBody)

 

Sub New(aName As String, aType As IType, aValue As Value, aBody As Statement)

Parameters:

  • aName: name of the item to add
  • aType: type of the item to add
  • aValue: value of the item to add
  • aBody: Body for this with

Body

Body of the with statement

 

property Body: Statement read write;

 

Statement Body { get; set; }

 

var Body: Statement { get{} set{} }

 

Statement Body { __get; __set; }

 

Property Body() As Statement

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.

Items

List of items in the with

 

property Items: List<WithItem> read;

 

List<WithItem> Items { get; }

 

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

 

List<WithItem> Items { __get; }

 

ReadOnly Property Items() As List<WithItem>

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.

 

Body

Body of the with statement

 

property Body: Statement read write;

 

Statement Body { get; set; }

 

var Body: Statement { get{} set{} }

 

Statement Body { __get; __set; }

 

Property Body() As Statement

Items

List of items in the with

 

property Items: List<WithItem> read;

 

List<WithItem> Items { get; }

 

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

 

List<WithItem> Items { __get; }

 

ReadOnly Property Items() As List<WithItem>

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

 

constructor

Initialize an empty with statement

 

constructor

 

WithStatement()

 

init()

 

WithStatement()

 

Sub New()

constructor (Statement, array of WithItem)

Initialize a new with statement

 

constructor(aBody: Statement; params aItems: array of WithItem)

 

WithStatement(Statement aBody, params WithItem[] aItems)

 

init(_ aBody: Statement, _ aItems: WithItem...)

 

WithStatement(Statement aBody, WithItem[]... aItems)

 

Sub New(aBody As Statement, ParamArray aItems As WithItem())

Parameters:

  • aBody: Body for this with
  • aItems: with items

constructor (String, IType, Value, Statement)

Initialize a new with statement

 

constructor(aName: String; aType: IType; aValue: Value; aBody: Statement)

 

WithStatement(String aName, IType aType, Value aValue, Statement aBody)

 

init(_ aName: String, _ aType: IType, _ aValue: Value, _ aBody: Statement)

 

WithStatement(String aName, IType aType, Value aValue, Statement aBody)

 

Sub New(aName As String, aType As IType, aValue As Value, aBody As Statement)

Parameters:

  • aName: name of the item to add
  • aType: type of the item to add
  • aValue: value of the item to add
  • aBody: Body for this with

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.