ShakeVariableDeclaration

Represents a variable declaration in the Shake language. A variable declaration is a statement that declares a new variable, optionally initializing it with a value.

Since

0.1.0

Inheritors

Properties

Link copied to clipboard
abstract override val actualType: ShakeType

The actual type of the variable.

Link copied to clipboard
abstract override val actualValue: ShakeValue?

The actual value of the variable.

Link copied to clipboard
abstract val initialValue: ShakeValue?

The initial value assigned to the variable at the time of declaration, if any.

Link copied to clipboard
abstract val isFinal: Boolean

Indicates whether the variable is declared as final (i.e., its value cannot be changed once initialized).

Link copied to clipboard
abstract val name: String

The name of the declaration.

Link copied to clipboard
abstract val qualifiedName: String

The fully qualified name of the declaration, including its scope and namespace.

Link copied to clipboard
abstract val scope: ShakeScope

The scope in which the variable is declared.

Link copied to clipboard
abstract val type: ShakeType

The declared type of the assignable entity.

Link copied to clipboard
open override val uniqueName: String

The unique name of the variable, combining the variable's name and the unique name of its scope.

Functions

Link copied to clipboard

Performs addition assignment on this entity's type.

Link copied to clipboard
open fun assignType(other: ShakeType, scope: ShakeScope): ShakeType?

Assigns a type to this entity.

Link copied to clipboard

Handles the type after decrement operation.

Link copied to clipboard

Handles the type before decrement operation.

Link copied to clipboard

Performs division assignment on this entity's type.

Link copied to clipboard

Handles the type after increment operation.

Link copied to clipboard

Handles the type before increment operation.

Link copied to clipboard
open fun modulusAssignType(other: ShakeType, scope: ShakeScope): ShakeType?

Performs modulus assignment on this entity's type.

Link copied to clipboard

Performs multiplication assignment on this entity's type.

Link copied to clipboard
open fun powerAssignType(other: ShakeType, scope: ShakeScope): ShakeType?

Performs power assignment on this entity's type.

Link copied to clipboard

Performs subtraction assignment on this entity's type.

Link copied to clipboard
abstract fun toJson(): Map<String, Any?>

Converts the declaration to a JSON representation. Useful for serialization or debugging purposes.

Link copied to clipboard
abstract fun valueCompatible(value: ShakeValue): Boolean

Checks if the provided value is compatible with the variable's type.