Vesta SDL Syntax

In general the SDL's language syntax is deceptively C-like.  Don't let it fool you though: this isn't C.

Comments

Comments in Vesta's SDL can be either the traditional C style starting with /* and ending with */:

/* Single-line comment */

/*
** This is a multi-line
** comment.
*/

Or the C++ style started with // and ending with a newline:

// These only come in the
// single-line variety.

Special Comments

There are two special comments which can be used when defining a funcrtion:

/**nocache**/
/**pk**/

These affect the way Vesta's function caching mechanism treats a function invocation.  A more complete description is given in the Vesta evaluator man page and there's also a section in this reference guide on using these (though it's a bit heavy and you might not want to read it right now).

There's another special comment which affects the way vupdate(1) works:

/**noupdate**/
/**NOUPDATE**/

Preceeding a model import with this will prevent vupdate from changing it.

Identifiers

As in C/C++ there is a notion of identifiers: names which can be used as variables, and in the Vesta SDL as names in bindings.  However, they are a little more broad than in C/C++.  Vesta SDL identifiers can be made up of any sequence of leters, decimal digits, underscores, and periods, as long as the sequence cannot be parsed as an integer literal.  For example, all of these are valid identifiers:

foo.c
_.
36.foo
123_456
3.14159

On the other hand, these are illegal identifiers (because they look like integer literals):

36
0x1234
07531

Reserved Words

The following reserved words cannot be used as identifiers:

binding
bool
do
else
ERR
FALSE
files
foreach
from
function
if
in
import
int
list
return
text
then
TRUE
type
value

If surrounded by double quotes, they may be used as names in bindings, path components in a files or import clause, or names in a binding lookup.

White Space

White space delimits tokens but is otherwise ignored.  The only place it is significant is in text literals and then only the space character (the ASCII character represented by the decimal number 32) is allowed.

Blocks

Model files and function definitions use blocks of statements.  (A block of statements can also be used as an expression.)  As in C, blocks are surrounded by curly braces, with individual statements delimeted by semicolons:

{ statement_1; statement_2; ...; statement_n; }

Path Delimiters

The Vesta SDL uses paths both for specifying filenames and for specifying multi-level binding assignments and lookups:

import
    progs = src/progs.ves;

...

./C/libs/c/libc

Either forward or backward slashes are allowed within pathnames, but not both.


Kenneth C. Schalk <ken@xorian.net>   / Vesta SDL Programmer's Reference