Documentation Language: Swift

Structure

ATLCollectionExpression

Represents an ATL collection operation expression.

struct ATLCollectionExpression

Overview

Collection expressions handle OCL-style collection operations such as select, collect, exists, forAll, and other iterator-based operations on collections. They support both simple operations and complex iterator expressions.

Example Usage

// Simple collection operation
let sizeExpr = ATLCollectionExpression(
    source: ATLVariableExpression(name: "items"),
    operation: .size
)

// Iterator-based operation
let selectExpr = ATLCollectionExpression(
    source: ATLVariableExpression(name: "numbers"),
    operation: .select,
    iterator: "n",
    body: ATLBinaryExpression(
        left: ATLVariableExpression(name: "n"),
        operator: .greaterThan,
        right: ATLLiteralExpression(value: 0)
    )
)

Topics

Operators

Initializers

?
init(source:operation:iterator:body:)

Creates a new collection expression.

Instance Properties

V
body

The body expression for iterator-based operations.

V
iterator

The iterator variable name for operations that require one.

V
operation

The collection operation to perform.

V
source

The source collection expression.

Instance Methods

F
evaluate(in:)

Evaluates the expression within the specified execution context.

Default Implementations

Relationships

Conforms To

See Also

Expressions

P
ATLExpression

Protocol for ATL expressions that can be evaluated within transformation contexts.

S
ATLNavigationExpression

Represents property navigation expressions in ATL.

S
ATLLiteralExpression

Represents literal value expressions in ATL.