Préparation pour test intermediaire
- Analyseur lexical OK - Analyseur syntaxyque OK
This commit is contained in:
0
test/output/affect-err.synt.xml
Normal file
0
test/output/affect-err.synt.xml
Normal file
18
test/output/affect.lex
Normal file
18
test/output/affect.lex
Normal file
@@ -0,0 +1,18 @@
|
||||
entier mot_clef entier
|
||||
$a id_variable $a
|
||||
; symbole POINT_VIRGULE
|
||||
main id_fonction main
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
$a id_variable $a
|
||||
= symbole EGAL
|
||||
1 nombre 1
|
||||
; symbole POINT_VIRGULE
|
||||
ecrire mot_clef ecrire
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
$a id_variable $a
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
; symbole POINT_VIRGULE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
symbole FIN
|
||||
113
test/output/affect.synt
Normal file
113
test/output/affect.synt
Normal file
@@ -0,0 +1,113 @@
|
||||
<programme>
|
||||
<optDecVariables>
|
||||
<listeDecVariables>
|
||||
<declarationVariable>
|
||||
<mot_clef>entier</mot_clef>
|
||||
<id_variable>$a</id_variable>
|
||||
<optTailleTableau>
|
||||
</optTailleTableau>
|
||||
</declarationVariable>
|
||||
<listeDecVariablesBis>
|
||||
</listeDecVariablesBis>
|
||||
</listeDecVariables>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</optDecVariables>
|
||||
<listeDecFonctions>
|
||||
<declarationFonction>
|
||||
<id_fonction>main</id_fonction>
|
||||
<listeParam>
|
||||
<symbole>PARENTHESE_OUVRANTE</symbole>
|
||||
<optListeDecVariables>
|
||||
</optListeDecVariables>
|
||||
<symbole>PARENTHESE_FERMANTE</symbole>
|
||||
</listeParam>
|
||||
<optDecVariables>
|
||||
</optDecVariables>
|
||||
<instructionBloc>
|
||||
<symbole>ACCOLADE_OUVRANTE</symbole>
|
||||
<listeInstructions>
|
||||
<instruction>
|
||||
<instructionAffect>
|
||||
<var>
|
||||
<id_variable>$a</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
<symbole>EGAL</symbole>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<nombre>1</nombre>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</instructionAffect>
|
||||
</instruction>
|
||||
<listeInstructions>
|
||||
<instruction>
|
||||
<instructionEcriture>
|
||||
<mot_clef>ecrire</mot_clef>
|
||||
<symbole>PARENTHESE_OUVRANTE</symbole>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<var>
|
||||
<id_variable>$a</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<symbole>PARENTHESE_FERMANTE</symbole>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</instructionEcriture>
|
||||
</instruction>
|
||||
<listeInstructions>
|
||||
</listeInstructions>
|
||||
</listeInstructions>
|
||||
</listeInstructions>
|
||||
<symbole>ACCOLADE_FERMANTE</symbole>
|
||||
</instructionBloc>
|
||||
</declarationFonction>
|
||||
<listeDecFonctions>
|
||||
</listeDecFonctions>
|
||||
</listeDecFonctions>
|
||||
</programme>
|
||||
40
test/output/boucle.lex
Normal file
40
test/output/boucle.lex
Normal file
@@ -0,0 +1,40 @@
|
||||
entier mot_clef entier
|
||||
$i id_variable $i
|
||||
, symbole VIRGULE
|
||||
entier mot_clef entier
|
||||
$carre id_variable $carre
|
||||
; symbole POINT_VIRGULE
|
||||
main id_fonction main
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
$i id_variable $i
|
||||
= symbole EGAL
|
||||
0 nombre 0
|
||||
; symbole POINT_VIRGULE
|
||||
tantque mot_clef tantque
|
||||
$i id_variable $i
|
||||
< symbole INFERIEUR
|
||||
10 nombre 10
|
||||
faire mot_clef faire
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
$carre id_variable $carre
|
||||
= symbole EGAL
|
||||
$i id_variable $i
|
||||
* symbole FOIS
|
||||
$i id_variable $i
|
||||
; symbole POINT_VIRGULE
|
||||
ecrire mot_clef ecrire
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
$carre id_variable $carre
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
; symbole POINT_VIRGULE
|
||||
$i id_variable $i
|
||||
= symbole EGAL
|
||||
$i id_variable $i
|
||||
+ symbole PLUS
|
||||
1 nombre 1
|
||||
; symbole POINT_VIRGULE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
symbole FIN
|
||||
283
test/output/boucle.synt
Normal file
283
test/output/boucle.synt
Normal file
@@ -0,0 +1,283 @@
|
||||
<programme>
|
||||
<optDecVariables>
|
||||
<listeDecVariables>
|
||||
<declarationVariable>
|
||||
<mot_clef>entier</mot_clef>
|
||||
<id_variable>$i</id_variable>
|
||||
<optTailleTableau>
|
||||
</optTailleTableau>
|
||||
</declarationVariable>
|
||||
<listeDecVariablesBis>
|
||||
<symbole>VIRGULE</symbole>
|
||||
<declarationVariable>
|
||||
<mot_clef>entier</mot_clef>
|
||||
<id_variable>$carre</id_variable>
|
||||
<optTailleTableau>
|
||||
</optTailleTableau>
|
||||
</declarationVariable>
|
||||
<listeDecVariablesBis>
|
||||
</listeDecVariablesBis>
|
||||
</listeDecVariablesBis>
|
||||
</listeDecVariables>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</optDecVariables>
|
||||
<listeDecFonctions>
|
||||
<declarationFonction>
|
||||
<id_fonction>main</id_fonction>
|
||||
<listeParam>
|
||||
<symbole>PARENTHESE_OUVRANTE</symbole>
|
||||
<optListeDecVariables>
|
||||
</optListeDecVariables>
|
||||
<symbole>PARENTHESE_FERMANTE</symbole>
|
||||
</listeParam>
|
||||
<optDecVariables>
|
||||
</optDecVariables>
|
||||
<instructionBloc>
|
||||
<symbole>ACCOLADE_OUVRANTE</symbole>
|
||||
<listeInstructions>
|
||||
<instruction>
|
||||
<instructionAffect>
|
||||
<var>
|
||||
<id_variable>$i</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
<symbole>EGAL</symbole>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<nombre>0</nombre>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</instructionAffect>
|
||||
</instruction>
|
||||
<listeInstructions>
|
||||
<instruction>
|
||||
<instructionTantque>
|
||||
<mot_clef>tantque</mot_clef>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<var>
|
||||
<id_variable>$i</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
<symbole>INFERIEUR</symbole>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<nombre>10</nombre>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<mot_clef>faire</mot_clef>
|
||||
<instructionBloc>
|
||||
<symbole>ACCOLADE_OUVRANTE</symbole>
|
||||
<listeInstructions>
|
||||
<instruction>
|
||||
<instructionAffect>
|
||||
<var>
|
||||
<id_variable>$carre</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
<symbole>EGAL</symbole>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<var>
|
||||
<id_variable>$i</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
<symbole>FOIS</symbole>
|
||||
<facteur>
|
||||
<var>
|
||||
<id_variable>$i</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</instructionAffect>
|
||||
</instruction>
|
||||
<listeInstructions>
|
||||
<instruction>
|
||||
<instructionEcriture>
|
||||
<mot_clef>ecrire</mot_clef>
|
||||
<symbole>PARENTHESE_OUVRANTE</symbole>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<var>
|
||||
<id_variable>$carre</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<symbole>PARENTHESE_FERMANTE</symbole>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</instructionEcriture>
|
||||
</instruction>
|
||||
<listeInstructions>
|
||||
<instruction>
|
||||
<instructionAffect>
|
||||
<var>
|
||||
<id_variable>$i</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
<symbole>EGAL</symbole>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<var>
|
||||
<id_variable>$i</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
<symbole>PLUS</symbole>
|
||||
<terme>
|
||||
<facteur>
|
||||
<nombre>1</nombre>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</instructionAffect>
|
||||
</instruction>
|
||||
<listeInstructions>
|
||||
</listeInstructions>
|
||||
</listeInstructions>
|
||||
</listeInstructions>
|
||||
</listeInstructions>
|
||||
<symbole>ACCOLADE_FERMANTE</symbole>
|
||||
</instructionBloc>
|
||||
</instructionTantque>
|
||||
</instruction>
|
||||
<listeInstructions>
|
||||
</listeInstructions>
|
||||
</listeInstructions>
|
||||
</listeInstructions>
|
||||
<symbole>ACCOLADE_FERMANTE</symbole>
|
||||
</instructionBloc>
|
||||
</declarationFonction>
|
||||
<listeDecFonctions>
|
||||
</listeDecFonctions>
|
||||
</listeDecFonctions>
|
||||
</programme>
|
||||
16
test/output/expression.lex
Normal file
16
test/output/expression.lex
Normal file
@@ -0,0 +1,16 @@
|
||||
entier mot_clef entier
|
||||
$a id_variable $a
|
||||
; symbole POINT_VIRGULE
|
||||
main id_fonction main
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
ecrire mot_clef ecrire
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
5 nombre 5
|
||||
* symbole FOIS
|
||||
2 nombre 2
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
; symbole POINT_VIRGULE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
symbole FIN
|
||||
77
test/output/expression.synt
Normal file
77
test/output/expression.synt
Normal file
@@ -0,0 +1,77 @@
|
||||
<programme>
|
||||
<optDecVariables>
|
||||
<listeDecVariables>
|
||||
<declarationVariable>
|
||||
<mot_clef>entier</mot_clef>
|
||||
<id_variable>$a</id_variable>
|
||||
<optTailleTableau>
|
||||
</optTailleTableau>
|
||||
</declarationVariable>
|
||||
<listeDecVariablesBis>
|
||||
</listeDecVariablesBis>
|
||||
</listeDecVariables>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</optDecVariables>
|
||||
<listeDecFonctions>
|
||||
<declarationFonction>
|
||||
<id_fonction>main</id_fonction>
|
||||
<listeParam>
|
||||
<symbole>PARENTHESE_OUVRANTE</symbole>
|
||||
<optListeDecVariables>
|
||||
</optListeDecVariables>
|
||||
<symbole>PARENTHESE_FERMANTE</symbole>
|
||||
</listeParam>
|
||||
<optDecVariables>
|
||||
</optDecVariables>
|
||||
<instructionBloc>
|
||||
<symbole>ACCOLADE_OUVRANTE</symbole>
|
||||
<listeInstructions>
|
||||
<instruction>
|
||||
<instructionEcriture>
|
||||
<mot_clef>ecrire</mot_clef>
|
||||
<symbole>PARENTHESE_OUVRANTE</symbole>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<nombre>5</nombre>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
<symbole>FOIS</symbole>
|
||||
<facteur>
|
||||
<nombre>2</nombre>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<symbole>PARENTHESE_FERMANTE</symbole>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</instructionEcriture>
|
||||
</instruction>
|
||||
<listeInstructions>
|
||||
</listeInstructions>
|
||||
</listeInstructions>
|
||||
<symbole>ACCOLADE_FERMANTE</symbole>
|
||||
</instructionBloc>
|
||||
</declarationFonction>
|
||||
<listeDecFonctions>
|
||||
</listeDecFonctions>
|
||||
</listeDecFonctions>
|
||||
</programme>
|
||||
72
test/output/max.lex
Normal file
72
test/output/max.lex
Normal file
@@ -0,0 +1,72 @@
|
||||
max id_fonction max
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
entier mot_clef entier
|
||||
$a id_variable $a
|
||||
, symbole VIRGULE
|
||||
entier mot_clef entier
|
||||
$b id_variable $b
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
si mot_clef si
|
||||
$a id_variable $a
|
||||
< symbole INFERIEUR
|
||||
$b id_variable $b
|
||||
alors mot_clef alors
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
retour mot_clef retour
|
||||
$b id_variable $b
|
||||
; symbole POINT_VIRGULE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
retour mot_clef retour
|
||||
$a id_variable $a
|
||||
; symbole POINT_VIRGULE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
main id_fonction main
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
entier mot_clef entier
|
||||
$v_1 id_variable $v_1
|
||||
, symbole VIRGULE
|
||||
entier mot_clef entier
|
||||
$v_2 id_variable $v_2
|
||||
; symbole POINT_VIRGULE
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
$v_1 id_variable $v_1
|
||||
= symbole EGAL
|
||||
lire mot_clef lire
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
; symbole POINT_VIRGULE
|
||||
$v_2 id_variable $v_2
|
||||
= symbole EGAL
|
||||
lire mot_clef lire
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
; symbole POINT_VIRGULE
|
||||
si mot_clef si
|
||||
max id_fonction max
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
$v_1 id_variable $v_1
|
||||
, symbole VIRGULE
|
||||
$v_2 id_variable $v_2
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
= symbole EGAL
|
||||
$v_1 id_variable $v_1
|
||||
alors mot_clef alors
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
ecrire mot_clef ecrire
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
$v_1 id_variable $v_1
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
; symbole POINT_VIRGULE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
sinon mot_clef sinon
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
ecrire mot_clef ecrire
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
$v_2 id_variable $v_2
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
; symbole POINT_VIRGULE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
symbole FIN
|
||||
513
test/output/max.synt
Normal file
513
test/output/max.synt
Normal file
@@ -0,0 +1,513 @@
|
||||
<programme>
|
||||
<optDecVariables>
|
||||
</optDecVariables>
|
||||
<listeDecFonctions>
|
||||
<declarationFonction>
|
||||
<id_fonction>max</id_fonction>
|
||||
<listeParam>
|
||||
<symbole>PARENTHESE_OUVRANTE</symbole>
|
||||
<optListeDecVariables>
|
||||
<listeDecVariables>
|
||||
<declarationVariable>
|
||||
<mot_clef>entier</mot_clef>
|
||||
<id_variable>$a</id_variable>
|
||||
<optTailleTableau>
|
||||
</optTailleTableau>
|
||||
</declarationVariable>
|
||||
<listeDecVariablesBis>
|
||||
<symbole>VIRGULE</symbole>
|
||||
<declarationVariable>
|
||||
<mot_clef>entier</mot_clef>
|
||||
<id_variable>$b</id_variable>
|
||||
<optTailleTableau>
|
||||
</optTailleTableau>
|
||||
</declarationVariable>
|
||||
<listeDecVariablesBis>
|
||||
</listeDecVariablesBis>
|
||||
</listeDecVariablesBis>
|
||||
</listeDecVariables>
|
||||
</optListeDecVariables>
|
||||
<symbole>PARENTHESE_FERMANTE</symbole>
|
||||
</listeParam>
|
||||
<optDecVariables>
|
||||
</optDecVariables>
|
||||
<instructionBloc>
|
||||
<symbole>ACCOLADE_OUVRANTE</symbole>
|
||||
<listeInstructions>
|
||||
<instruction>
|
||||
<instructionSi>
|
||||
<mot_clef>si</mot_clef>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<var>
|
||||
<id_variable>$a</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
<symbole>INFERIEUR</symbole>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<var>
|
||||
<id_variable>$b</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<mot_clef>alors</mot_clef>
|
||||
<instructionBloc>
|
||||
<symbole>ACCOLADE_OUVRANTE</symbole>
|
||||
<listeInstructions>
|
||||
<instruction>
|
||||
<instructionRetour>
|
||||
<mot_clef>retour</mot_clef>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<var>
|
||||
<id_variable>$b</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</instructionRetour>
|
||||
</instruction>
|
||||
<listeInstructions>
|
||||
</listeInstructions>
|
||||
</listeInstructions>
|
||||
<symbole>ACCOLADE_FERMANTE</symbole>
|
||||
</instructionBloc>
|
||||
<optSinon>
|
||||
</optSinon>
|
||||
</instructionSi>
|
||||
</instruction>
|
||||
<listeInstructions>
|
||||
<instruction>
|
||||
<instructionRetour>
|
||||
<mot_clef>retour</mot_clef>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<var>
|
||||
<id_variable>$a</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</instructionRetour>
|
||||
</instruction>
|
||||
<listeInstructions>
|
||||
</listeInstructions>
|
||||
</listeInstructions>
|
||||
</listeInstructions>
|
||||
<symbole>ACCOLADE_FERMANTE</symbole>
|
||||
</instructionBloc>
|
||||
</declarationFonction>
|
||||
<listeDecFonctions>
|
||||
<declarationFonction>
|
||||
<id_fonction>main</id_fonction>
|
||||
<listeParam>
|
||||
<symbole>PARENTHESE_OUVRANTE</symbole>
|
||||
<optListeDecVariables>
|
||||
</optListeDecVariables>
|
||||
<symbole>PARENTHESE_FERMANTE</symbole>
|
||||
</listeParam>
|
||||
<optDecVariables>
|
||||
<listeDecVariables>
|
||||
<declarationVariable>
|
||||
<mot_clef>entier</mot_clef>
|
||||
<id_variable>$v_1</id_variable>
|
||||
<optTailleTableau>
|
||||
</optTailleTableau>
|
||||
</declarationVariable>
|
||||
<listeDecVariablesBis>
|
||||
<symbole>VIRGULE</symbole>
|
||||
<declarationVariable>
|
||||
<mot_clef>entier</mot_clef>
|
||||
<id_variable>$v_2</id_variable>
|
||||
<optTailleTableau>
|
||||
</optTailleTableau>
|
||||
</declarationVariable>
|
||||
<listeDecVariablesBis>
|
||||
</listeDecVariablesBis>
|
||||
</listeDecVariablesBis>
|
||||
</listeDecVariables>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</optDecVariables>
|
||||
<instructionBloc>
|
||||
<symbole>ACCOLADE_OUVRANTE</symbole>
|
||||
<listeInstructions>
|
||||
<instruction>
|
||||
<instructionAffect>
|
||||
<var>
|
||||
<id_variable>$v_1</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
<symbole>EGAL</symbole>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<mot_clef>lire</mot_clef>
|
||||
<symbole>PARENTHESE_OUVRANTE</symbole>
|
||||
<symbole>PARENTHESE_FERMANTE</symbole>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</instructionAffect>
|
||||
</instruction>
|
||||
<listeInstructions>
|
||||
<instruction>
|
||||
<instructionAffect>
|
||||
<var>
|
||||
<id_variable>$v_2</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
<symbole>EGAL</symbole>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<mot_clef>lire</mot_clef>
|
||||
<symbole>PARENTHESE_OUVRANTE</symbole>
|
||||
<symbole>PARENTHESE_FERMANTE</symbole>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</instructionAffect>
|
||||
</instruction>
|
||||
<listeInstructions>
|
||||
<instruction>
|
||||
<instructionSi>
|
||||
<mot_clef>si</mot_clef>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<appelFct>
|
||||
<id_fonction>max</id_fonction>
|
||||
<symbole>PARENTHESE_OUVRANTE</symbole>
|
||||
<listeExpressions>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<var>
|
||||
<id_variable>$v_1</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<listeExpressionsBis>
|
||||
<symbole>VIRGULE</symbole>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<var>
|
||||
<id_variable>$v_2</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<listeExpressionsBis>
|
||||
</listeExpressionsBis>
|
||||
</listeExpressionsBis>
|
||||
</listeExpressions>
|
||||
<symbole>PARENTHESE_FERMANTE</symbole>
|
||||
</appelFct>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
<symbole>EGAL</symbole>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<var>
|
||||
<id_variable>$v_1</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<mot_clef>alors</mot_clef>
|
||||
<instructionBloc>
|
||||
<symbole>ACCOLADE_OUVRANTE</symbole>
|
||||
<listeInstructions>
|
||||
<instruction>
|
||||
<instructionEcriture>
|
||||
<mot_clef>ecrire</mot_clef>
|
||||
<symbole>PARENTHESE_OUVRANTE</symbole>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<var>
|
||||
<id_variable>$v_1</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<symbole>PARENTHESE_FERMANTE</symbole>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</instructionEcriture>
|
||||
</instruction>
|
||||
<listeInstructions>
|
||||
</listeInstructions>
|
||||
</listeInstructions>
|
||||
<symbole>ACCOLADE_FERMANTE</symbole>
|
||||
</instructionBloc>
|
||||
<optSinon>
|
||||
<mot_clef>sinon</mot_clef>
|
||||
<instructionBloc>
|
||||
<symbole>ACCOLADE_OUVRANTE</symbole>
|
||||
<listeInstructions>
|
||||
<instruction>
|
||||
<instructionEcriture>
|
||||
<mot_clef>ecrire</mot_clef>
|
||||
<symbole>PARENTHESE_OUVRANTE</symbole>
|
||||
<expression>
|
||||
<conjonction>
|
||||
<negation>
|
||||
<comparaison>
|
||||
<expArith>
|
||||
<terme>
|
||||
<facteur>
|
||||
<var>
|
||||
<id_variable>$v_2</id_variable>
|
||||
<optIndice>
|
||||
</optIndice>
|
||||
</var>
|
||||
</facteur>
|
||||
<termeBis>
|
||||
</termeBis>
|
||||
</terme>
|
||||
<expArithBis>
|
||||
</expArithBis>
|
||||
</expArith>
|
||||
<comparaisonBis>
|
||||
</comparaisonBis>
|
||||
</comparaison>
|
||||
</negation>
|
||||
<conjonctionBis>
|
||||
</conjonctionBis>
|
||||
</conjonction>
|
||||
<expressionBis>
|
||||
</expressionBis>
|
||||
</expression>
|
||||
<symbole>PARENTHESE_FERMANTE</symbole>
|
||||
<symbole>POINT_VIRGULE</symbole>
|
||||
</instructionEcriture>
|
||||
</instruction>
|
||||
<listeInstructions>
|
||||
</listeInstructions>
|
||||
</listeInstructions>
|
||||
<symbole>ACCOLADE_FERMANTE</symbole>
|
||||
</instructionBloc>
|
||||
</optSinon>
|
||||
</instructionSi>
|
||||
</instruction>
|
||||
<listeInstructions>
|
||||
</listeInstructions>
|
||||
</listeInstructions>
|
||||
</listeInstructions>
|
||||
</listeInstructions>
|
||||
<symbole>ACCOLADE_FERMANTE</symbole>
|
||||
</instructionBloc>
|
||||
</declarationFonction>
|
||||
<listeDecFonctions>
|
||||
</listeDecFonctions>
|
||||
</listeDecFonctions>
|
||||
</listeDecFonctions>
|
||||
</programme>
|
||||
271
test/output/tri.lex
Normal file
271
test/output/tri.lex
Normal file
@@ -0,0 +1,271 @@
|
||||
entier mot_clef entier
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
10 nombre 10
|
||||
] symbole CROCHET_FERMANT
|
||||
; symbole POINT_VIRGULE
|
||||
initialiser id_fonction initialiser
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
0 nombre 0
|
||||
] symbole CROCHET_FERMANT
|
||||
= symbole EGAL
|
||||
8 nombre 8
|
||||
; symbole POINT_VIRGULE
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
1 nombre 1
|
||||
] symbole CROCHET_FERMANT
|
||||
= symbole EGAL
|
||||
6 nombre 6
|
||||
; symbole POINT_VIRGULE
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
2 nombre 2
|
||||
] symbole CROCHET_FERMANT
|
||||
= symbole EGAL
|
||||
9 nombre 9
|
||||
; symbole POINT_VIRGULE
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
3 nombre 3
|
||||
] symbole CROCHET_FERMANT
|
||||
= symbole EGAL
|
||||
9 nombre 9
|
||||
; symbole POINT_VIRGULE
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
4 nombre 4
|
||||
] symbole CROCHET_FERMANT
|
||||
= symbole EGAL
|
||||
4 nombre 4
|
||||
; symbole POINT_VIRGULE
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
5 nombre 5
|
||||
] symbole CROCHET_FERMANT
|
||||
= symbole EGAL
|
||||
2 nombre 2
|
||||
; symbole POINT_VIRGULE
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
6 nombre 6
|
||||
] symbole CROCHET_FERMANT
|
||||
= symbole EGAL
|
||||
3 nombre 3
|
||||
; symbole POINT_VIRGULE
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
7 nombre 7
|
||||
] symbole CROCHET_FERMANT
|
||||
= symbole EGAL
|
||||
1 nombre 1
|
||||
; symbole POINT_VIRGULE
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
8 nombre 8
|
||||
] symbole CROCHET_FERMANT
|
||||
= symbole EGAL
|
||||
4 nombre 4
|
||||
; symbole POINT_VIRGULE
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
9 nombre 9
|
||||
] symbole CROCHET_FERMANT
|
||||
= symbole EGAL
|
||||
5 nombre 5
|
||||
; symbole POINT_VIRGULE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
afficher id_fonction afficher
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
entier mot_clef entier
|
||||
$n id_variable $n
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
entier mot_clef entier
|
||||
$i id_variable $i
|
||||
; symbole POINT_VIRGULE
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
$i id_variable $i
|
||||
= symbole EGAL
|
||||
0 nombre 0
|
||||
; symbole POINT_VIRGULE
|
||||
tantque mot_clef tantque
|
||||
$i id_variable $i
|
||||
< symbole INFERIEUR
|
||||
$n id_variable $n
|
||||
faire mot_clef faire
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
ecrire mot_clef ecrire
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
$i id_variable $i
|
||||
] symbole CROCHET_FERMANT
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
; symbole POINT_VIRGULE
|
||||
$i id_variable $i
|
||||
= symbole EGAL
|
||||
$i id_variable $i
|
||||
+ symbole PLUS
|
||||
1 nombre 1
|
||||
; symbole POINT_VIRGULE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
ecrire mot_clef ecrire
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
0 nombre 0
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
; symbole POINT_VIRGULE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
echanger id_fonction echanger
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
entier mot_clef entier
|
||||
$i id_variable $i
|
||||
, symbole VIRGULE
|
||||
entier mot_clef entier
|
||||
$j id_variable $j
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
entier mot_clef entier
|
||||
$temp id_variable $temp
|
||||
; symbole POINT_VIRGULE
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
$temp id_variable $temp
|
||||
= symbole EGAL
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
$j id_variable $j
|
||||
] symbole CROCHET_FERMANT
|
||||
; symbole POINT_VIRGULE
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
$j id_variable $j
|
||||
] symbole CROCHET_FERMANT
|
||||
= symbole EGAL
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
$i id_variable $i
|
||||
] symbole CROCHET_FERMANT
|
||||
; symbole POINT_VIRGULE
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
$i id_variable $i
|
||||
] symbole CROCHET_FERMANT
|
||||
= symbole EGAL
|
||||
$temp id_variable $temp
|
||||
; symbole POINT_VIRGULE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
trier id_fonction trier
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
entier mot_clef entier
|
||||
$n id_variable $n
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
entier mot_clef entier
|
||||
$echange id_variable $echange
|
||||
, symbole VIRGULE
|
||||
entier mot_clef entier
|
||||
$j id_variable $j
|
||||
, symbole VIRGULE
|
||||
entier mot_clef entier
|
||||
$m id_variable $m
|
||||
; symbole POINT_VIRGULE
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
$m id_variable $m
|
||||
= symbole EGAL
|
||||
$n id_variable $n
|
||||
; symbole POINT_VIRGULE
|
||||
$echange id_variable $echange
|
||||
= symbole EGAL
|
||||
1 nombre 1
|
||||
; symbole POINT_VIRGULE
|
||||
tantque mot_clef tantque
|
||||
$echange id_variable $echange
|
||||
= symbole EGAL
|
||||
1 nombre 1
|
||||
faire mot_clef faire
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
$echange id_variable $echange
|
||||
= symbole EGAL
|
||||
0 nombre 0
|
||||
; symbole POINT_VIRGULE
|
||||
$j id_variable $j
|
||||
= symbole EGAL
|
||||
0 nombre 0
|
||||
; symbole POINT_VIRGULE
|
||||
tantque mot_clef tantque
|
||||
$j id_variable $j
|
||||
< symbole INFERIEUR
|
||||
$m id_variable $m
|
||||
- symbole MOINS
|
||||
1 nombre 1
|
||||
faire mot_clef faire
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
si mot_clef si
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
$j id_variable $j
|
||||
+ symbole PLUS
|
||||
1 nombre 1
|
||||
] symbole CROCHET_FERMANT
|
||||
< symbole INFERIEUR
|
||||
$tab id_variable $tab
|
||||
[ symbole CROCHET_OUVRANT
|
||||
$j id_variable $j
|
||||
] symbole CROCHET_FERMANT
|
||||
alors mot_clef alors
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
echanger id_fonction echanger
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
$j id_variable $j
|
||||
, symbole VIRGULE
|
||||
$j id_variable $j
|
||||
+ symbole PLUS
|
||||
1 nombre 1
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
; symbole POINT_VIRGULE
|
||||
$echange id_variable $echange
|
||||
= symbole EGAL
|
||||
1 nombre 1
|
||||
; symbole POINT_VIRGULE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
$j id_variable $j
|
||||
= symbole EGAL
|
||||
$j id_variable $j
|
||||
+ symbole PLUS
|
||||
1 nombre 1
|
||||
; symbole POINT_VIRGULE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
$m id_variable $m
|
||||
= symbole EGAL
|
||||
$m id_variable $m
|
||||
- symbole MOINS
|
||||
1 nombre 1
|
||||
; symbole POINT_VIRGULE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
main id_fonction main
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
{ symbole ACCOLADE_OUVRANTE
|
||||
initialiser id_fonction initialiser
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
; symbole POINT_VIRGULE
|
||||
afficher id_fonction afficher
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
10 nombre 10
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
; symbole POINT_VIRGULE
|
||||
trier id_fonction trier
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
10 nombre 10
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
; symbole POINT_VIRGULE
|
||||
afficher id_fonction afficher
|
||||
( symbole PARENTHESE_OUVRANTE
|
||||
10 nombre 10
|
||||
) symbole PARENTHESE_FERMANTE
|
||||
; symbole POINT_VIRGULE
|
||||
} symbole ACCOLADE_FERMANTE
|
||||
symbole FIN
|
||||
2146
test/output/tri.synt
Normal file
2146
test/output/tri.synt
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user