AKTIVE

Artifact [6c080b4eaf]
Login

Artifact [6c080b4eaf]

Artifact 6c080b4eaf31ae9d8c08b1edf222bc6230cc725b19ca9adb02e4bc3614000fbc:


Project ↗ Documentation ↗ Developer Index ↗

Operator Specifications DSL

Overview

AKTIVE uses a Tcl-based domain-specific language to simplify the specification of image processing operators.

The implementation of the DSL translates the specifications into the

Implementation

Up ↑

Files:

Main commands

Up ↑

Command Description
def Define a sharable text block. Global or local to an operator
import Import definitions from the specified file, fail for a mising file
import? See above. However, ignore a missing file
nyi Disable the command it is a prefix of
operator Define a (set of) operators
type Define a type for use in parameter and results
vector Declare for which types we need vector/slice support

def

Up ↑

Syntax
def NAME TEXT [(KEY VALUE)...]

This command creates a named sharable block of text, at either global level or local to an operator specification. The created block is usable wherever templating is performed.

The command further creates a Tcl variable of the same name in the calling scope also containing the text.

Note that this command applies templating to the text before it is saved. In other words, the definition of a block can reference blocks defined before it. Furthermore the optional set of key and value arguments serves as map of ultra-local placeholders to handle.

import, import?

Up ↑

Syntax
import PATH
import? PATH

Both commands read the referenced file and execute the commands in the context of the import. This can be global or within an operator specification.

The import? variant ignores a missing PATH, whereas import will throw an error in that case.

nyi

Up ↑

Syntax
nyi [WORD...]

nyi is a prefix command whose use disables the command it is made a prefix of.

The name stands for not yet implemented.

operator

Up ↑

Syntax
operator NAME SPEC
operator NAMELIST SPEC
operator VARLIST OPLIST SPEC

This command names and specifies one or more (related) image processing operators, using a suite of subordinate commands within its spec.

Given the complexity it has its own page containing the full details.

type

Up ↑

Syntax
type ID CRITCL C CONVERTER

The command declares a type the DSL can use for operator parameter and results. Note that types have to be declared before their use.

The core types needed by AKTIVE's runtime framework itself are declared in

Arguments:

Name Description
ID Name the type is identified by when used in vector and operator commands
CRITCL The associated Critcl type. - defaults to the ID
C The associated C type. - defaults to the CRITCL name
CONVERTER C code fragment to convert a C value of the type into a Tcl_Obj

Converter notes:

vector

Up ↑

Syntax
vector [ID...]

The command declares that we need vector/slice support for the types named in its arguments.

In other words, it arranges for the generator to emit C code that provides the types and functions for the management of dynamic arrays for values of this type.