CxVariable

Description

sealed class Tinman.Core.Cx.CxVariable

Represents a variable declaration (no value) or definition (with value):

int a
int a = 1

ICxTypeContainer.Type returns the variable type.

Public / Constructors

Cx​Variable


public constructor CxVariable → (3)

name in : CxId

See ICxIdContainer.Name.

type in : CxType

[not-null]
See ICxTypeContainer.Type.

value opt : CxExpression = null

See ICxTypeContainer.Type.

Creates a new instance of CxVariable.

Public / Methods

To​Declaration


public method ToDeclaration → ()

returns → CxVariable

The variable declaration (may be equal to this).

Converts this CxVariable to a variable declaration.

To​Definition


public method ToDefinition → (1)

value in : CxExpression

[not-null]
See Value.

returns → CxVariable

The variable definition.

Converts this CxVariable to a variable definition.

Public / Attributes

Is​Declaration


[Constant]
public attribute IsDeclaration → (get)

value : bool

true if this is a declaration, false if it is a definition.

Is this a variable declaration (no value)?

Is​Definition


[Constant]
public attribute IsDefinition → (get)

value : bool

true if this is a definition, false if it is a declaration.

Is this a variable declaration (with value)?

Value


[Constant]
public attribute Value → (get)

value : CxExpression

The initial variable value or null if the variable does not have an initial value.

Returns the initial variable value.