blob: 95856e0320b0402d3faf4b5be9a52338e05799ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
// test de l'interpr�teur CBot, (c) D. Dumoulin 2000
// pour l'instant, seule les primitives suivantes sont impl�ment�es
// { ... ; ... ; ... } un bloc d'instructions
// int x, y = 12, z; // d�claration de nombre entier
// float a, b= 2/3, c=b+1; // d�claration de nombres r�els
// boolean tst = true; // d�claration d'un bool�en
// String x = "hello"; // d�claration d'une cha�nes
// z = x = x * y / ( z + 1 - x ); // assignation en cha�ne et les 4 op�rations
// while ( x >= 0 ) x = x - 1; // boucle while, et test > >= < <= == !=
// if ( x < y ) x = x + 1; // test si
// else y = y + 1; // sinon
/* et les op�rations suivantes:
+ plus unaire x = +y;
- moins unaire x = -y;
|| OU logique
&& ET logique
! NOT logique
| OU bit � bit
& ET bit � bit
^ XOR bit � bit
~ NON bit � bit
// les commentaires sont accept�s
/* y compris les commentaires
sur plusieures lignes */
{
String str ;
str = "abc" ;
show (str) ;
show( str = str + "+++" , ) ;
}
|