Structure
MTLExpression
A thin wrapper around AQL expressions for MTL template evaluation.
struct MTLExpression
Overview
MTL expressions delegate all evaluation to the Acceleo Query Language (AQL), which provides a rich expression system for model navigation, collection operations, and standard library functions.
Overview
MTL uses AQL for all expression evaluation, including:
-
Model navigation (e.g.,
object.property,object.reference) -
Collection operations (e.g.,
collection->select(),collection->collect()) -
Arithmetic and logical operations
-
String manipulation and interpolation
-
Type checking and casting
Example Usage
// Literal expression
let literalExpr = MTLExpression(AQLLiteralExpression(value: "Hello"))
// Variable reference
let varExpr = MTLExpression(AQLVariableExpression(name: "model"))
// Navigation
let sourceExpr = MTLExpression(AQLVariableExpression(name: "element"))
let navExpr = MTLExpression(AQLNavigationExpression(
source: sourceExpr.aqlExpression,
property: "name"
))
// String interpolation
let interpolExpr = MTLExpression(AQLStringInterpolationExpression(
parts: [
AQLStringInterpolationExpression.Part(literal: "Name: "),
AQLStringInterpolationExpression.Part(literal: "", expression: navExpr.aqlExpression)
]
))
Topics
Operators
Compares two MTL expressions for equality.
Initializers
Creates a new MTL expression wrapping an AQL expression.
Instance Properties
The underlying AQL expression that will be evaluated.
Instance Methods
Evaluates the expression within the specified MTL execution context.
Hashes the essential components of the expression into the given hasher.