Documentation
Language: Swift
MTL
Essentials
Getting Started with MTL
Understanding MTL
Execution
C
MTLExecutionContext
Initializers
M
init(module: MTLModule, generationStrategy: any MTLGenerationStrategy, aqlContext: AQLExecutionContext?, protectedAreaManager: MTLProtectedAreaManager?)
Instance Properties
P
var currentIndentation: MTLIndentation
P
var debug: Bool
P
let module: MTLModule
P
var protectedAreas: MTLProtectedAreaManager
Instance Methods
M
func addTraceLink(source: any EObject, target: String)
M
func closeFile() async throws
M
func debugSummary() async -> String
M
func evaluateExpression(MTLExpression) async throws -> (any EcoreValue)?
M
func finalize() async throws
M
func getGeneratedText() async -> String
M
func getModel(String) -> Resource?
M
func getProtectedAreaContent(String) async -> String?
M
func getTraceLinks() -> [(source: any EObject, target: String)]
M
func getVariable(String) async throws -> (any EcoreValue)?
M
func openFile(url: String, mode: MTLOpenMode, charset: String) async throws
M
func popIndentation()
M
func popScope()
M
func pushIndentation()
M
func pushScope()
M
func registerModel(String, resource: Resource)
M
func scanFileForProtectedAreas(String) async throws
M
func setProtectedAreaContent(String, content: String, markers: (String, String)?) async
M
func setVariable(String, value: (any EcoreValue)?)
M
func write(String, indent: Bool) async
M
func writeLine(String, indent: Bool) async
Pr
MTLGenerationStrategy
Instance Methods
M
func createWriter(url: String, mode: MTLOpenMode, charset: String, indentation: MTLIndentation) async throws -> MTLWriter
M
func finalizeWriter(MTLWriter) async throws
Module Structure
S
MTLModule
Operators
static func == (MTLModule, MTLModule) -> Bool
Initializers
M
init(name: String, metamodels: OrderedDictionary<String, EPackage>, extends: String?, imports: [String], templates: OrderedDictionary<String, MTLTemplate>, queries: OrderedDictionary<String, MTLQuery>, macros: OrderedDictionary<String, MTLMacro>, encoding: String)
Instance Properties
P
let encoding: String
P
let extends: String?
P
let imports: [String]
P
let macros: OrderedDictionary<String, MTLMacro>
P
let metamodels: OrderedDictionary<String, EPackage>
P
let name: String
P
let queries: OrderedDictionary<String, MTLQuery>
P
let templates: OrderedDictionary<String, MTLTemplate>
Instance Methods
M
func hash(into: inout Hasher)
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLTemplate
Initializers
M
init(name: String, visibility: MTLVisibility, parameters: [MTLVariable], guard: MTLExpression?, post: MTLExpression?, body: MTLBlock, isMain: Bool, overrides: String?, documentation: String?)
Instance Properties
P
let body: MTLBlock
P
let documentation: String?
P
let `guard`: MTLExpression?
P
let isMain: Bool
P
let name: String
P
let overrides: String?
P
let parameters: [MTLVariable]
P
let post: MTLExpression?
P
let visibility: MTLVisibility
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLQuery
Initializers
M
init(name: String, visibility: MTLVisibility, parameters: [MTLVariable], returnType: String, body: MTLExpression, documentation: String?)
Instance Properties
P
let body: MTLExpression
P
let documentation: String?
P
let name: String
P
let parameters: [MTLVariable]
P
let returnType: String
P
let visibility: MTLVisibility
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
Template Elements
S
MTLBlock
Operators
static func == (MTLBlock, MTLBlock) -> Bool
Initializers
M
init(statements: [any MTLStatement], inlined: Bool)
Instance Properties
P
let inlined: Bool
P
let statements: [any MTLStatement]
Instance Methods
M
func execute(in: MTLExecutionContext) async throws
M
func hash(into: inout Hasher)
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
Protected Regions
C
MTLProtectedAreaManager
Structures
S
MTLProtectedAreaManager.ProtectedAreaContent
Initializers
M
init(id: String, content: String, startMarker: String, endMarker: String)
Instance Properties
P
let content: String
P
let endMarker: String
P
let id: String
P
let startMarker: String
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
Initializers
M
init()
Instance Methods
M
func clear()
M
func enableDebugging(Bool)
M
func generateMarkers(id: String, prefix: String?) -> (String, String)
M
func getAllContent() -> [String : ProtectedAreaContent]
M
func getArea(String) -> ProtectedAreaContent?
M
func getContent(String) -> String?
M
func hasContent(String) -> Bool
M
func removeContent(String)
M
func scanContent(String)
M
func scanFile(String) throws
M
func setContent(String, content: String, markers: (String, String)?)
M
func summary() -> String
Default Implementations
Actor Implementations
Instance Methods
M
func assertIsolated(@autoclosure () -> String, file: StaticString, line: UInt)
M
func assumeIsolated<T>((isolated Self) throws -> T, file: StaticString, line: UInt) rethrows -> T
M
func preconditionIsolated(@autoclosure () -> String, file: StaticString, line: UInt)
Parsing
C
MTLParser
Initializers
M
init(enableDebugging: Bool)
Instance Methods
M
func parse(URL) async throws -> MTLModule
M
func parse(String, filename: String) async throws -> MTLModule
Default Implementations
Actor Implementations
Instance Methods
M
func assertIsolated(@autoclosure () -> String, file: StaticString, line: UInt)
M
func assumeIsolated<T>((isolated Self) throws -> T, file: StaticString, line: UInt) rethrows -> T
M
func preconditionIsolated(@autoclosure () -> String, file: StaticString, line: UInt)
Errors
E
MTLExecutionError
Enumeration Cases
E
case fileError(String)
E
case guardFailed(String)
E
case invalidOperation(String)
E
case macroNotFound(String)
E
case moduleNotFound(String)
E
case postConditionFailed(String)
E
case protectedAreaConflict(String)
E
case queryNotFound(String)
E
case templateNotFound(String)
E
case typeError(String)
E
case variableNotFound(String)
Instance Properties
P
var errorDescription: String?
Default Implementations
Error Implementations
Instance Properties
P
var localizedDescription: String
LocalizedError Implementations
Instance Properties
P
var failureReason: String?
P
var helpAnchor: String?
P
var recoverySuggestion: String?
E
MTLParseError
Enumeration Cases
E
case invalidSyntax(String)
E
case malformedExpression(String)
E
case malformedXMI(String)
E
case missingAttribute(attribute: String, element: String)
E
case unknownStatementType(String)
Instance Properties
P
var errorDescription: String?
Default Implementations
Error Implementations
Instance Properties
P
var localizedDescription: String
LocalizedError Implementations
Instance Properties
P
var failureReason: String?
P
var helpAnchor: String?
P
var recoverySuggestion: String?
Classes
C
MTLFileSystemStrategy
Initializers
M
init(basePath: String)
Instance Methods
M
func createWriter(url: String, mode: MTLOpenMode, charset: String, indentation: MTLIndentation) async throws -> MTLWriter
M
func finalizeWriter(MTLWriter) async throws
Default Implementations
Actor Implementations
Instance Methods
M
func assertIsolated(@autoclosure () -> String, file: StaticString, line: UInt)
M
func assumeIsolated<T>((isolated Self) throws -> T, file: StaticString, line: UInt) rethrows -> T
M
func preconditionIsolated(@autoclosure () -> String, file: StaticString, line: UInt)
C
MTLGenerator
Initializers
M
init(module: MTLModule, generationStrategy: any MTLGenerationStrategy)
Instance Properties
P
let module: MTLModule
P
var statistics: MTLGenerationStatistics
Instance Methods
M
func enableDebugging(Bool)
M
func executeQuery(MTLQuery, arguments: [(any EcoreValue)?]) async throws -> (any EcoreValue)?
M
func executeTemplate(MTLTemplate, arguments: [(any EcoreValue)?]) async throws
M
func expandMacro(MTLMacro, arguments: [(any EcoreValue)?], bodyContent: MTLBlock?) async throws
M
func generate(mainTemplate: String, arguments: [(any EcoreValue)?], models: [String : Resource]) async throws
M
func statisticsSummary() -> String
C
MTLInMemoryStrategy
Initializers
M
init()
Instance Methods
M
func clear()
M
func createWriter(url: String, mode: MTLOpenMode, charset: String, indentation: MTLIndentation) async throws -> MTLWriter
M
func finalizeWriter(MTLWriter) async throws
M
func getGeneratedFiles() -> [String : String]
Default Implementations
Actor Implementations
Instance Methods
M
func assertIsolated(@autoclosure () -> String, file: StaticString, line: UInt)
M
func assumeIsolated<T>((isolated Self) throws -> T, file: StaticString, line: UInt) rethrows -> T
M
func preconditionIsolated(@autoclosure () -> String, file: StaticString, line: UInt)
C
MTLWriter
Initializers
M
init(indentation: MTLIndentation)
Instance Properties
P
var indentation: MTLIndentation
Instance Methods
M
func clear()
M
func getContent() -> String
M
func newLine(indent: Bool)
M
func setIndentation(MTLIndentation)
M
func write(String, indent: Bool)
M
func writeLine(String, indent: Bool)
Default Implementations
Actor Implementations
Instance Methods
M
func assertIsolated(@autoclosure () -> String, file: StaticString, line: UInt)
M
func assumeIsolated<T>((isolated Self) throws -> T, file: StaticString, line: UInt) rethrows -> T
M
func preconditionIsolated(@autoclosure () -> String, file: StaticString, line: UInt)
Protocols
Pr
MTLStatement
Instance Properties
P
var multiLines: Bool
Instance Methods
M
func execute(in: MTLExecutionContext) async throws
Structures
S
MTLBinding
Initializers
M
init(variable: MTLVariable, initExpression: MTLExpression)
Instance Properties
P
let initExpression: MTLExpression
P
let variable: MTLVariable
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLComment
Initializers
M
init(value: String, multiLines: Bool)
Instance Properties
P
let multiLines: Bool
P
let value: String
Instance Methods
M
func execute(in: MTLExecutionContext) async throws
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLExpression
Operators
static func == (MTLExpression, MTLExpression) -> Bool
Initializers
M
init(any AQLExpression)
Instance Properties
P
let aqlExpression: any AQLExpression
Instance Methods
M
func evaluate(in: MTLExecutionContext) async throws -> (any EcoreValue)?
M
func hash(into: inout Hasher)
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLExpressionStatement
Initializers
M
init(expression: MTLExpression, multiLines: Bool, newLineNeeded: Bool)
Instance Properties
P
let expression: MTLExpression
P
let multiLines: Bool
P
let newLineNeeded: Bool
Instance Methods
M
func execute(in: MTLExecutionContext) async throws
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLFileStatement
Initializers
M
init(url: MTLExpression, mode: MTLOpenMode, charset: MTLExpression?, body: MTLBlock, multiLines: Bool)
Instance Properties
P
let body: MTLBlock
P
let charset: MTLExpression?
P
let mode: MTLOpenMode
P
let multiLines: Bool
P
let url: MTLExpression
Instance Methods
M
func execute(in: MTLExecutionContext) async throws
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLForStatement
Initializers
M
init(binding: MTLBinding, separator: MTLExpression?, body: MTLBlock, multiLines: Bool)
Instance Properties
P
let binding: MTLBinding
P
let body: MTLBlock
P
let multiLines: Bool
P
let separator: MTLExpression?
Instance Methods
M
func execute(in: MTLExecutionContext) async throws
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLGenerationStatistics
Instance Properties
P
var executionTime: TimeInterval
P
var filesGenerated: Int
P
var lastError: Error?
P
var linesGenerated: Int
P
var protectedAreasPreserved: Int
P
var successful: Bool
P
var templatesExecuted: Int
Instance Methods
M
func reset()
M
func summary() -> String
S
MTLIfStatement
Operators
static func == (MTLIfStatement, MTLIfStatement) -> Bool
Initializers
M
init(condition: MTLExpression, thenBlock: MTLBlock, elseIfBlocks: [(MTLExpression, MTLBlock)], elseBlock: MTLBlock?, multiLines: Bool)
Instance Properties
P
let condition: MTLExpression
P
let elseBlock: MTLBlock?
P
let elseIfBlocks: [(MTLExpression, MTLBlock)]
P
let multiLines: Bool
P
let thenBlock: MTLBlock
Instance Methods
M
func execute(in: MTLExecutionContext) async throws
M
func hash(into: inout Hasher)
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLIndentation
Initializers
M
init(level: Int, indentString: String)
Instance Properties
P
var asString: String
P
let indentString: String
P
let level: Int
Instance Methods
M
func decrement() -> MTLIndentation
M
func increment() -> MTLIndentation
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLLetStatement
Initializers
M
init(variables: [MTLBinding], body: MTLBlock, multiLines: Bool)
Instance Properties
P
let body: MTLBlock
P
let multiLines: Bool
P
let variables: [MTLBinding]
Instance Methods
M
func execute(in: MTLExecutionContext) async throws
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLMacro
Initializers
M
init(name: String, parameters: [MTLVariable], bodyParameter: String?, body: MTLBlock, documentation: String?)
Instance Properties
P
let body: MTLBlock
P
let bodyParameter: String?
P
let documentation: String?
P
let name: String
P
let parameters: [MTLVariable]
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLMacroInvocation
Initializers
M
init(macroName: String, arguments: [MTLExpression], bodyContent: MTLBlock?, multiLines: Bool)
Instance Properties
P
let arguments: [MTLExpression]
P
let bodyContent: MTLBlock?
P
let macroName: String
P
let multiLines: Bool
Instance Methods
M
func execute(in: MTLExecutionContext) async throws
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLNewLineStatement
Initializers
M
init(indentationNeeded: Bool, multiLines: Bool, newLineNeeded: Bool)
Instance Properties
P
let indentationNeeded: Bool
P
let multiLines: Bool
P
let newLineNeeded: Bool
Instance Methods
M
func execute(in: MTLExecutionContext) async throws
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLProtectedArea
Initializers
M
init(id: MTLExpression, startTagPrefix: MTLExpression?, endTagPrefix: MTLExpression?, body: MTLBlock, multiLines: Bool)
Instance Properties
P
let body: MTLBlock
P
let endTagPrefix: MTLExpression?
P
let id: MTLExpression
P
let multiLines: Bool
P
let startTagPrefix: MTLExpression?
Instance Methods
M
func execute(in: MTLExecutionContext) async throws
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLTextStatement
Initializers
M
init(value: String, multiLines: Bool, newLineNeeded: Bool)
Instance Properties
P
let multiLines: Bool
P
let newLineNeeded: Bool
P
let value: String
Instance Methods
M
func execute(in: MTLExecutionContext) async throws
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLTrace
Initializers
M
init(sourceExpression: MTLExpression, body: MTLBlock, multiLines: Bool)
Instance Properties
P
let body: MTLBlock
P
let multiLines: Bool
P
let sourceExpression: MTLExpression
Instance Methods
M
func execute(in: MTLExecutionContext) async throws
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLTraceLink
Initializers
M
init(sourceElement: EUUID, targetFile: String, targetRange: Range<Int>, timestamp: Date)
Instance Properties
P
let sourceElement: EUUID
P
let targetFile: String
P
let targetRange: Range<Int>
P
let timestamp: Date
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
S
MTLVariable
Initializers
M
init(name: String, type: String)
Instance Properties
P
let name: String
P
let type: String
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
Enumerations
E
MTLOpenMode
Enumeration Cases
E
case append
E
case create
E
case overwrite
Initializers
M
init?(rawValue: String)
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
RawRepresentable Implementations
Initializers
M
init(from: any Decoder) throws
Instance Properties
P
var hashValue: Int
Instance Methods
M
func encode(to: any Encoder) throws
M
func hash(into: inout Hasher)
E
MTLResourceError
Enumeration Cases
E
case invalidURI(String)
E
case loadError(String)
E
case noModule
E
case saveError(String)
Instance Properties
P
var errorDescription: String?
Default Implementations
Error Implementations
Instance Properties
P
var localizedDescription: String
LocalizedError Implementations
Instance Properties
P
var failureReason: String?
P
var helpAnchor: String?
P
var recoverySuggestion: String?
E
MTLVisibility
Enumeration Cases
E
case `private`
E
case protected
E
case `public`
Initializers
M
init?(rawValue: String)
Default Implementations
Equatable Implementations
Operators
static func != (Self, Self) -> Bool
RawRepresentable Implementations
Initializers
M
init(from: any Decoder) throws
Instance Properties
P
var hashValue: Int
Instance Methods
M
func encode(to: any Encoder) throws
M
func hash(into: inout Hasher)
/
MTL
/
MTLGenerationStatistics
Property
templatesExecuted
Number of templates executed.
var
templatesExecuted
:
Int