Bundt Scripting Reference · Bundt Scripting Language version 1.0.1.0

Statements

A statement is a single instruction to carry out an operation. For example, the statement create type model Test; instructs Bundt to create a type model named Test.

Statements constitute the basic building block of scripts. A script, in fact, is a collection of statements that get executed one by one.

Details

Each statement has some specific semantics, such as creating a model or a model element, changing some properties, deleting data, or manipulating a model by sealing or saving it, for example.

There are many kinds of statements. Please see Statements for a detailed reference.

In general, every statement in a script must be terminated by a semicolon ;. For example:

create class Building;
alter class as definition "A permanent structure with a roof.";

As long as you terminate statements with semicolons, you can arrange them as you wish, concatenating them on a single line or splitting them over several:

create class Building; alter class
    as definition
        "A permanent structure with a roof.";

By convention, statements are often written one by line, but complex ones are sometimes arranged over several lines.

Statement blocks

Statements can be grouped in blocks by surrounding them in curly braces {}. For example:

write
    {
        create type model Test;
        create class Person;
        create attribute Age: 1 Number;
    };
Using statements as expressions

Sometimes, statements are used as expressions. This is the case of writing the result of a statement through a write statement. For example, if you want to create a Buliding class in your model and show the result, you should run:

write create class Building;;

Note that the create class Building; statement, includig its terminating semicolon, are used as a expression to the write statement, which has its own final semicolon. Another way to visualize this is to put the expression to write out in parentheses: write (create class Building;);.

See Also


Contents distributed under a Creative Commons Attribution 4.0 International License · About · Terms of Use · Contact Us · last updated on 08 October 2020