This chapter defines the notations used in this document.
while (!tasks.empty) { tasks.removeFront.process }.
C++ source code is presented in frames as follows.
class Int
{
public:
Foo(int v = 0)
: val_(v)
{}
void operator(int v)
{
std::swap(v, val_);
return v;
}
int operator() const
{
return val_;
}
private:
int val_;
};
The grammar fragments are written in EBNF (Extended Backus-Naur Form). The symbol ::= separates the left-hand symbol from the right-hand side part of the rule. Infix | denotes alternation, postfix-* 0-or-more repetition, postfix-+ 1-or-more repetition, and postfix-? denotes optional parts. Terminal symbols are written in double-quotes, and non-terminals in angle-brackets. Parentheses group.
The following frame defines the grammar syntax expressed in the same grammar syntax.
⟨grammar⟩ ::= ⟨rule⟩+
⟨rule⟩ ::= ⟨symbol⟩ "::=" ⟨rhs⟩
⟨rhs⟩ ::= ⟨rhs⟩∗
∣ ⟨rhs⟩ "|" ⟨rhs⟩
∣ ⟨rhs⟩ ("?" ∣ "*" ∣ "+")
∣ "(" ⟨rhs⟩ ")"
∣ ⟨symbol⟩
⟨symbol⟩ ::= "<" ⟨identifier⟩ ">"
∣ ’"’ ⟨escaped-character⟩∗ ’"’
∣ "’" ⟨escaped-character⟩∗ "’"
Listing 29 provides the grammar of urbiscript.
Java source code is presented in frames as follows.
import liburbi.main.*;
public class Main
{
/// Load urbijava library.
static
{
System.loadLibrary("urbijava");
}
public static void main(String argv[])
{
// Does nothing for now.
}
}
Interactive sessions with a (Unix) shell are represented as follows.
The user entered ‘echo toto’, and the system answered ‘toto’. ‘$’ is the prompt: it starts the lines where the system invites the user to enter her commands.
Interactive sessions with Urbi are represented as follows.
Contrary to shell interaction (see Section 28.2.4), there is no prompt that marks the user-entered lines (here echo("toto");, but, on the contrary, answers from the Urbi server start with a label that includes a timestamp (here ‘00000001’), and possibly a channel name, ‘output’ in the following example.
The following assertion frame:
true;
1 < 2;
1 + 2 * 3 == 7;
"foobar"[0, 3] == "foo";
[1, 2, 3].map (function (a) { a * a }) == [1, 4, 9];
[ => ].empty;
denotes the following assertion-block (see Section 20.9) in an urbiscript-session frame: