IndexNextUpPreviousUrbi SDK 2.7.5

Chapter 34
Notations

This chapter defines the notations used in this document.

34.1 Words

34.2 Frames

34.2.1 C++ Code

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_; 
};  

34.2.2 Grammar Excerpts

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 "’"  

34.2.3 Java Code

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. 
    } 
}  

34.2.4 Shell Sessions

Interactive sessions with a (Unix) shell are represented as follows.

 
echo toto 
toto  

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.

34.2.5 urbiscript Sessions

Interactive sessions with Urbi are represented as follows.

 
echo("toto"); 
[00000001] *** toto  

Contrary to shell interaction (see Section 34.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.

 
cout << "toto"
[00000002:output] "toto"  

34.2.6 urbiscript Assertions

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 22.9) in an urbiscript-session frame:

 
assert 

  true; 
  1 < 2; 
  1 + 2 * 3 == 7; 
  "foobar"[0, 3] == "foo"
  [1, 2, 3].map (function (a) { a * a }) == [1, 4, 9]; 
  [ => ].empty; 
};