Skip to content
Snippets Groups Projects
Commit dfdabfd0 authored by BAZIZI Zakaria's avatar BAZIZI Zakaria
Browse files

travail le soir comme un grand

parent 96995605
Branches
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ Tokens
espaces = (' ' | 13 | 10)+;
commentaire= '#' [[0 .. 0xffff] - [10 + 13]]* (10 | 13 | 10 13);
plus = '+';
pointvirgule = ';' ;
moins = '-';
ou = '|' ;
et = '&' ;
......@@ -27,7 +28,12 @@ accoladed = '}' ;
crochetg = '[' ;
crochetd = ']' ;
type = 'bool' | 'entier' ;
ins_ctl = 'si' | 'alors' |'tantque' | 'faire' |'sinon' | 'retour' ; \\ faire un tocket par truc
si = 'si' ;
alors = 'alors' ;
tantque = 'tantque' ;
faire = 'faire' ;
sinon = 'sinon' ;
retourner = 'retourner' ;
lire ='lire';
ecrire = 'ecrire' ;
nombre = chiffre+;
......@@ -59,9 +65,28 @@ mult =
{fois} mult fois non | {diviser} mult diviser non | {neg} neg ;
neg =
{non} non neg | {brackets} brackets ;
brackets =
{or} dparenthese or gparenthese | {nombre} nombre | {vrai} vrai | {faux} faux | {lire} lire ;
dec = {id} id | ;
\ No newline at end of file
{non} non neg | {exp} exp ;
exp =
{or} dparenthese or gparenthese
| {nombre} nombre
| {vrai} vrai
| {faux} faux
| {lire} lire ;
ins =
{affectation} var egale exp pointvirgule
|{tq} tantque exp faire bloc pointvirgule
|{si} si exp alors bloc pointvirgule
|{sisinon} si exp alors [alor]:bloc sinon [sino]:bloc pointvirgule
|{return} retourner exp pointvirgule
|{listeexp} id gparenthese exp dparenthese pointvirgule
|{write} ecrire gparenthese exp dparenthese pointvirgule
|{bloc} bloc pointvirgule ;
bloc = {instr} li ;
li = {listeinstr} ins li | {epsilon} epsilon ;
epsilon = ;
var = {id} id | {id_crochet} id crochetg exp crochetd ;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment