Class: Translator

Translator()

Translates z-Tree code (programs, expressions) to JS, with variables resolved by vars.

Constructor

new Translator()

Source:

Methods

arrayRef()

rec's array name: through z.arr if its table declares it (made when first used), else as it is.

Source:

atom()

An expression, in parentheses unless it is one thing.

Source:

exprOr()

An expression (z-Tree's code) in ctx as JS; if it cannot be, otherwise, and a TODO.

Source:

layout()

A layout as JS, for z.fmt: {step} (a number: "1", "0.01", or a variable's), or {options}
(!text: 1 = "yes"; 0 = "no", the values numbers or variables').

Source:

owner()

The record (JS) a variable is read from, looking out from ctx.

Source:

program()

A program on its table's records: subjects (the players given, as player), globals (g),
the others' records. Lines of JS, in a function that has period, g, app, and players.

Source:

programOn()

A program run on one record (ctx: its table and the JS of it, and the records around it), or,
with records (JS), on each of them: lines of JS.

Source:

records()

JS for the records of a table named in code (OLD

: the period before's).

Source:

statements()

Statements, as JS lines.

Source:

subjectExpr()

An expression of a subject's (a timeout, an input's minimum), with player and its period in scope.

Source:

tableOf()

The table of a record (JS) in ctx, if known.

Source:

target()

The record (JS) a variable is set in.

Source:

text()

A text (a checker's message, a label) as a JS string expression: "<>" texts with their <var|layout> values.

Source:

Documentation generated by JSDoc 4.0.4 on Wed Oct 14 2026 10:28:11 GMT+0200 (Central European Summer Time)