[Contents] [Intro] [Reference] [Tutorial] [Questions [New [Index]
Overview -> Reference -> API Reference -> Overview: API Commands -> Help

daVinci API - Syntax

Commands and answers of the daVinci API are terms which can be build hierarchically by applying substitution rules of the syntax definition. The syntax of commands and answers is defined in Backus-Naur form. The syntax grammar has a set of substitution rules, where each rule may have different alternative cases on the right hand side, separated by bars (|). Terminal symbols of the grammar are written in bold face and need to occur in the term. Non-terminal symbols are links to other rules and need to be substituted by one of the cases of the particular rule. This substitution process continues until no non-terminal symbols remain. To say it in another word: Commands and answers are exclusively composed of terminal symbols. The start symbol for the commands is rule daVinci_command and for the answers daVinci_answer. For example, consider the following rules:
    daVinci_command ::=
        tcl(tcl_cmd)
      | (... other cases deleted ...)

    tcl_cmd ::=
        eval(string)
      | eval_file(filename).

    filename ::= string.
Here are some examples for valid commands with respect to this grammar (but please do not try to send such Tcl-scripts to daVinci). :-)
    tcl(eval("Hello"))
    tcl(eval_file("daVinci"))
Usually, whitespace (i.e. space, tab or return/newline characters between non-terminal symbols) is allowed, but should not be used in a term to reduce the amount of transmitted data. Return or newline characters must not be used in a term if send to the API. The reason for this restriction is that a newline character is needed to signal the end of a command if sent on a pipe, i.e. the buffer will flush as soon as a newline appears. So, with a newline inside the term, it will be split at this position, resulting in a syntax error for the fragment. If you need to have newline characters inside of a string (e.g. to visualize a node with multiline text), you can use the well known C escape mechanism of ("\n").

Note: As a result of using Tcl/Tk for the implemantation of the user interface, some characters have a special meaning for Tcl. So we have used '{' and '}' as delimiters for sending strings to Tcl. Therefore Tcl complains about unbalanced braces, if somewhere in a string only one of both is used (i.e. "}" or "{", whereas "{}" is allowed). So please avoid unbalanced braces in strings or you'll get Tcl/Tk error messages on command-line.


daVinci V2.1 Online Documentation - Page update: June 15, 1998