-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrammar.txt
34 lines (29 loc) · 881 Bytes
/
grammar.txt
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
bloc → { instruction } ;
instruction → affectation
| 'si' condition 'alors' bloc ['sinon' bloc] 'fsi'
| 'pour' identifier 'de' expression 'a' expression 'faire' bloc 'fpour'
| 'tantque' condition 'faire' bloc 'ftant';
condition → expression ;
affectation → identifieur '<-' expression ;
expression → literale
| unaire
| binaire
| groupe ;
literale → number | string | 'vrai' | 'faux';
groupe → '(' expression ')' ;
unaire → ( "-" | "non" ) expression ;
binaire → expression operateur expression ;
operateur → '+'
| '-'
| '*'
| 'et'
| 'ou'
| '<'
| '>'
| '='
| '<='
| '>='
| 'mod'
| '!='
| '/'
| '%' ;