Skip to content

Package dev.gecode.iris.kotlin.build

Dokka 2.2.0 generates this reference of the Kotlin spec builder during each site build from the Kotlin sources, and its summary lists every class and function. The guide shows the builder in use, the Java builder's reference covers the handles, types and expressions it shares, and the extensions read the data.

Types

A capture for a line pattern, made by capture and optionalCapture of a scope. As a property delegate it names the entry after the property, or after the name given to capture, and declares that name, which must be new in the builder, as Iris.declare.

The body of a repeat at depth 4 or more, whose definitions read a Value.

A builder's text, before it is parsed, and the handles that will read its data.

annotation class IrisDsl

Marks the receivers of the builder, so that a block's lambda cannot reach an outer block's statements without naming that receiver.

data class IrisSpec<out H>(val spec: Spec, val handles: H)

A built spec and the handles that read its data.

A block at depth 4 or more whose statements may not run.

A block at depth 0 whose statements may not run, such as the body of if.

A block at depth 1 whose statements may not run.

sealed class Scope<I, F, N, S, B : Any, R : Any, C : Any>

A block of a spec, the receiver of its lambda. Its statements are those of dev.gecode.iris.build.Iris, and add to this block.

A block at depth 0 whose statements always run, such as the body of instances.

The body of a repeat at depth 1, whose records record names.

The body of a repeat at depth 2, whose records record names.

The body of a repeat at depth 3, whose records record names.

The arms of sections, the receiver of its lambda.

The top level of a spec: a block at depth 0 that also takes the settings and instances.

Functions

fun <E : Any> all(domain: Domain<E>, body: (E) -> Expr): IntExpr

all(v in domain: body).

fun alphabet(symbols: String): Alphabet

alphabet "symbols", as Iris.alphabet.

infix fun IntegralExpr.and(other: Long): IntExpr

this && other.

fun <E : Any> any(domain: Domain<E>, body: (E) -> Expr): IntExpr

any(v in domain: body).

fun atMost(hi: Long): IntType

..hi.

fun below(hi: Long): IntType

..<hi.

fun blank(): Part

{}, blanks.

fun capture(handle: Field<*>, type: Type<*>): Part

{name:type}, a capture through an explicit handle, as Iris.capture.

fun count(domain: Domain<*>): IntExpr

count(domain).

fun <E : Any> count(domain: Domain<E>, body: (E) -> Expr): IntExpr

count(v in domain: body).

fun defined(name: Expr): IntExpr

defined(name).

fun defined(record: RecordExpr): IntExpr
fun defined(record: RecordName): IntExpr

defined(record).

fun defined(records: RecordList): IntExpr

defined(records).

_: as a pattern part {_}, and as a target a definition that keeps nothing.

fun discard(type: Type<*>): Part

{_:type}, a value of type that is not kept.

fun distinct(arguments: List<Expr>): IntExpr
fun distinct(first: Expr, vararg more: Expr): IntExpr

distinct(...).

fun dynamic(name: String): DynField

A handle of any type and depth, which reads a Value, as Iris.dynamic.

infix fun DynExpr.eq(other: DynExpr): IntExpr

this == other, of values whose type the data decide.

infix fun NumericExpr.eq(other: NumericExpr): IntExpr
infix fun NumericExpr.eq(other: Double): IntExpr
infix fun NumericExpr.eq(other: Long): IntExpr

this == other.

infix fun TextualExpr.eq(other: TextualExpr): IntExpr
infix fun TextualExpr.eq(other: String): IntExpr

this == other, of strings.

float.

A float handle at depth 0, as Iris.float0.

A float handle at depth 1, as Iris.float1.

A float handle at depth 2, as Iris.float2.

A float handle at depth 3, as Iris.float3.

fun floatN(name: String, depth: Int): FloatField<Value>

A float handle at any depth, which reads a Value, as Iris.floatN.

infix fun NumericExpr.ge(other: NumericExpr): IntExpr
infix fun NumericExpr.ge(other: Double): IntExpr
infix fun NumericExpr.ge(other: Long): IntExpr

this >= other.

infix fun NumericExpr.gt(other: NumericExpr): IntExpr
infix fun NumericExpr.gt(other: Double): IntExpr
infix fun NumericExpr.gt(other: Long): IntExpr

this > other.

fun int(): IntType

int.

fun int0(name: String): IntField<Long>

An integer handle at depth 0, as Iris.int0.

An integer handle at depth 1, as Iris.int1.

An integer handle at depth 2, as Iris.int2.

An integer handle at depth 3, as Iris.int3.

fun intN(name: String, depth: Int): IntField<Value>

An integer handle at any depth, which reads a Value, as Iris.intN.

fun <H> irisBuilder(format: String? = null, body: SpecScope.() -> H): IrisBuilder<H>

Builds a reader spec: body adds its statements, and what it returns comes back as the handles. With format, the spec starts with format format.

fun <H> irisSpec(format: String? = null, body: SpecScope.() -> H): IrisSpec<H>

Builds and checks a reader spec, as irisBuilder followed by IrisBuilder.build.

infix fun NumericExpr.le(other: NumericExpr): IntExpr
infix fun NumericExpr.le(other: Double): IntExpr
infix fun NumericExpr.le(other: Long): IntExpr

this <= other.

fun lit(value: Double): FloatExpr

A float literal.

fun lit(value: Long): IntExpr

An integer literal.

fun lit(value: String): StringExpr

A string literal.

infix fun NumericExpr.lt(other: NumericExpr): IntExpr
infix fun NumericExpr.lt(other: Double): IntExpr
infix fun NumericExpr.lt(other: Long): IntExpr

this < other.

fun max(arguments: List<Expr>): IntExpr
fun max(first: Expr, vararg more: Expr): IntExpr

max(...).

fun min(arguments: List<Expr>): IntExpr
fun min(first: Expr, vararg more: Expr): IntExpr

min(...).

infix fun DynExpr.ne(other: DynExpr): IntExpr

this != other, of values whose type the data decide.

infix fun NumericExpr.ne(other: NumericExpr): IntExpr
infix fun NumericExpr.ne(other: Double): IntExpr
infix fun NumericExpr.ne(other: Long): IntExpr

this != other.

infix fun TextualExpr.ne(other: TextualExpr): IntExpr
infix fun TextualExpr.ne(other: String): IntExpr

this != other, of strings.

fun num(): NumType

num.

fun num0(name: String): NumField<Number>

A number handle at depth 0, as Iris.num0.

A number handle at depth 1, as Iris.num1.

A number handle at depth 2, as Iris.num2.

A number handle at depth 3, as Iris.num3.

fun numN(name: String, depth: Int): NumField<Value>

A number handle at any depth, which reads a Value, as Iris.numN.

infix fun IntegralExpr.or(other: IntegralExpr): IntExpr
infix fun IntegralExpr.or(other: Long): IntExpr

this || other.

fun <E : Any> over(domain: Domain<E>): Over<E>

A comprehension domain whose variable Over.named names.

fun range(lo: Long): Range

The range lo.., whose upper bound Range.to or Range.below adds.

The range this..hi, which Kotlin and Iris spell alike.

operator fun NumericExpr.rangeTo(hi: Long): IntType
operator fun Int.rangeTo(hi: NumericExpr): IntType
operator fun Long.rangeTo(hi: NumericExpr): IntType

The range this..hi.

The range this..<hi, which Kotlin and Iris spell alike.

operator fun NumericExpr.rangeUntil(hi: Long): IntType
operator fun Int.rangeUntil(hi: NumericExpr): IntType
operator fun Long.rangeUntil(hi: NumericExpr): IntType

The range this..<hi.

A record name, printed with names the builder chooses.

fun recordName(each: String, list: String): RecordName

A record name, printed as each each and as list.

fun ref(handle: Field<*>): Part

{$name}, the value of an already bound name.

operator fun IntegralExpr.rem(other: IntegralExpr): IntExpr

this % other, which truncates toward zero in Kotlin and Iris alike.

operator fun IntegralExpr.rem(other: Long): IntExpr

this % other.

rest.

..., the rest of the line.

fun size(domain: Domain<*>): IntExpr

size(domain).

skip other.

A string handle at depth 0, as Iris.string0.

A string handle at depth 1, as Iris.string1.

A string handle at depth 2, as Iris.string2.

A string handle at depth 3, as Iris.string3.

fun stringN(name: String, depth: Int): StringField<Value>

A string handle at any depth, which reads a Value, as Iris.stringN.

fun sum(arguments: List<Expr>): IntExpr
fun sum(first: Expr, vararg more: Expr): IntExpr

sum(...).

fun <E : Any> sum(domain: Domain<E>, body: (E) -> Expr): IntExpr

sum(v in domain: body).

operator fun DynExpr.unaryMinus(): DynExpr
operator fun IntExpr.unaryMinus(): IntExpr
operator fun NumExpr.unaryMinus(): NumExpr

-this.

fun until(terminator: String, vararg more: String): Until

until "terminator" ..., whose Until.store adds a store.

fun validate(type: Type<*>): Part

{:type}, a value that is checked and not kept.

word.