Ajout eval final avec mips
This commit is contained in:
17
eval-fourni/Makefile
Normal file
17
eval-fourni/Makefile
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
CC = gcc
|
||||||
|
|
||||||
|
LIBS = -lm
|
||||||
|
CCFLAGS = -Wall -ggdb
|
||||||
|
|
||||||
|
all: compare_arbres_xml
|
||||||
|
|
||||||
|
compare_arbres_xml: compare_arbres_xml.c analyseur_xml.o
|
||||||
|
$(CC) $(CCFLAGS) -o compare_arbres_xml compare_arbres_xml.c analyseur_xml.o
|
||||||
|
|
||||||
|
analyseur_xml.o: analyseur_xml.c
|
||||||
|
$(CC) $(CCFLAGS) -c analyseur_xml.c
|
||||||
|
|
||||||
|
.PHONY : clean
|
||||||
|
|
||||||
|
clean:
|
||||||
|
- rm -rf *.o compare_arbres_xml output
|
||||||
BIN
eval-fourni/Mars4_5.jar
Normal file
BIN
eval-fourni/Mars4_5.jar
Normal file
Binary file not shown.
323
eval-fourni/analyseur_xml.c
Normal file
323
eval-fourni/analyseur_xml.c
Normal file
@@ -0,0 +1,323 @@
|
|||||||
|
#include<stdio.h>
|
||||||
|
#include<stdlib.h>
|
||||||
|
#include<string.h>
|
||||||
|
#include"analyseur_xml.h"
|
||||||
|
|
||||||
|
/* symboles terminaux */
|
||||||
|
|
||||||
|
#define CHEVRON_FERMANT 1
|
||||||
|
#define DEBUT_BF 2
|
||||||
|
#define DEBUT_BO 3
|
||||||
|
#define CHAINE 4
|
||||||
|
#define FIN 5
|
||||||
|
|
||||||
|
#define ISSPACE(a) (a == ' ') || (a == '\n') || (a == '\t')
|
||||||
|
|
||||||
|
#define YYTEXT_MAX 100
|
||||||
|
|
||||||
|
/* fonctions pour arbre abstrait */
|
||||||
|
|
||||||
|
noeud *cree_noeud(char *nom)
|
||||||
|
{
|
||||||
|
noeud *n = malloc(sizeof(noeud));
|
||||||
|
if(n == NULL){
|
||||||
|
fprintf(stderr, "erreur d'allocation\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
n->nom = nom;
|
||||||
|
n->premier_fils = NULL;
|
||||||
|
n->dernier_fils = NULL;
|
||||||
|
n->suiv = NULL;
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
noeud *ajoute_fils(noeud *pere, noeud *fils)
|
||||||
|
{
|
||||||
|
if(pere->premier_fils == NULL){
|
||||||
|
pere->premier_fils = pere->dernier_fils = fils;
|
||||||
|
return pere;
|
||||||
|
}
|
||||||
|
pere->dernier_fils->suiv = fils;
|
||||||
|
pere->dernier_fils = fils;
|
||||||
|
return pere;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void affiche_arbre(noeud *racine){
|
||||||
|
noeud *n;
|
||||||
|
printf("<%s> ", racine->nom);
|
||||||
|
for(n=racine->premier_fils; n!=NULL; n = n->suiv){
|
||||||
|
affiche_arbre(n);
|
||||||
|
}
|
||||||
|
printf("</%s> ", racine->nom);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int compare_arbres_rec(noeud *racine1, noeud *racine2, int verbose, int profondeur)
|
||||||
|
{
|
||||||
|
noeud *f1, *f2;
|
||||||
|
int resultat = 1;
|
||||||
|
int i;
|
||||||
|
if(verbose){
|
||||||
|
for(i=0; i<profondeur; i++) printf(" ");
|
||||||
|
printf("%s <------------> %s\n", racine1->nom, racine2->nom);
|
||||||
|
}
|
||||||
|
if(strcmp(racine1->nom, racine2->nom))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
for(f1 = racine1->premier_fils, f2 = racine2->premier_fils;
|
||||||
|
f1 && f2 && resultat;
|
||||||
|
f1 = f1->suiv, f2 = f2->suiv){
|
||||||
|
resultat = compare_arbres_rec(f1, f2, verbose, profondeur+1);
|
||||||
|
}
|
||||||
|
return ((f1 == NULL) && (f2 == NULL) && resultat);
|
||||||
|
}
|
||||||
|
|
||||||
|
int compare_arbres(noeud *racine1, noeud *racine2, int verbose)
|
||||||
|
{
|
||||||
|
return compare_arbres_rec(racine1, racine2, verbose, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void libere_arbre(noeud *racine)
|
||||||
|
{
|
||||||
|
noeud *n;
|
||||||
|
for(n=racine->premier_fils; n!=NULL; n = n->suiv){
|
||||||
|
libere_arbre(n);
|
||||||
|
}
|
||||||
|
free(racine);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* analyseur lexical */
|
||||||
|
|
||||||
|
int DEBUG = 0;
|
||||||
|
char yytext[YYTEXT_MAX];
|
||||||
|
int yyleng;
|
||||||
|
int yylval;
|
||||||
|
/* Compter les lignes pour afficher les messages d'erreur avec numero ligne */
|
||||||
|
int nb_ligne;
|
||||||
|
int cc;
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* Fonction qui ignore les espaces et commentaires.
|
||||||
|
* Renvoie -1 si arrivé à la fin du fichier, 0 si tout va bien
|
||||||
|
******************************************************************************/
|
||||||
|
int mangeEspaces()
|
||||||
|
{
|
||||||
|
char c = fgetc(yyin);
|
||||||
|
while( ISSPACE(c) ) {
|
||||||
|
if( c == '\n' ) {
|
||||||
|
nb_ligne++;
|
||||||
|
}
|
||||||
|
c = fgetc(yyin);
|
||||||
|
}
|
||||||
|
if ( feof(yyin) ) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
ungetc(c, yyin);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* Lit un caractère et le stocke dans le buffer yytext
|
||||||
|
******************************************************************************/
|
||||||
|
char lireCar(void)
|
||||||
|
{
|
||||||
|
yytext[yyleng++] = fgetc(yyin);
|
||||||
|
yytext[yyleng] = '\0';
|
||||||
|
return yytext[yyleng - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* Remet le dernier caractère lu au buffer clavier et enlève du buffer yytext
|
||||||
|
******************************************************************************/
|
||||||
|
void delireCar()
|
||||||
|
{
|
||||||
|
char c;
|
||||||
|
c = yytext[yyleng - 1];
|
||||||
|
yytext[--yyleng] = '\0';
|
||||||
|
ungetc(c, yyin);
|
||||||
|
}
|
||||||
|
/*******************************************************************************
|
||||||
|
* Fonction principale de l'analyseur lexical, lit les caractères de yyin et
|
||||||
|
* renvoie les tokens sous forme d'entier. Le code de chaque unité est défini
|
||||||
|
* dans symboles.h sinon (mot clé, idententifiant, etc.). Pour les tokens de
|
||||||
|
* type ID_FCT, ID_VAR et NOMBRE la valeur du token est dans yytext, visible
|
||||||
|
* dans l'analyseur syntaxique.
|
||||||
|
******************************************************************************/
|
||||||
|
int inTag = 0;
|
||||||
|
|
||||||
|
int yylex(void)
|
||||||
|
{
|
||||||
|
char c;
|
||||||
|
yytext[yyleng = 0] = '\0';
|
||||||
|
|
||||||
|
/* Si j'ai trouvé la fin du fichier en lisant des espaces ... */
|
||||||
|
if( !inTag && mangeEspaces() == -1 ) {
|
||||||
|
return FIN; /* Renvoie le marqueur de fin d'entrée */
|
||||||
|
}
|
||||||
|
|
||||||
|
c = lireCar();
|
||||||
|
if(c == '>'){
|
||||||
|
if(DEBUG) { printf("CHEVRON_FERMANT\n"); }
|
||||||
|
//inTag = 0;
|
||||||
|
return CHEVRON_FERMANT;
|
||||||
|
}
|
||||||
|
if(c == '<'){
|
||||||
|
inTag = 1;
|
||||||
|
c = lireCar();
|
||||||
|
if(c == '/'){
|
||||||
|
if(DEBUG) { printf("DEBUT_BF\n"); }
|
||||||
|
return DEBUT_BF;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
delireCar();
|
||||||
|
if(DEBUG) { printf("DEBUT_BO\n"); }
|
||||||
|
return DEBUT_BO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
do{
|
||||||
|
c = lireCar();
|
||||||
|
inTag = 0;
|
||||||
|
}while((c!= '<') && (c!= '>') && !feof(yyin) && !(ISSPACE(c)));
|
||||||
|
delireCar();
|
||||||
|
if(DEBUG) { printf("CHAINE\n"); }
|
||||||
|
|
||||||
|
return CHAINE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* Fonction auxiliaire appelée par l'analyseur syntaxique tout simplement pour
|
||||||
|
* afficher des messages d'erreur et l'arbre XML
|
||||||
|
******************************************************************************/
|
||||||
|
void nom_token( int token, char *nom, char *valeur ) {
|
||||||
|
//int i;
|
||||||
|
|
||||||
|
strcpy( nom, "symbole" );
|
||||||
|
if(token == CHEVRON_FERMANT) strcpy( valeur, "CHEVRON_FERMANT");
|
||||||
|
else if(token == DEBUT_BF) strcpy( valeur, "DEBUT_BF");
|
||||||
|
else if(token == DEBUT_BO) strcpy( valeur, "DEBUT_BO");
|
||||||
|
else if(token == CHAINE) strcpy( valeur, "CHAINE");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* analyse syntaxique */
|
||||||
|
|
||||||
|
noeud *B(void);
|
||||||
|
void LB(noeud *pere);
|
||||||
|
char *BO(void);
|
||||||
|
char *BF(void);
|
||||||
|
void LCHAINE(void);
|
||||||
|
|
||||||
|
void erreur(char *msg){
|
||||||
|
fprintf(stderr, "Ligne %d : erreur : %s\n", nb_ligne, msg);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* B -> BO LCHAINE LB LCHAINE BF */
|
||||||
|
noeud *B(void){
|
||||||
|
char *nom_bo;
|
||||||
|
char *nom_bf;
|
||||||
|
noeud *n;
|
||||||
|
if(DEBUG) { printf("<B>\n"); }
|
||||||
|
if(cc == DEBUT_BO){
|
||||||
|
nom_bo = BO();
|
||||||
|
n = cree_noeud(nom_bo);
|
||||||
|
LCHAINE();
|
||||||
|
LB(n);
|
||||||
|
LCHAINE();
|
||||||
|
nom_bf = BF();
|
||||||
|
if(strcmp(nom_bo, nom_bf)){
|
||||||
|
fprintf(stderr, "Ligne %d : arbre mal forme: balise ouvrante : \"%s\" balise fermante : \"%s\"\n", nb_ligne, nom_bo, nom_bf);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
free(nom_bf);
|
||||||
|
if(DEBUG) { printf("</B>\n"); }
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
erreur("B");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* LCHAINE -> CHAINE LCHAINE */
|
||||||
|
/* | */
|
||||||
|
|
||||||
|
void LCHAINE(void){
|
||||||
|
if(cc == CHAINE){
|
||||||
|
cc = yylex();
|
||||||
|
LCHAINE();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if((cc == DEBUT_BO) ||(cc == DEBUT_BF)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
erreur("LCHAINE");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* LB -> B LB
|
||||||
|
| */
|
||||||
|
|
||||||
|
void LB(noeud *pere)
|
||||||
|
{
|
||||||
|
noeud *fils = NULL;
|
||||||
|
if(cc == DEBUT_BO){
|
||||||
|
fils = B();
|
||||||
|
ajoute_fils(pere, fils);
|
||||||
|
LB(pere);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(cc == DEBUT_BF){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
erreur("LB");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* BO -> DEBUT_BO CHAINE CHEVRON_FERMANT */
|
||||||
|
char *BO(void)
|
||||||
|
{
|
||||||
|
char *nom = NULL;
|
||||||
|
if(DEBUG) { printf("<BO>\n"); }
|
||||||
|
if(cc == DEBUT_BO){
|
||||||
|
cc = yylex();
|
||||||
|
if(cc == CHAINE){
|
||||||
|
nom = strdup(yytext);
|
||||||
|
cc = yylex();
|
||||||
|
if(cc == CHEVRON_FERMANT){
|
||||||
|
cc = yylex();
|
||||||
|
if(DEBUG) { printf("</BO>\n"); }
|
||||||
|
return nom;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
erreur("BO");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* BF -> DEBUT_BF CHAINE CHEVRON_FERMANT */
|
||||||
|
char *BF(void)
|
||||||
|
{
|
||||||
|
char *nom = NULL;
|
||||||
|
if(cc == DEBUT_BF){
|
||||||
|
cc = yylex();
|
||||||
|
if(cc == CHAINE){
|
||||||
|
nom = strdup(yytext);
|
||||||
|
cc = yylex();
|
||||||
|
if(cc == CHEVRON_FERMANT){
|
||||||
|
cc = yylex();
|
||||||
|
return nom;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
erreur("BF");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
noeud *analyseur_xml(void)
|
||||||
|
{
|
||||||
|
nb_ligne = 0;
|
||||||
|
cc = yylex();
|
||||||
|
return B();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
25
eval-fourni/analyseur_xml.h
Normal file
25
eval-fourni/analyseur_xml.h
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#ifndef __ANALYSEUR_XML__
|
||||||
|
#define __ANALYSEUR_XML__
|
||||||
|
|
||||||
|
/* structures de donnees et fonctions pour arbre abstrait */
|
||||||
|
|
||||||
|
typedef struct n noeud;
|
||||||
|
|
||||||
|
struct n{
|
||||||
|
char *nom;
|
||||||
|
struct n *premier_fils;
|
||||||
|
struct n *dernier_fils;
|
||||||
|
struct n *suiv;
|
||||||
|
};
|
||||||
|
|
||||||
|
FILE *yyin;
|
||||||
|
|
||||||
|
|
||||||
|
void affiche_arbre(noeud *racine);
|
||||||
|
int compare_arbres(noeud *racine1, noeud *racine2, int verbose);
|
||||||
|
void libere_arbre(noeud *r);
|
||||||
|
|
||||||
|
/* analyseur */
|
||||||
|
|
||||||
|
noeud *analyseur_xml(void);
|
||||||
|
#endif
|
||||||
BIN
eval-fourni/compare_arbres_xml
Executable file
BIN
eval-fourni/compare_arbres_xml
Executable file
Binary file not shown.
63
eval-fourni/compare_arbres_xml.c
Normal file
63
eval-fourni/compare_arbres_xml.c
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
#include<stdio.h>
|
||||||
|
#include<stdlib.h>
|
||||||
|
#include"analyseur_xml.h"
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
noeud *racine1;
|
||||||
|
noeud *racine2;
|
||||||
|
int resultat;
|
||||||
|
int verbose;
|
||||||
|
|
||||||
|
if((argc != 3) && (argc != 4)){
|
||||||
|
fprintf(stderr, "usage: %s fichier_xml fichier_xml [v]\n", argv[0]);
|
||||||
|
exit(1);
|
||||||
|
|
||||||
|
}
|
||||||
|
verbose = (argc == 4);
|
||||||
|
|
||||||
|
yyin = fopen(argv[1], "r");
|
||||||
|
if(yyin == NULL){
|
||||||
|
fprintf(stderr, "impossible d'ouvrir le fichier %s\n", argv[1]);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(stderr, "analyse du fichier : %s\n", argv[1]);
|
||||||
|
racine1 = analyseur_xml();
|
||||||
|
|
||||||
|
|
||||||
|
fclose(yyin);
|
||||||
|
|
||||||
|
yyin = fopen(argv[2], "r");
|
||||||
|
if(yyin == NULL){
|
||||||
|
fprintf(stderr, "impossible d'ouvrir le fichier %s\n", argv[2]);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(stderr, "analyse du fichier : %s\n", argv[2]);
|
||||||
|
racine2 = analyseur_xml();
|
||||||
|
|
||||||
|
fclose(yyin);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* affiche_arbre(racine1);
|
||||||
|
printf("\n");
|
||||||
|
affiche_arbre(racine2);*/
|
||||||
|
|
||||||
|
fprintf(stderr, "comparaison des arbres\n");
|
||||||
|
resultat = compare_arbres(racine1, racine2, verbose);
|
||||||
|
libere_arbre(racine1);
|
||||||
|
libere_arbre(racine2);
|
||||||
|
|
||||||
|
|
||||||
|
if(resultat){
|
||||||
|
printf("arbres egaux\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
printf("arbres différents\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
7
eval-fourni/input/affect-err.l
Normal file
7
eval-fourni/input/affect-err.l
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
entier $a;
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
$a = 5;
|
||||||
|
ecrire( $a );
|
||||||
|
}
|
||||||
|
$extra = 0;
|
||||||
6
eval-fourni/input/affect.l
Normal file
6
eval-fourni/input/affect.l
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
entier $a;
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
$a = 1;
|
||||||
|
ecrire($a);
|
||||||
|
}
|
||||||
11
eval-fourni/input/boucle.l
Normal file
11
eval-fourni/input/boucle.l
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
entier $i, entier $carre;
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
$i = 0;
|
||||||
|
tantque $i < 10 faire
|
||||||
|
{
|
||||||
|
$carre = $i * $i;
|
||||||
|
ecrire( $carre );
|
||||||
|
$i = $i + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
25
eval-fourni/input/eval1.l
Normal file
25
eval-fourni/input/eval1.l
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
add (entier $a, entier $b)
|
||||||
|
{
|
||||||
|
retour $a + $b;
|
||||||
|
}
|
||||||
|
|
||||||
|
mult (entier $a, entier $b)
|
||||||
|
{
|
||||||
|
retour $a * $b;
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
entier $a, entier $b, entier $op;
|
||||||
|
{
|
||||||
|
$a = lire();
|
||||||
|
$b = lire();
|
||||||
|
$op = lire();
|
||||||
|
si $op = 1 alors {
|
||||||
|
ecrire(add($a, $b));
|
||||||
|
}
|
||||||
|
sinon {
|
||||||
|
si $op = 2 alors {
|
||||||
|
ecrire(mult($a, $b));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1
eval-fourni/input/eval1err.l
Normal file
1
eval-fourni/input/eval1err.l
Normal file
@@ -0,0 +1 @@
|
|||||||
|
33a
|
||||||
14
eval-fourni/input/eval2.l
Normal file
14
eval-fourni/input/eval2.l
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
fibo( entier $n )
|
||||||
|
{
|
||||||
|
si $n < 2 alors {
|
||||||
|
retour 1;
|
||||||
|
}
|
||||||
|
sinon {
|
||||||
|
retour fibo( $n - 1 ) + fibo( $n - 2 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
ecrire( fibo( lire() ) );
|
||||||
|
}
|
||||||
7
eval-fourni/input/eval2err.l
Normal file
7
eval-fourni/input/eval2err.l
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
entier $a;
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
$a = 5;
|
||||||
|
ecrire( $a );
|
||||||
|
}
|
||||||
|
$extra = 0;
|
||||||
12
eval-fourni/input/eval3.l
Normal file
12
eval-fourni/input/eval3.l
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
entier $i, entier $j, entier $k, entier $somme;
|
||||||
|
main() {
|
||||||
|
$somme = 0;
|
||||||
|
pour $i = 0; $i < 10; $i = $i + 1; faire {
|
||||||
|
pour $j = 0; $j < $i; $j = $j + 1; faire {
|
||||||
|
pour $k = 0; $k < $j; $k = $k + 1; faire {
|
||||||
|
$somme = $somme + $i + $j + $k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ecrire ( $somme );
|
||||||
|
}
|
||||||
12
eval-fourni/input/eval3err.l
Normal file
12
eval-fourni/input/eval3err.l
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
entier $i;
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
entier $carre;
|
||||||
|
$i = 0;
|
||||||
|
tantque $i < 10 faire
|
||||||
|
{
|
||||||
|
$carre = $i * $i;
|
||||||
|
ecrire( $carre );
|
||||||
|
$i = $i + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
7
eval-fourni/input/eval4.l
Normal file
7
eval-fourni/input/eval4.l
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
entier $a;
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
si 1 alors
|
||||||
|
{ecrire(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
1
eval-fourni/input/eval4err.l
Normal file
1
eval-fourni/input/eval4err.l
Normal file
@@ -0,0 +1 @@
|
|||||||
|
entier entier entier
|
||||||
9
eval-fourni/input/eval5.l
Normal file
9
eval-fourni/input/eval5.l
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
entier $a;
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
si 0 alors
|
||||||
|
{ecrire(1);
|
||||||
|
}
|
||||||
|
sinon
|
||||||
|
{ecrire(0);}
|
||||||
|
}
|
||||||
1
eval-fourni/input/eval5err.l
Normal file
1
eval-fourni/input/eval5err.l
Normal file
@@ -0,0 +1 @@
|
|||||||
|
entier ?
|
||||||
11
eval-fourni/input/eval6.l
Normal file
11
eval-fourni/input/eval6.l
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
entier $a[10], entier $b;
|
||||||
|
main() {
|
||||||
|
$a[0] = 10;
|
||||||
|
$b = 5;
|
||||||
|
ecrire( $a ); # erreur de type ou ecrit 10?
|
||||||
|
ecrire( $a + 1 ); # erreur de type ou ecrit 11?
|
||||||
|
ecrire( $b[0] ); # erreur de type ou ecrit 5?
|
||||||
|
ecrire( $a[10] ); # erreur de type ou ecrit 5?
|
||||||
|
retour 0;
|
||||||
|
ecrire( $b ); # ecrit 5 ou pas?
|
||||||
|
}
|
||||||
0
eval-fourni/input/eval7.l
Normal file
0
eval-fourni/input/eval7.l
Normal file
9
eval-fourni/input/eval8.l
Normal file
9
eval-fourni/input/eval8.l
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
entier $a;
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
$a = 0;
|
||||||
|
tantque $a < 10 faire{
|
||||||
|
ecrire($a);
|
||||||
|
$a = $a + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
5
eval-fourni/input/expression.l
Normal file
5
eval-fourni/input/expression.l
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
entier $a;
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
ecrire(5 * 2);
|
||||||
|
}
|
||||||
23
eval-fourni/input/max.l
Normal file
23
eval-fourni/input/max.l
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
max( entier $a, entier $b )
|
||||||
|
{
|
||||||
|
si $a < $b alors {
|
||||||
|
retour $b;
|
||||||
|
}
|
||||||
|
retour $a;
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
entier $v_1, entier $v_2;
|
||||||
|
{
|
||||||
|
$v_1 = lire();
|
||||||
|
$v_2 = lire();
|
||||||
|
si max( $v_1, $v_2 ) = $v_1 alors
|
||||||
|
{
|
||||||
|
ecrire( $v_1 );
|
||||||
|
}
|
||||||
|
sinon
|
||||||
|
{
|
||||||
|
ecrire( $v_2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
8
eval-fourni/input/test1.l
Normal file
8
eval-fourni/input/test1.l
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
entier $a;
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
pour $a=1; $a<10; $a = $a + 1; faire
|
||||||
|
{
|
||||||
|
ecrire( $a );
|
||||||
|
}
|
||||||
|
}
|
||||||
6
eval-fourni/input/test1err.l
Normal file
6
eval-fourni/input/test1err.l
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
entier $i;
|
||||||
|
main() {
|
||||||
|
pour $i = 5; $i < 10; $i faire {
|
||||||
|
ecrire ( $i );
|
||||||
|
}
|
||||||
|
}
|
||||||
8
eval-fourni/input/test2.l
Normal file
8
eval-fourni/input/test2.l
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
entier $a;
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
pour $a=1; $a<10; $a = $a + 1; faire
|
||||||
|
{
|
||||||
|
ecrire( $a );
|
||||||
|
}
|
||||||
|
}
|
||||||
8
eval-fourni/input/test3.l
Normal file
8
eval-fourni/input/test3.l
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
entier $a;
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
pour $a=1; $a<10; $a = $a + 1; faire
|
||||||
|
{
|
||||||
|
ecrire( $a );
|
||||||
|
}
|
||||||
|
}
|
||||||
57
eval-fourni/input/tri.l
Normal file
57
eval-fourni/input/tri.l
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
entier $tab[ 10 ];
|
||||||
|
|
||||||
|
initialiser()
|
||||||
|
{
|
||||||
|
$tab[0] = 8; $tab[1] = 6; $tab[2] = 9;
|
||||||
|
$tab[3] = 9; $tab[4] = 4; $tab[5] = 2;
|
||||||
|
$tab[6] = 3; $tab[7] = 1; $tab[8] = 4;
|
||||||
|
$tab[9] = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
afficher( entier $n )
|
||||||
|
entier $i;
|
||||||
|
{
|
||||||
|
$i = 0;
|
||||||
|
tantque $i < $n faire {
|
||||||
|
ecrire( $tab[ $i ] );
|
||||||
|
$i = $i + 1;
|
||||||
|
}
|
||||||
|
ecrire( 0 ); # marqueur fin de tableau
|
||||||
|
}
|
||||||
|
|
||||||
|
echanger( entier $i, entier $j )
|
||||||
|
entier $temp;
|
||||||
|
{
|
||||||
|
$temp = $tab[ $j ];
|
||||||
|
$tab[ $j ] = $tab[ $i ];
|
||||||
|
$tab[ $i ] = $temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
trier( entier $n )
|
||||||
|
entier $echange, entier $j, entier $m;
|
||||||
|
{
|
||||||
|
$m = $n;
|
||||||
|
$echange = 1;
|
||||||
|
tantque $echange = 1 faire
|
||||||
|
{
|
||||||
|
$echange = 0;
|
||||||
|
$j = 0;
|
||||||
|
tantque $j < $m - 1 faire
|
||||||
|
{
|
||||||
|
si $tab[ $j + 1 ] < $tab[ $j ] alors {
|
||||||
|
echanger( $j, $j + 1 );
|
||||||
|
$echange = 1;
|
||||||
|
}
|
||||||
|
$j = $j + 1;
|
||||||
|
}
|
||||||
|
$m = $m - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
initialiser();
|
||||||
|
afficher( 10 );
|
||||||
|
trier( 10 );
|
||||||
|
afficher( 10 );
|
||||||
|
}
|
||||||
23
eval-fourni/output/affect.asynt
Normal file
23
eval-fourni/output/affect.asynt
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<prog>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$a</varDec>
|
||||||
|
</l_dec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
main
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$a</var_simple>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_ecrire>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$a</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</instr_ecrire>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
</l_dec>
|
||||||
|
</prog>
|
||||||
18
eval-fourni/output/affect.lex
Normal file
18
eval-fourni/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
|
||||||
36
eval-fourni/output/affect.mips
Normal file
36
eval-fourni/output/affect.mips
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
.data
|
||||||
|
$$a: .space 4
|
||||||
|
.text
|
||||||
|
__start:
|
||||||
|
jal main
|
||||||
|
li $v0, 10
|
||||||
|
syscall
|
||||||
|
main :
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, $$a
|
||||||
|
lw $t0, $$a
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
move $a0, $t0
|
||||||
|
li $v0, 1
|
||||||
|
syscall
|
||||||
|
li $a0, '\n'
|
||||||
|
li $v0, 11
|
||||||
|
syscall
|
||||||
|
addi $sp, $sp 0 # desallocation variables locales
|
||||||
|
lw $ra, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
113
eval-fourni/output/affect.synt
Normal file
113
eval-fourni/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>
|
||||||
6
eval-fourni/output/affect.tab
Normal file
6
eval-fourni/output/affect.tab
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
------------------------------------------
|
||||||
|
base = 2
|
||||||
|
sommet = 2
|
||||||
|
0 $a GLOBALE ENTIER 0 -1
|
||||||
|
1 main GLOBALE FONCTION 0 0
|
||||||
|
------------------------------------------
|
||||||
63
eval-fourni/output/boucle.asynt
Normal file
63
eval-fourni/output/boucle.asynt
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<prog>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$i</varDec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$carre</varDec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
main
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
<intExp>0</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_tantque>
|
||||||
|
<opExp>
|
||||||
|
inf
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>10</intExp>
|
||||||
|
</opExp>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$carre</var_simple>
|
||||||
|
<opExp>
|
||||||
|
fois
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</opExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_ecrire>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$carre</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</instr_ecrire>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
<opExp>
|
||||||
|
plus
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</opExp>
|
||||||
|
</instr_affect>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</instr_tantque>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
</l_dec>
|
||||||
|
</prog>
|
||||||
40
eval-fourni/output/boucle.lex
Normal file
40
eval-fourni/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
|
||||||
92
eval-fourni/output/boucle.mips
Normal file
92
eval-fourni/output/boucle.mips
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
.data
|
||||||
|
$$i: .space 4
|
||||||
|
$$carre: .space 4
|
||||||
|
.text
|
||||||
|
__start:
|
||||||
|
jal main
|
||||||
|
li $v0, 10
|
||||||
|
syscall
|
||||||
|
main :
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
li $t0, 0
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, $$i
|
||||||
|
e0:
|
||||||
|
lw $t0, $$i
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 10
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t2, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t1, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $t0, 1
|
||||||
|
blt $t1, $t2 e2
|
||||||
|
li $t0, 0
|
||||||
|
e2:
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
beq $t0 $0 e1
|
||||||
|
lw $t0, $$i
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, $$i
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t2, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t1, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
mult $t1, $t2
|
||||||
|
mflo $t0
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, $$carre
|
||||||
|
lw $t0, $$carre
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
move $a0, $t0
|
||||||
|
li $v0, 1
|
||||||
|
syscall
|
||||||
|
li $a0, '\n'
|
||||||
|
li $v0, 11
|
||||||
|
syscall
|
||||||
|
lw $t0, $$i
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t2, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t1, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t1, $t2
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, $$i
|
||||||
|
j e0
|
||||||
|
e1:
|
||||||
|
addi $sp, $sp 0 # desallocation variables locales
|
||||||
|
lw $ra, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
283
eval-fourni/output/boucle.synt
Normal file
283
eval-fourni/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>
|
||||||
7
eval-fourni/output/boucle.tab
Normal file
7
eval-fourni/output/boucle.tab
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
------------------------------------------
|
||||||
|
base = 3
|
||||||
|
sommet = 3
|
||||||
|
0 $i GLOBALE ENTIER 0 -1
|
||||||
|
1 $carre GLOBALE ENTIER 4 -1
|
||||||
|
2 main GLOBALE FONCTION 0 0
|
||||||
|
------------------------------------------
|
||||||
19
eval-fourni/output/expression.asynt
Normal file
19
eval-fourni/output/expression.asynt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<prog>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$a</varDec>
|
||||||
|
</l_dec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
main
|
||||||
|
<l_instr>
|
||||||
|
<instr_ecrire>
|
||||||
|
<opExp>
|
||||||
|
fois
|
||||||
|
<intExp>5</intExp>
|
||||||
|
<intExp>2</intExp>
|
||||||
|
</opExp>
|
||||||
|
</instr_ecrire>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
</l_dec>
|
||||||
|
</prog>
|
||||||
16
eval-fourni/output/expression.lex
Normal file
16
eval-fourni/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
|
||||||
41
eval-fourni/output/expression.mips
Normal file
41
eval-fourni/output/expression.mips
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
.data
|
||||||
|
$$a: .space 4
|
||||||
|
.text
|
||||||
|
__start:
|
||||||
|
jal main
|
||||||
|
li $v0, 10
|
||||||
|
syscall
|
||||||
|
main :
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
li $t0, 5
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 2
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t2, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t1, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
mult $t1, $t2
|
||||||
|
mflo $t0
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
move $a0, $t0
|
||||||
|
li $v0, 1
|
||||||
|
syscall
|
||||||
|
li $a0, '\n'
|
||||||
|
li $v0, 11
|
||||||
|
syscall
|
||||||
|
addi $sp, $sp 0 # desallocation variables locales
|
||||||
|
lw $ra, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
77
eval-fourni/output/expression.synt
Normal file
77
eval-fourni/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>
|
||||||
6
eval-fourni/output/expression.tab
Normal file
6
eval-fourni/output/expression.tab
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
------------------------------------------
|
||||||
|
base = 2
|
||||||
|
sommet = 2
|
||||||
|
0 $a GLOBALE ENTIER 0 -1
|
||||||
|
1 main GLOBALE FONCTION 0 0
|
||||||
|
------------------------------------------
|
||||||
106
eval-fourni/output/max.asynt
Normal file
106
eval-fourni/output/max.asynt
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
<prog>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
max
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$a</varDec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$b</varDec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
<l_instr>
|
||||||
|
<instr_si>
|
||||||
|
<opExp>
|
||||||
|
inf
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$a</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$b</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</opExp>
|
||||||
|
<l_instr>
|
||||||
|
<instr_retour>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$b</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</instr_retour>
|
||||||
|
</l_instr>
|
||||||
|
</instr_si>
|
||||||
|
<l_instr>
|
||||||
|
<instr_retour>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$a</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</instr_retour>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
main
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$v_1</varDec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$v_2</varDec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$v_1</var_simple>
|
||||||
|
<lireExp>
|
||||||
|
</lireExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$v_2</var_simple>
|
||||||
|
<lireExp>
|
||||||
|
</lireExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_si>
|
||||||
|
<opExp>
|
||||||
|
egal
|
||||||
|
<appelExp>
|
||||||
|
<appel>
|
||||||
|
max
|
||||||
|
<l_exp>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$v_1</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<l_exp>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$v_2</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</appel>
|
||||||
|
</appelExp>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$v_1</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</opExp>
|
||||||
|
<l_instr>
|
||||||
|
<instr_ecrire>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$v_1</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</instr_ecrire>
|
||||||
|
</l_instr>
|
||||||
|
<l_instr>
|
||||||
|
<instr_ecrire>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$v_2</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</instr_ecrire>
|
||||||
|
</l_instr>
|
||||||
|
</instr_si>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
</prog>
|
||||||
72
eval-fourni/output/max.lex
Normal file
72
eval-fourni/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
|
||||||
142
eval-fourni/output/max.mips
Normal file
142
eval-fourni/output/max.mips
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
.data
|
||||||
|
.text
|
||||||
|
__start:
|
||||||
|
jal main
|
||||||
|
li $v0, 10
|
||||||
|
syscall
|
||||||
|
max :
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
lw $t0, 8($fp) #variable argument $a
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 4($fp) #variable argument $b
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t2, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t1, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $t0, 1
|
||||||
|
blt $t1, $t2 e0
|
||||||
|
li $t0, 0
|
||||||
|
e0:
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
beq $t0 $zero e1
|
||||||
|
lw $t0, 4($fp) #variable argument $b
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0 12($fp) #Adresse de retour
|
||||||
|
lw $ra, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
|
j e2
|
||||||
|
e1:
|
||||||
|
e2:
|
||||||
|
lw $t0, 8($fp) #variable argument $a
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0 12($fp) #Adresse de retour
|
||||||
|
lw $ra, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
|
addi $sp, $sp 0 # desallocation variables locales
|
||||||
|
lw $ra, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
|
main :
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
li $v0 5
|
||||||
|
syscall
|
||||||
|
move $t0, $v0
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, -8($fp) #variable locale
|
||||||
|
li $v0 5
|
||||||
|
syscall
|
||||||
|
move $t0, $v0
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, -12($fp) #variable locale
|
||||||
|
sub $sp, $sp, 4 #Val Retour
|
||||||
|
lw $t0, -8($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, -12($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
jal max
|
||||||
|
addi $sp, $sp, 8
|
||||||
|
lw $t0, -8($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t2, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t1, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $t0, 1
|
||||||
|
beq $t1, $t2 e3
|
||||||
|
li $t0, 0
|
||||||
|
e3:
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
beq $t0 $zero e4
|
||||||
|
lw $t0, -8($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
move $a0, $t0
|
||||||
|
li $v0, 1
|
||||||
|
syscall
|
||||||
|
li $a0, '\n'
|
||||||
|
li $v0, 11
|
||||||
|
syscall
|
||||||
|
j e5
|
||||||
|
e4:
|
||||||
|
lw $t0, -12($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
move $a0, $t0
|
||||||
|
li $v0, 1
|
||||||
|
syscall
|
||||||
|
li $a0, '\n'
|
||||||
|
li $v0, 11
|
||||||
|
syscall
|
||||||
|
e5:
|
||||||
|
addi $sp, $sp 8 # desallocation variables locales
|
||||||
|
lw $ra, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
513
eval-fourni/output/max.synt
Normal file
513
eval-fourni/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>
|
||||||
15
eval-fourni/output/max.tab
Normal file
15
eval-fourni/output/max.tab
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
------------------------------------------
|
||||||
|
base = 1
|
||||||
|
sommet = 3
|
||||||
|
0 max GLOBALE FONCTION 0 2
|
||||||
|
1 $a ARGUMENT ENTIER 0 -1
|
||||||
|
2 $b ARGUMENT ENTIER 4 -1
|
||||||
|
------------------------------------------
|
||||||
|
------------------------------------------
|
||||||
|
base = 2
|
||||||
|
sommet = 4
|
||||||
|
0 max GLOBALE FONCTION 0 2
|
||||||
|
1 main GLOBALE FONCTION 0 0
|
||||||
|
2 $v_1 LOCALE ENTIER 0 -1
|
||||||
|
3 $v_2 LOCALE ENTIER 4 -1
|
||||||
|
------------------------------------------
|
||||||
418
eval-fourni/output/tri.asynt
Normal file
418
eval-fourni/output/tri.asynt
Normal file
@@ -0,0 +1,418 @@
|
|||||||
|
<prog>
|
||||||
|
<l_dec>
|
||||||
|
<tabDec>$tab[10]</tabDec>
|
||||||
|
</l_dec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
initialiser
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>0</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>8</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>6</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>2</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>9</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>3</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>9</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>4</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>4</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>5</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>2</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>6</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>3</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>7</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>8</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>4</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>9</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>5</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
afficher
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$n</varDec>
|
||||||
|
</l_dec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$i</varDec>
|
||||||
|
</l_dec>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
<intExp>0</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_tantque>
|
||||||
|
<opExp>
|
||||||
|
inf
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$n</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</opExp>
|
||||||
|
<l_instr>
|
||||||
|
<instr_ecrire>
|
||||||
|
<varExp>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</var_indicee>
|
||||||
|
</varExp>
|
||||||
|
</instr_ecrire>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
<opExp>
|
||||||
|
plus
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</opExp>
|
||||||
|
</instr_affect>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</instr_tantque>
|
||||||
|
<l_instr>
|
||||||
|
<instr_ecrire>
|
||||||
|
<intExp>0</intExp>
|
||||||
|
</instr_ecrire>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
echanger
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$i</varDec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$j</varDec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$temp</varDec>
|
||||||
|
</l_dec>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$temp</var_simple>
|
||||||
|
<varExp>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</var_indicee>
|
||||||
|
</varExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</var_indicee>
|
||||||
|
<varExp>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</var_indicee>
|
||||||
|
</varExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</var_indicee>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$temp</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</instr_affect>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
trier
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$n</varDec>
|
||||||
|
</l_dec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$echange</varDec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$j</varDec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$m</varDec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$m</var_simple>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$n</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$echange</var_simple>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_tantque>
|
||||||
|
<opExp>
|
||||||
|
egal
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$echange</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</opExp>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$echange</var_simple>
|
||||||
|
<intExp>0</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
<intExp>0</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_tantque>
|
||||||
|
<opExp>
|
||||||
|
inf
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<opExp>
|
||||||
|
moins
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$m</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</opExp>
|
||||||
|
</opExp>
|
||||||
|
<l_instr>
|
||||||
|
<instr_si>
|
||||||
|
<opExp>
|
||||||
|
inf
|
||||||
|
<varExp>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<opExp>
|
||||||
|
plus
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</opExp>
|
||||||
|
</var_indicee>
|
||||||
|
</varExp>
|
||||||
|
<varExp>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</var_indicee>
|
||||||
|
</varExp>
|
||||||
|
</opExp>
|
||||||
|
<l_instr>
|
||||||
|
<instr_appel>
|
||||||
|
<appel>
|
||||||
|
echanger
|
||||||
|
<l_exp>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<l_exp>
|
||||||
|
<opExp>
|
||||||
|
plus
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</opExp>
|
||||||
|
<l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</appel>
|
||||||
|
</instr_appel>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$echange</var_simple>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</instr_si>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
<opExp>
|
||||||
|
plus
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</opExp>
|
||||||
|
</instr_affect>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</instr_tantque>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$m</var_simple>
|
||||||
|
<opExp>
|
||||||
|
moins
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$m</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</opExp>
|
||||||
|
</instr_affect>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</instr_tantque>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
main
|
||||||
|
<l_instr>
|
||||||
|
<instr_appel>
|
||||||
|
<appel>
|
||||||
|
initialiser
|
||||||
|
<l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</appel>
|
||||||
|
</instr_appel>
|
||||||
|
<l_instr>
|
||||||
|
<instr_appel>
|
||||||
|
<appel>
|
||||||
|
afficher
|
||||||
|
<l_exp>
|
||||||
|
<intExp>10</intExp>
|
||||||
|
<l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</appel>
|
||||||
|
</instr_appel>
|
||||||
|
<l_instr>
|
||||||
|
<instr_appel>
|
||||||
|
<appel>
|
||||||
|
trier
|
||||||
|
<l_exp>
|
||||||
|
<intExp>10</intExp>
|
||||||
|
<l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</appel>
|
||||||
|
</instr_appel>
|
||||||
|
<l_instr>
|
||||||
|
<instr_appel>
|
||||||
|
<appel>
|
||||||
|
afficher
|
||||||
|
<l_exp>
|
||||||
|
<intExp>10</intExp>
|
||||||
|
<l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</appel>
|
||||||
|
</instr_appel>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
</prog>
|
||||||
271
eval-fourni/output/tri.lex
Normal file
271
eval-fourni/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
|
||||||
455
eval-fourni/output/tri.mips
Normal file
455
eval-fourni/output/tri.mips
Normal file
@@ -0,0 +1,455 @@
|
|||||||
|
.data
|
||||||
|
$$tab: .space 40
|
||||||
|
.text
|
||||||
|
__start:
|
||||||
|
jal main
|
||||||
|
li $v0, 10
|
||||||
|
syscall
|
||||||
|
initialiser :
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
li $t0, 0
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 8
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0,
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 6
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0,
|
||||||
|
li $t0, 2
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 9
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
li $t0, 3
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 9
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, P`ǁ<>
|
||||||
|
li $t0, 4
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 4
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, <01><><EFBFBD>
|
||||||
|
li $t0, 5
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 2
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0,
|
||||||
|
li $t0, 6
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 3
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, @^ǁ<>
|
||||||
|
li $t0, 7
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0,
|
||||||
|
li $t0, 8
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 4
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, sw $t0,
|
||||||
|
li $t0, 9
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 5
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, sw $t0,
|
||||||
|
addi $sp, $sp 0 # desallocation variables locales
|
||||||
|
lw $ra, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
|
afficher :
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
li $t0, 0
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, -8($fp) #variable locale
|
||||||
|
e0:
|
||||||
|
lw $t0, -8($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 4($fp) #variable argument $n
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t2, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t1, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $t0, 1
|
||||||
|
blt $t1, $t2 e2
|
||||||
|
li $t0, 0
|
||||||
|
e2:
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
beq $t0 $0 e1
|
||||||
|
lw $t0, -8($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0,
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
move $a0, $t0
|
||||||
|
li $v0, 1
|
||||||
|
syscall
|
||||||
|
li $a0, '\n'
|
||||||
|
li $v0, 11
|
||||||
|
syscall
|
||||||
|
lw $t0, -8($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t2, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t1, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t1, $t2
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, -8($fp) #variable locale
|
||||||
|
j e0
|
||||||
|
e1:
|
||||||
|
li $t0, 0
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
move $a0, $t0
|
||||||
|
li $v0, 1
|
||||||
|
syscall
|
||||||
|
li $a0, '\n'
|
||||||
|
li $v0, 11
|
||||||
|
syscall
|
||||||
|
addi $sp, $sp 0 # desallocation variables locales
|
||||||
|
lw $ra, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
|
echanger :
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
lw $t0, 4($fp) #variable argument $j
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, ]ǁ<>
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, -8($fp) #variable locale
|
||||||
|
lw $t0, 4($fp) #variable argument $j
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 8($fp) #variable argument $i
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0,
|
||||||
|
lw $t0, 8($fp) #variable argument $i
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, -8($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, $<24>@
|
||||||
|
addi $sp, $sp 0 # desallocation variables locales
|
||||||
|
lw $ra, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
|
trier :
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
lw $t0, 4($fp) #variable argument $n
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, -16($fp) #variable locale
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, -8($fp) #variable locale
|
||||||
|
e3:
|
||||||
|
lw $t0, -8($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t2, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t1, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $t0, 1
|
||||||
|
beq $t1, $t2 e5
|
||||||
|
li $t0, 0
|
||||||
|
e5:
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
beq $t0 $0 e4
|
||||||
|
li $t0, 0
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, -8($fp) #variable locale
|
||||||
|
li $t0, 0
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, -12($fp) #variable locale
|
||||||
|
e6:
|
||||||
|
lw $t0, -12($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, -16($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t2, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t1, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sub $t0, $t1, $t2
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t2, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t1, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $t0, 1
|
||||||
|
blt $t1, $t2 e8
|
||||||
|
li $t0, 0
|
||||||
|
e8:
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
beq $t0 $0 e7
|
||||||
|
lw $t0, -12($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t2, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t1, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t1, $t2
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, -12($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t2, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t1, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $t0, 1
|
||||||
|
blt $t1, $t2 e9
|
||||||
|
li $t0, 0
|
||||||
|
e9:
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
beq $t0 $zero e10
|
||||||
|
sub $sp, $sp, 4 #Val Retour
|
||||||
|
lw $t0, -12($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, -12($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t2, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t1, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t1, $t2
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
jal echanger
|
||||||
|
addi $sp, $sp, 8
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, -8($fp) #variable locale
|
||||||
|
j e11
|
||||||
|
e10:
|
||||||
|
e11:
|
||||||
|
lw $t0, -12($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t2, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t1, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t1, $t2
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, -12($fp) #variable locale
|
||||||
|
j e6
|
||||||
|
e7:
|
||||||
|
lw $t0, -16($fp) #variable locale
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t2, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t1, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sub $t0, $t1, $t2
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, -16($fp) #variable locale
|
||||||
|
j e3
|
||||||
|
e4:
|
||||||
|
addi $sp, $sp 0 # desallocation variables locales
|
||||||
|
lw $ra, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
|
main :
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
sub $sp, $sp, 4 #Val Retour
|
||||||
|
jal initialiser
|
||||||
|
addi $sp, $sp, 0
|
||||||
|
sub $sp, $sp, 4 #Val Retour
|
||||||
|
li $t0, 10
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
jal afficher
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sub $sp, $sp, 4 #Val Retour
|
||||||
|
li $t0, 10
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
jal trier
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sub $sp, $sp, 4 #Val Retour
|
||||||
|
li $t0, 10
|
||||||
|
subi $sp, $sp, 4
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
jal afficher
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
addi $sp, $sp 12 # desallocation variables locales
|
||||||
|
lw $ra, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp)
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
2146
eval-fourni/output/tri.synt
Normal file
2146
eval-fourni/output/tri.synt
Normal file
File diff suppressed because it is too large
Load Diff
49
eval-fourni/output/tri.tab
Normal file
49
eval-fourni/output/tri.tab
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
------------------------------------------
|
||||||
|
base = 2
|
||||||
|
sommet = 2
|
||||||
|
0 $tab GLOBALE TABLEAU 0 10
|
||||||
|
1 initialiser GLOBALE FONCTION 0 0
|
||||||
|
------------------------------------------
|
||||||
|
------------------------------------------
|
||||||
|
base = 3
|
||||||
|
sommet = 5
|
||||||
|
0 $tab GLOBALE TABLEAU 0 10
|
||||||
|
1 initialiser GLOBALE FONCTION 0 0
|
||||||
|
2 afficher GLOBALE FONCTION 0 1
|
||||||
|
3 $n ARGUMENT ENTIER 0 -1
|
||||||
|
4 $i LOCALE ENTIER 0 -1
|
||||||
|
------------------------------------------
|
||||||
|
------------------------------------------
|
||||||
|
base = 4
|
||||||
|
sommet = 7
|
||||||
|
0 $tab GLOBALE TABLEAU 0 10
|
||||||
|
1 initialiser GLOBALE FONCTION 0 0
|
||||||
|
2 afficher GLOBALE FONCTION 0 1
|
||||||
|
3 echanger GLOBALE FONCTION 0 2
|
||||||
|
4 $i ARGUMENT ENTIER 0 -1
|
||||||
|
5 $j ARGUMENT ENTIER 4 -1
|
||||||
|
6 $temp LOCALE ENTIER 0 -1
|
||||||
|
------------------------------------------
|
||||||
|
------------------------------------------
|
||||||
|
base = 5
|
||||||
|
sommet = 9
|
||||||
|
0 $tab GLOBALE TABLEAU 0 10
|
||||||
|
1 initialiser GLOBALE FONCTION 0 0
|
||||||
|
2 afficher GLOBALE FONCTION 0 1
|
||||||
|
3 echanger GLOBALE FONCTION 0 2
|
||||||
|
4 trier GLOBALE FONCTION 0 1
|
||||||
|
5 $n ARGUMENT ENTIER 0 -1
|
||||||
|
6 $echange LOCALE ENTIER 0 -1
|
||||||
|
7 $j LOCALE ENTIER 4 -1
|
||||||
|
8 $m LOCALE ENTIER 8 -1
|
||||||
|
------------------------------------------
|
||||||
|
------------------------------------------
|
||||||
|
base = 6
|
||||||
|
sommet = 6
|
||||||
|
0 $tab GLOBALE TABLEAU 0 10
|
||||||
|
1 initialiser GLOBALE FONCTION 0 0
|
||||||
|
2 afficher GLOBALE FONCTION 0 1
|
||||||
|
3 echanger GLOBALE FONCTION 0 2
|
||||||
|
4 trier GLOBALE FONCTION 0 1
|
||||||
|
5 main GLOBALE FONCTION 0 0
|
||||||
|
------------------------------------------
|
||||||
23
eval-fourni/ref-asynt/affect.asynt
Normal file
23
eval-fourni/ref-asynt/affect.asynt
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<prog>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$a</varDec>
|
||||||
|
</l_dec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
main
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$a</var_simple>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_ecrire>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$a</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</instr_ecrire>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
</l_dec>
|
||||||
|
</prog>
|
||||||
63
eval-fourni/ref-asynt/boucle.asynt
Normal file
63
eval-fourni/ref-asynt/boucle.asynt
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<prog>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$i</varDec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$carre</varDec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
main
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
<intExp>0</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_tantque>
|
||||||
|
<opExp>
|
||||||
|
inf
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>10</intExp>
|
||||||
|
</opExp>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$carre</var_simple>
|
||||||
|
<opExp>
|
||||||
|
fois
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</opExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_ecrire>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$carre</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</instr_ecrire>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
<opExp>
|
||||||
|
plus
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</opExp>
|
||||||
|
</instr_affect>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</instr_tantque>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
</l_dec>
|
||||||
|
</prog>
|
||||||
19
eval-fourni/ref-asynt/expression.asynt
Normal file
19
eval-fourni/ref-asynt/expression.asynt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<prog>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$a</varDec>
|
||||||
|
</l_dec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
main
|
||||||
|
<l_instr>
|
||||||
|
<instr_ecrire>
|
||||||
|
<opExp>
|
||||||
|
fois
|
||||||
|
<intExp>5</intExp>
|
||||||
|
<intExp>2</intExp>
|
||||||
|
</opExp>
|
||||||
|
</instr_ecrire>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
</l_dec>
|
||||||
|
</prog>
|
||||||
106
eval-fourni/ref-asynt/max.asynt
Normal file
106
eval-fourni/ref-asynt/max.asynt
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
<prog>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
max
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$a</varDec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$b</varDec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
<l_instr>
|
||||||
|
<instr_si>
|
||||||
|
<opExp>
|
||||||
|
inf
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$a</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$b</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</opExp>
|
||||||
|
<l_instr>
|
||||||
|
<instr_retour>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$b</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</instr_retour>
|
||||||
|
</l_instr>
|
||||||
|
</instr_si>
|
||||||
|
<l_instr>
|
||||||
|
<instr_retour>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$a</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</instr_retour>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
main
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$v_1</varDec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$v_2</varDec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$v_1</var_simple>
|
||||||
|
<lireExp>
|
||||||
|
</lireExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$v_2</var_simple>
|
||||||
|
<lireExp>
|
||||||
|
</lireExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_si>
|
||||||
|
<opExp>
|
||||||
|
egal
|
||||||
|
<appelExp>
|
||||||
|
<appel>
|
||||||
|
max
|
||||||
|
<l_exp>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$v_1</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<l_exp>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$v_2</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</appel>
|
||||||
|
</appelExp>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$v_1</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</opExp>
|
||||||
|
<l_instr>
|
||||||
|
<instr_ecrire>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$v_1</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</instr_ecrire>
|
||||||
|
</l_instr>
|
||||||
|
<l_instr>
|
||||||
|
<instr_ecrire>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$v_2</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</instr_ecrire>
|
||||||
|
</l_instr>
|
||||||
|
</instr_si>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
</prog>
|
||||||
418
eval-fourni/ref-asynt/tri.asynt
Normal file
418
eval-fourni/ref-asynt/tri.asynt
Normal file
@@ -0,0 +1,418 @@
|
|||||||
|
<prog>
|
||||||
|
<l_dec>
|
||||||
|
<tabDec>$tab[10]</tabDec>
|
||||||
|
</l_dec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
initialiser
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>0</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>8</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>6</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>2</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>9</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>3</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>9</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>4</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>4</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>5</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>2</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>6</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>3</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>7</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>8</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>4</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<intExp>9</intExp>
|
||||||
|
</var_indicee>
|
||||||
|
<intExp>5</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
afficher
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$n</varDec>
|
||||||
|
</l_dec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$i</varDec>
|
||||||
|
</l_dec>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
<intExp>0</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_tantque>
|
||||||
|
<opExp>
|
||||||
|
inf
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$n</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</opExp>
|
||||||
|
<l_instr>
|
||||||
|
<instr_ecrire>
|
||||||
|
<varExp>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</var_indicee>
|
||||||
|
</varExp>
|
||||||
|
</instr_ecrire>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
<opExp>
|
||||||
|
plus
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</opExp>
|
||||||
|
</instr_affect>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</instr_tantque>
|
||||||
|
<l_instr>
|
||||||
|
<instr_ecrire>
|
||||||
|
<intExp>0</intExp>
|
||||||
|
</instr_ecrire>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
echanger
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$i</varDec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$j</varDec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$temp</varDec>
|
||||||
|
</l_dec>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$temp</var_simple>
|
||||||
|
<varExp>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</var_indicee>
|
||||||
|
</varExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</var_indicee>
|
||||||
|
<varExp>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</var_indicee>
|
||||||
|
</varExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$i</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</var_indicee>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$temp</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</instr_affect>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
trier
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$n</varDec>
|
||||||
|
</l_dec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$echange</varDec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$j</varDec>
|
||||||
|
<l_dec>
|
||||||
|
<varDec>$m</varDec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$m</var_simple>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$n</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$echange</var_simple>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_tantque>
|
||||||
|
<opExp>
|
||||||
|
egal
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$echange</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</opExp>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$echange</var_simple>
|
||||||
|
<intExp>0</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
<intExp>0</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
<l_instr>
|
||||||
|
<instr_tantque>
|
||||||
|
<opExp>
|
||||||
|
inf
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<opExp>
|
||||||
|
moins
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$m</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</opExp>
|
||||||
|
</opExp>
|
||||||
|
<l_instr>
|
||||||
|
<instr_si>
|
||||||
|
<opExp>
|
||||||
|
inf
|
||||||
|
<varExp>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<opExp>
|
||||||
|
plus
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</opExp>
|
||||||
|
</var_indicee>
|
||||||
|
</varExp>
|
||||||
|
<varExp>
|
||||||
|
<var_indicee>
|
||||||
|
<var_base_tableau>$tab</var_base_tableau>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
</varExp>
|
||||||
|
</var_indicee>
|
||||||
|
</varExp>
|
||||||
|
</opExp>
|
||||||
|
<l_instr>
|
||||||
|
<instr_appel>
|
||||||
|
<appel>
|
||||||
|
echanger
|
||||||
|
<l_exp>
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<l_exp>
|
||||||
|
<opExp>
|
||||||
|
plus
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</opExp>
|
||||||
|
<l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</appel>
|
||||||
|
</instr_appel>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$echange</var_simple>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</instr_affect>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</instr_si>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
<opExp>
|
||||||
|
plus
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$j</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</opExp>
|
||||||
|
</instr_affect>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</instr_tantque>
|
||||||
|
<l_instr>
|
||||||
|
<instr_affect>
|
||||||
|
<var_simple>$m</var_simple>
|
||||||
|
<opExp>
|
||||||
|
moins
|
||||||
|
<varExp>
|
||||||
|
<var_simple>$m</var_simple>
|
||||||
|
</varExp>
|
||||||
|
<intExp>1</intExp>
|
||||||
|
</opExp>
|
||||||
|
</instr_affect>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</instr_tantque>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
<l_dec>
|
||||||
|
<foncDec>
|
||||||
|
main
|
||||||
|
<l_instr>
|
||||||
|
<instr_appel>
|
||||||
|
<appel>
|
||||||
|
initialiser
|
||||||
|
<l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</appel>
|
||||||
|
</instr_appel>
|
||||||
|
<l_instr>
|
||||||
|
<instr_appel>
|
||||||
|
<appel>
|
||||||
|
afficher
|
||||||
|
<l_exp>
|
||||||
|
<intExp>10</intExp>
|
||||||
|
<l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</appel>
|
||||||
|
</instr_appel>
|
||||||
|
<l_instr>
|
||||||
|
<instr_appel>
|
||||||
|
<appel>
|
||||||
|
trier
|
||||||
|
<l_exp>
|
||||||
|
<intExp>10</intExp>
|
||||||
|
<l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</appel>
|
||||||
|
</instr_appel>
|
||||||
|
<l_instr>
|
||||||
|
<instr_appel>
|
||||||
|
<appel>
|
||||||
|
afficher
|
||||||
|
<l_exp>
|
||||||
|
<intExp>10</intExp>
|
||||||
|
<l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</l_exp>
|
||||||
|
</appel>
|
||||||
|
</instr_appel>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</l_instr>
|
||||||
|
</foncDec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
</l_dec>
|
||||||
|
</prog>
|
||||||
18
eval-fourni/ref-lex/affect.lex
Normal file
18
eval-fourni/ref-lex/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
|
||||||
40
eval-fourni/ref-lex/boucle.lex
Normal file
40
eval-fourni/ref-lex/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
|
||||||
16
eval-fourni/ref-lex/expression.lex
Normal file
16
eval-fourni/ref-lex/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
|
||||||
72
eval-fourni/ref-lex/max.lex
Normal file
72
eval-fourni/ref-lex/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
|
||||||
271
eval-fourni/ref-lex/tri.lex
Normal file
271
eval-fourni/ref-lex/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
|
||||||
35
eval-fourni/ref-mips/affect.mips
Normal file
35
eval-fourni/ref-mips/affect.mips
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
.data
|
||||||
|
$a: .space 4
|
||||||
|
|
||||||
|
.text
|
||||||
|
__start:
|
||||||
|
jal main
|
||||||
|
li $v0, 10
|
||||||
|
syscall # stoppe l'execution du processus
|
||||||
|
main:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp # nouvelle valeur de $fp
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, $a # stocke variable
|
||||||
|
lw $t1, $a # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $a0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $v0, 1
|
||||||
|
syscall # ecriture
|
||||||
|
li $a0, '\n'
|
||||||
|
li $v0, 11
|
||||||
|
syscall # ecrire char
|
||||||
|
lw $ra, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
91
eval-fourni/ref-mips/boucle.mips
Normal file
91
eval-fourni/ref-mips/boucle.mips
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
.data
|
||||||
|
$i: .space 4
|
||||||
|
$carre: .space 4
|
||||||
|
|
||||||
|
.text
|
||||||
|
__start:
|
||||||
|
jal main
|
||||||
|
li $v0, 10
|
||||||
|
syscall # stoppe l'execution du processus
|
||||||
|
main:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp # nouvelle valeur de $fp
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
li $t0, 0
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, $i # stocke variable
|
||||||
|
e0:
|
||||||
|
lw $t1, $i # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
li $t0, 10
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $t2, -1 # inf
|
||||||
|
blt $t0, $t1, e2
|
||||||
|
li $t2, 0
|
||||||
|
e2:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t2, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
beq $t0, $zero, e1
|
||||||
|
lw $t1, $i # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t1, $i # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
mult $t0, $t1
|
||||||
|
mflo $t2
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t2, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, $carre # stocke variable
|
||||||
|
lw $t1, $carre # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $a0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $v0, 1
|
||||||
|
syscall # ecriture
|
||||||
|
li $a0, '\n'
|
||||||
|
li $v0, 11
|
||||||
|
syscall # ecrire char
|
||||||
|
lw $t1, $i # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t2, $t0, $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t2, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, $i # stocke variable
|
||||||
|
j e0
|
||||||
|
e1:
|
||||||
|
lw $ra, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
40
eval-fourni/ref-mips/expression.mips
Normal file
40
eval-fourni/ref-mips/expression.mips
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
.data
|
||||||
|
$a: .space 4
|
||||||
|
|
||||||
|
.text
|
||||||
|
__start:
|
||||||
|
jal main
|
||||||
|
li $v0, 10
|
||||||
|
syscall # stoppe l'execution du processus
|
||||||
|
main:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp # nouvelle valeur de $fp
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
li $t0, 5
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 2
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
mult $t0, $t1
|
||||||
|
mflo $t2
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t2, 0($sp)
|
||||||
|
lw $a0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $v0, 1
|
||||||
|
syscall # ecriture
|
||||||
|
li $a0, '\n'
|
||||||
|
li $v0, 11
|
||||||
|
syscall # ecrire char
|
||||||
|
lw $ra, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
137
eval-fourni/ref-mips/max.mips
Normal file
137
eval-fourni/ref-mips/max.mips
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
.data
|
||||||
|
|
||||||
|
.text
|
||||||
|
__start:
|
||||||
|
jal main
|
||||||
|
li $v0, 10
|
||||||
|
syscall # stoppe l'execution du processus
|
||||||
|
max:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp # nouvelle valeur de $fp
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
lw $t1, 8($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t1, 4($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $t2, -1 # inf
|
||||||
|
blt $t0, $t1, e2
|
||||||
|
li $t2, 0
|
||||||
|
e2:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t2, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
beq $t0, $zero, e1
|
||||||
|
lw $t1, 4($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, 12($fp) # ecriture de la valeur de retour
|
||||||
|
lw $ra, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
|
e1:
|
||||||
|
lw $t1, 8($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t0, 12($fp) # ecriture de la valeur de retour
|
||||||
|
lw $ra, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
|
lw $ra, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
|
main:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp # nouvelle valeur de $fp
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
subi $sp, $sp, 8 # allocation variables locales
|
||||||
|
li $v0, 5
|
||||||
|
syscall # lecture
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $v0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, -8($fp) # stocke variable
|
||||||
|
li $v0, 5
|
||||||
|
syscall # lecture
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $v0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, -12($fp) # stocke variable
|
||||||
|
subi $sp, $sp, 4 # allocation valeur de retour
|
||||||
|
# empile arg 0
|
||||||
|
lw $t1, -8($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
# empile arg 1
|
||||||
|
lw $t1, -12($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
jal max
|
||||||
|
addi $sp, $sp, 8 # desallocation parametres
|
||||||
|
lw $t1, -8($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $t2, -1 # egal
|
||||||
|
beq $t0, $t1, e5
|
||||||
|
li $t2, 0
|
||||||
|
e5:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t2, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
beq $t0, $zero, e3
|
||||||
|
lw $t1, -8($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $a0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $v0, 1
|
||||||
|
syscall # ecriture
|
||||||
|
li $a0, '\n'
|
||||||
|
li $v0, 11
|
||||||
|
syscall # ecrire char
|
||||||
|
j e4
|
||||||
|
e3:
|
||||||
|
lw $t1, -12($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $a0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $v0, 1
|
||||||
|
syscall # ecriture
|
||||||
|
li $a0, '\n'
|
||||||
|
li $v0, 11
|
||||||
|
syscall # ecrire char
|
||||||
|
e4:
|
||||||
|
addi $sp, $sp, 8 # desallocation variables locales
|
||||||
|
lw $ra, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
525
eval-fourni/ref-mips/tri.mips
Normal file
525
eval-fourni/ref-mips/tri.mips
Normal file
@@ -0,0 +1,525 @@
|
|||||||
|
.data
|
||||||
|
$tab: .space 40
|
||||||
|
|
||||||
|
.text
|
||||||
|
__start:
|
||||||
|
jal main
|
||||||
|
li $v0, 10
|
||||||
|
syscall # stoppe l'execution du processus
|
||||||
|
initialiser:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp # nouvelle valeur de $fp
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
li $t0, 8
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 0
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, $tab($t0) # stocke variable
|
||||||
|
li $t0, 6
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, $tab($t0) # stocke variable
|
||||||
|
li $t0, 9
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 2
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, $tab($t0) # stocke variable
|
||||||
|
li $t0, 9
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 3
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, $tab($t0) # stocke variable
|
||||||
|
li $t0, 4
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 4
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, $tab($t0) # stocke variable
|
||||||
|
li $t0, 2
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 5
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, $tab($t0) # stocke variable
|
||||||
|
li $t0, 3
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 6
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, $tab($t0) # stocke variable
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 7
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, $tab($t0) # stocke variable
|
||||||
|
li $t0, 4
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 8
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, $tab($t0) # stocke variable
|
||||||
|
li $t0, 5
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
li $t0, 9
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, $tab($t0) # stocke variable
|
||||||
|
lw $ra, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
|
afficher:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp # nouvelle valeur de $fp
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
subi $sp, $sp, 4 # allocation variables locales
|
||||||
|
li $t0, 0
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, -8($fp) # stocke variable
|
||||||
|
e0:
|
||||||
|
lw $t1, -8($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t1, 4($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $t2, -1 # inf
|
||||||
|
blt $t0, $t1, e2
|
||||||
|
li $t2, 0
|
||||||
|
e2:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t2, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
beq $t0, $zero, e1
|
||||||
|
lw $t1, -8($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, $tab($t0) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $a0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $v0, 1
|
||||||
|
syscall # ecriture
|
||||||
|
li $a0, '\n'
|
||||||
|
li $v0, 11
|
||||||
|
syscall # ecrire char
|
||||||
|
lw $t1, -8($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t2, $t0, $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t2, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, -8($fp) # stocke variable
|
||||||
|
j e0
|
||||||
|
e1:
|
||||||
|
li $t0, 0
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $a0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $v0, 1
|
||||||
|
syscall # ecriture
|
||||||
|
li $a0, '\n'
|
||||||
|
li $v0, 11
|
||||||
|
syscall # ecrire char
|
||||||
|
addi $sp, $sp, 4 # desallocation variables locales
|
||||||
|
lw $ra, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
|
echanger:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp # nouvelle valeur de $fp
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
subi $sp, $sp, 4 # allocation variables locales
|
||||||
|
lw $t1, 4($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, $tab($t0) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, -8($fp) # stocke variable
|
||||||
|
lw $t1, 8($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, $tab($t0) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t1, 4($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, $tab($t0) # stocke variable
|
||||||
|
lw $t1, -8($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t1, 8($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, $tab($t0) # stocke variable
|
||||||
|
addi $sp, $sp, 4 # desallocation variables locales
|
||||||
|
lw $ra, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
|
trier:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp # nouvelle valeur de $fp
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
subi $sp, $sp, 12 # allocation variables locales
|
||||||
|
lw $t1, 4($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, -16($fp) # stocke variable
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, -8($fp) # stocke variable
|
||||||
|
e3:
|
||||||
|
lw $t1, -8($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $t2, -1 # egal
|
||||||
|
beq $t0, $t1, e5
|
||||||
|
li $t2, 0
|
||||||
|
e5:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t2, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
beq $t0, $zero, e4
|
||||||
|
li $t0, 0
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, -8($fp) # stocke variable
|
||||||
|
li $t0, 0
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, -12($fp) # stocke variable
|
||||||
|
e6:
|
||||||
|
lw $t1, -12($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t1, -16($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sub $t2, $t0, $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t2, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $t2, -1 # inf
|
||||||
|
blt $t0, $t1, e8
|
||||||
|
li $t2, 0
|
||||||
|
e8:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t2, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
beq $t0, $zero, e7
|
||||||
|
lw $t1, -12($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t2, $t0, $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t2, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, $tab($t0) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t1, -12($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
add $t0, $t0, $t0
|
||||||
|
lw $t1, $tab($t0) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
li $t2, -1 # inf
|
||||||
|
blt $t0, $t1, e11
|
||||||
|
li $t2, 0
|
||||||
|
e11:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t2, 0($sp)
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
beq $t0, $zero, e10
|
||||||
|
subi $sp, $sp, 4 # allocation valeur de retour
|
||||||
|
# empile arg 0
|
||||||
|
lw $t1, -12($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
# empile arg 1
|
||||||
|
lw $t1, -12($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t2, $t0, $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t2, 0($sp)
|
||||||
|
jal echanger
|
||||||
|
addi $sp, $sp, 8 # desallocation parametres
|
||||||
|
addi $sp, $sp, 4 # valeur de retour ignoree
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, -8($fp) # stocke variable
|
||||||
|
e10:
|
||||||
|
lw $t1, -12($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
add $t2, $t0, $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t2, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, -12($fp) # stocke variable
|
||||||
|
j e6
|
||||||
|
e7:
|
||||||
|
lw $t1, -16($fp) # lit variable dans $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t1, 0($sp)
|
||||||
|
li $t0, 1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $t0, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sub $t2, $t0, $t1
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t2, 0($sp)
|
||||||
|
lw $t1, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
sw $t1, -16($fp) # stocke variable
|
||||||
|
j e3
|
||||||
|
e4:
|
||||||
|
addi $sp, $sp, 12 # desallocation variables locales
|
||||||
|
lw $ra, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
|
main:
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $fp, 0($sp)
|
||||||
|
move $fp, $sp # nouvelle valeur de $fp
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $ra, 0($sp)
|
||||||
|
subi $sp, $sp, 4 # allocation valeur de retour
|
||||||
|
jal initialiser
|
||||||
|
addi $sp, $sp, 4 # valeur de retour ignoree
|
||||||
|
subi $sp, $sp, 4 # allocation valeur de retour
|
||||||
|
# empile arg 0
|
||||||
|
li $t0, 10
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
jal afficher
|
||||||
|
addi $sp, $sp, 4 # desallocation parametres
|
||||||
|
addi $sp, $sp, 4 # valeur de retour ignoree
|
||||||
|
subi $sp, $sp, 4 # allocation valeur de retour
|
||||||
|
# empile arg 0
|
||||||
|
li $t0, 10
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
jal trier
|
||||||
|
addi $sp, $sp, 4 # desallocation parametres
|
||||||
|
addi $sp, $sp, 4 # valeur de retour ignoree
|
||||||
|
subi $sp, $sp, 4 # allocation valeur de retour
|
||||||
|
# empile arg 0
|
||||||
|
li $t0, 10
|
||||||
|
subi $sp, $sp, 4 # empile registre
|
||||||
|
sw $t0, 0($sp)
|
||||||
|
jal afficher
|
||||||
|
addi $sp, $sp, 4 # desallocation parametres
|
||||||
|
addi $sp, $sp, 4 # valeur de retour ignoree
|
||||||
|
lw $ra, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
lw $fp, 0($sp) # depile vers registre
|
||||||
|
addi $sp, $sp, 4
|
||||||
|
jr $ra
|
||||||
113
eval-fourni/ref-synt/affect.synt
Normal file
113
eval-fourni/ref-synt/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>
|
||||||
283
eval-fourni/ref-synt/boucle.synt
Normal file
283
eval-fourni/ref-synt/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>
|
||||||
77
eval-fourni/ref-synt/expression.synt
Normal file
77
eval-fourni/ref-synt/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>
|
||||||
513
eval-fourni/ref-synt/max.synt
Normal file
513
eval-fourni/ref-synt/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>
|
||||||
2146
eval-fourni/ref-synt/tri.synt
Normal file
2146
eval-fourni/ref-synt/tri.synt
Normal file
File diff suppressed because it is too large
Load Diff
6
eval-fourni/ref-tab/affect.tab
Normal file
6
eval-fourni/ref-tab/affect.tab
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
------------------------------------------
|
||||||
|
base = 2
|
||||||
|
sommet = 2
|
||||||
|
0 $a GLOBALE ENTIER 0 -1
|
||||||
|
1 main GLOBALE FONCTION 0 0
|
||||||
|
------------------------------------------
|
||||||
7
eval-fourni/ref-tab/boucle.tab
Normal file
7
eval-fourni/ref-tab/boucle.tab
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
------------------------------------------
|
||||||
|
base = 3
|
||||||
|
sommet = 3
|
||||||
|
0 $i GLOBALE ENTIER 0 -1
|
||||||
|
1 $carre GLOBALE ENTIER 4 -1
|
||||||
|
2 main GLOBALE FONCTION 0 0
|
||||||
|
------------------------------------------
|
||||||
6
eval-fourni/ref-tab/expression.tab
Normal file
6
eval-fourni/ref-tab/expression.tab
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
------------------------------------------
|
||||||
|
base = 2
|
||||||
|
sommet = 2
|
||||||
|
0 $a GLOBALE ENTIER 0 -1
|
||||||
|
1 main GLOBALE FONCTION 0 0
|
||||||
|
------------------------------------------
|
||||||
15
eval-fourni/ref-tab/max.tab
Normal file
15
eval-fourni/ref-tab/max.tab
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
------------------------------------------
|
||||||
|
base = 1
|
||||||
|
sommet = 3
|
||||||
|
0 max GLOBALE FONCTION 0 2
|
||||||
|
1 $a ARGUMENT ENTIER 0 -1
|
||||||
|
2 $b ARGUMENT ENTIER 4 -1
|
||||||
|
------------------------------------------
|
||||||
|
------------------------------------------
|
||||||
|
base = 2
|
||||||
|
sommet = 4
|
||||||
|
0 max GLOBALE FONCTION 0 2
|
||||||
|
1 main GLOBALE FONCTION 0 0
|
||||||
|
2 $v_1 LOCALE ENTIER 0 -1
|
||||||
|
3 $v_2 LOCALE ENTIER 4 -1
|
||||||
|
------------------------------------------
|
||||||
49
eval-fourni/ref-tab/tri.tab
Normal file
49
eval-fourni/ref-tab/tri.tab
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
------------------------------------------
|
||||||
|
base = 2
|
||||||
|
sommet = 2
|
||||||
|
0 $tab GLOBALE TABLEAU 0 10
|
||||||
|
1 initialiser GLOBALE FONCTION 0 0
|
||||||
|
------------------------------------------
|
||||||
|
------------------------------------------
|
||||||
|
base = 3
|
||||||
|
sommet = 5
|
||||||
|
0 $tab GLOBALE TABLEAU 0 10
|
||||||
|
1 initialiser GLOBALE FONCTION 0 0
|
||||||
|
2 afficher GLOBALE FONCTION 0 1
|
||||||
|
3 $n ARGUMENT ENTIER 0 -1
|
||||||
|
4 $i LOCALE ENTIER 0 -1
|
||||||
|
------------------------------------------
|
||||||
|
------------------------------------------
|
||||||
|
base = 4
|
||||||
|
sommet = 7
|
||||||
|
0 $tab GLOBALE TABLEAU 0 10
|
||||||
|
1 initialiser GLOBALE FONCTION 0 0
|
||||||
|
2 afficher GLOBALE FONCTION 0 1
|
||||||
|
3 echanger GLOBALE FONCTION 0 2
|
||||||
|
4 $i ARGUMENT ENTIER 0 -1
|
||||||
|
5 $j ARGUMENT ENTIER 4 -1
|
||||||
|
6 $temp LOCALE ENTIER 0 -1
|
||||||
|
------------------------------------------
|
||||||
|
------------------------------------------
|
||||||
|
base = 5
|
||||||
|
sommet = 9
|
||||||
|
0 $tab GLOBALE TABLEAU 0 10
|
||||||
|
1 initialiser GLOBALE FONCTION 0 0
|
||||||
|
2 afficher GLOBALE FONCTION 0 1
|
||||||
|
3 echanger GLOBALE FONCTION 0 2
|
||||||
|
4 trier GLOBALE FONCTION 0 1
|
||||||
|
5 $n ARGUMENT ENTIER 0 -1
|
||||||
|
6 $echange LOCALE ENTIER 0 -1
|
||||||
|
7 $j LOCALE ENTIER 4 -1
|
||||||
|
8 $m LOCALE ENTIER 8 -1
|
||||||
|
------------------------------------------
|
||||||
|
------------------------------------------
|
||||||
|
base = 6
|
||||||
|
sommet = 6
|
||||||
|
0 $tab GLOBALE TABLEAU 0 10
|
||||||
|
1 initialiser GLOBALE FONCTION 0 0
|
||||||
|
2 afficher GLOBALE FONCTION 0 1
|
||||||
|
3 echanger GLOBALE FONCTION 0 2
|
||||||
|
4 trier GLOBALE FONCTION 0 1
|
||||||
|
5 main GLOBALE FONCTION 0 0
|
||||||
|
------------------------------------------
|
||||||
251
eval-fourni/testAll.sh
Executable file
251
eval-fourni/testAll.sh
Executable file
@@ -0,0 +1,251 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# Script d'évaluation automatique du compilateur.
|
||||||
|
# Compile le programme source et compare la sortie avec la référence.
|
||||||
|
# Pour le code MIPS, compare la SORTIE de l'exécution sur Mars
|
||||||
|
# Comprend
|
||||||
|
# * analyse lexicale,
|
||||||
|
# * analyse syntaxique,
|
||||||
|
# * arbre abstrait,
|
||||||
|
# * table des symboles et
|
||||||
|
# * code MIPS.
|
||||||
|
#
|
||||||
|
# ATTENTION : pour que le script marche, votre compilateur doit returner 0 em
|
||||||
|
# cas de succès, autre valeur en cas d'erreur (entrée ne compile pas
|
||||||
|
# correctement) et doit permettre d'afficher les sorties sur stdout, sauf
|
||||||
|
# éventuels messages d'erreur, sur stderr. On doit pouvoir, à tout moment,
|
||||||
|
# changer le type de sortie (lex, synt, asynt, tab, mips) avec des options.
|
||||||
|
#
|
||||||
|
##############################################################################
|
||||||
|
### LLL IIIIIII RRRRRRR EEEEEEEEE ||||
|
||||||
|
### LLL III RRR RRR EEEEEEEEE ||||
|
||||||
|
### LLL III RRR RR EEE ||||
|
||||||
|
### LLL III RRR RRR EEEEEEEE ||||
|
||||||
|
### LLL III RRRRRRR EEEEEEEE \\\\////
|
||||||
|
### LLL III RRR RRR EEE \\\///
|
||||||
|
### LLLLLLLL III RRR RRR EEEEEEEE \\//
|
||||||
|
### LLLLLLLL IIIIIII RRR RRR EEEEEEEEE \/
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# 1) MODIFIEZ LA VARIABLE CI-DESSOUS AVEC LE CHEMIN VERS VOTRE COMPILATEUR
|
||||||
|
|
||||||
|
MYCOMPILO="../compilateur-l"
|
||||||
|
|
||||||
|
# 2) DÉCOMMENTEZ + MODIFIEZ LES COMMANDES POUR GÉNÉRER LES DIFFÉRENTES SORTIES
|
||||||
|
|
||||||
|
MYCOMPILODEFAULT="${MYCOMPILO}" # utilisé pour test reconnaissance et erreur
|
||||||
|
MYCOMPILOLEX="${MYCOMPILO} -l" # exécuter l'analyseur lexical
|
||||||
|
MYCOMPILOSYNT="${MYCOMPILO} -s" # exécuter l'analyseur syntaxique
|
||||||
|
MYCOMPILOASYNT="${MYCOMPILO} -a" # afficher l'arbre abstrait
|
||||||
|
MYCOMPILOTAB="${MYCOMPILO} -t" # afficher les tables des symboles
|
||||||
|
MYCOMPILOMIPS="${MYCOMPILO} -m" # générer code MIPS
|
||||||
|
EXITONFAIL=1 # mettre à zéro pour continuer après erreurs
|
||||||
|
MARS="./Mars4_5.jar" # utilisez autre version de Mars si besoin
|
||||||
|
##############################################################################
|
||||||
|
# NE PLUS LIRE À PARTIR D'ICI ;-)
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
declare -A testname
|
||||||
|
testname["lex"]="Analyse lexicale"
|
||||||
|
testname["synt"]="Analyse syntaxique"
|
||||||
|
testname["asynt"]="Arbre abstrait"
|
||||||
|
testname["tab"]="Table des symboles"
|
||||||
|
testname["mips"]="Code machine MIPS"
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Fonction pour faire le diff textuel régulier (lex et tab).
|
||||||
|
# Cette fonction peut être passée en paramètre à la fonction diff_prog.
|
||||||
|
# @param $1 Fichier 1
|
||||||
|
# @param $2 Fichier 2
|
||||||
|
# @return 0 si pas de différence, autre sinon
|
||||||
|
|
||||||
|
function REGDIFF() {
|
||||||
|
diff -q -w $1 $2
|
||||||
|
}
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Fonction pour faire le diff entre deux fichiers XML (syn et asyn).
|
||||||
|
# Cette fonction peut être passée en paramètre à la fonction diff_prog.
|
||||||
|
# @param $1 Fichier XML 1
|
||||||
|
# @param $2 Fichier XML 2
|
||||||
|
# @return 0 si pas de différence, autre sinon
|
||||||
|
|
||||||
|
function XMLDIFF() {
|
||||||
|
./compare_arbres_xml $1 $2
|
||||||
|
}
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Fonction pour faire le diff entre deux sorties d'exécution Mars (mips).
|
||||||
|
# Cette fonction peut être passée en paramètre à la fonction diff_prog.
|
||||||
|
# @param $1 Fichier mips 1
|
||||||
|
# @param $2 Fichier mips 2
|
||||||
|
# @param $3 Entrée à donner à l'exécution du programme (optionnel)
|
||||||
|
# @return 0 si pas de différence, autre sinon
|
||||||
|
|
||||||
|
function MARSOUTDIFF() {
|
||||||
|
diff <(echo -e "$3" | java -jar $MARS $1 | tail -n +2 | sed ':a;N;$!ba;s/[ \n]//g') <(echo -e "$3" | java -jar $MARS $2 | tail -n +2 | sed ':a;N;$!ba;s/[ \n]//g')
|
||||||
|
}
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Fonction pour faire le diff entre deux fichiers, vérifier et afficher le
|
||||||
|
# résultat avec de belles couleurs.
|
||||||
|
# @param $1 Nom de la fonction utilisée pour faire le diff (parmi 3 ci-dessus)
|
||||||
|
# @param $2 Nom du fichier d'entrée à tester sans extension (p. ex. affect)
|
||||||
|
# @param $3 Extension du fichier à tester (p. ex. synt)
|
||||||
|
# @param $4 Entrée à donner à l'exécution du programme (optionnel)
|
||||||
|
|
||||||
|
function diff_prog() {
|
||||||
|
diffprog=$1
|
||||||
|
input=$2
|
||||||
|
suffix=$3
|
||||||
|
values=$4
|
||||||
|
refoutput="ref-${suffix}/${input}.${suffix}"
|
||||||
|
sysoutput="output/${input}.${suffix}"
|
||||||
|
echo -e "\033[35m > ${testname[${suffix}]} (.${suffix})\033[0m"
|
||||||
|
echo -e "`wc -l output/${input}.${suffix} | awk '{print $1}'` lignes"
|
||||||
|
if [ -f ref-${suffix}/$input.${suffix} ]; then
|
||||||
|
${diffprog} output/${input}.${suffix} ref-${suffix}/${input}.${suffix} ${values} 2>&1 2> /dev/null
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
echo -e "\033[31mTEST ${testname[${suffix}]} ÉCHOUÉ\033[0m"
|
||||||
|
echo -e "Différences entre output/${input}.${suffix} ref-${suffix}/${input}.${suffix} en utilisant $diffprog:"
|
||||||
|
${diffprog} output/${input}.${suffix} ref-${suffix}/${input}.${suffix} ${values}
|
||||||
|
if [ $EXITONFAIL = 1 ]; then exit 1; fi
|
||||||
|
else
|
||||||
|
echo -e "\033[32mTEST ${testname[${suffix}]} OK\033[0m"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e "\033[34mRéférence ref-${suffix}/${input}.${suffix} absente\033[0m"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Exécute tous les tests (reco, lex, synt, asynt, tab, mips) pour un exemple
|
||||||
|
# donné qui doit être correctement compilé à tous les niveaux.
|
||||||
|
# @param $1 Nom du fichier d'entrée à tester sans extension (p. ex. affect)
|
||||||
|
# @param $2 Entrée à donner à l'exécution du programme (optionnel)
|
||||||
|
|
||||||
|
function test_fichier_ok() {
|
||||||
|
input=$1
|
||||||
|
echo -e "\n\033[4m ---- Test input/$input.l ----\033[0m"
|
||||||
|
if [ -n "$2" ]; then
|
||||||
|
echo "Input : $2"
|
||||||
|
fi
|
||||||
|
if [ -f input/$input.l ]; then
|
||||||
|
# Reconnaissance : programme correct doit être accepté
|
||||||
|
if [ -n "${MYCOMPILODEFAULT}" ]; then
|
||||||
|
echo -e "\033[35m > Reconnaissance (accepte l'entrée)\033[0m"
|
||||||
|
${MYCOMPILODEFAULT} input/$input.l > output/$input.synt
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
echo -e "\033[31mTEST Reconnaissance ÉCHOUÉ\033[0m"
|
||||||
|
echo -e "Le programme $input.l n'a pas été compilé correctement"
|
||||||
|
if [ $EXITONFAIL = 1 ]; then exit 1; fi
|
||||||
|
else
|
||||||
|
echo -e "\033[32mTEST Reconnaissance OK\033[0m"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# Teste analyseur lexical
|
||||||
|
if [ -n "${MYCOMPILOLEX}" ]; then
|
||||||
|
${MYCOMPILOLEX} input/$input.l > output/$input.lex
|
||||||
|
diff_prog REGDIFF $input lex
|
||||||
|
fi
|
||||||
|
# Teste analyseur syntaxique
|
||||||
|
if [ -n "${MYCOMPILOSYNT}" ]; then
|
||||||
|
${MYCOMPILOSYNT} input/$input.l > output/$input.synt
|
||||||
|
diff_prog XMLDIFF $input synt
|
||||||
|
fi
|
||||||
|
# Teste création de l'arbre abstrait
|
||||||
|
if [ -n "${MYCOMPILOASYNT}" ]; then
|
||||||
|
${MYCOMPILOASYNT} input/$input.l > output/$input.asynt
|
||||||
|
diff_prog XMLDIFF $input asynt
|
||||||
|
fi
|
||||||
|
# Teste replissage de la table des symboles
|
||||||
|
if [ -n "${MYCOMPILOTAB}" ]; then
|
||||||
|
${MYCOMPILOTAB} input/$input.l > output/$input.tab
|
||||||
|
diff_prog REGDIFF $input tab
|
||||||
|
fi
|
||||||
|
# Teste génération de code MIPS
|
||||||
|
if [ -n "${MYCOMPILOMIPS}" ]; then
|
||||||
|
${MYCOMPILOMIPS} input/$input.l > output/$input.mips
|
||||||
|
diff_prog MARSOUTDIFF $input mips "$2"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e "\033[31minput/$input.l non trouvé\033[0m"
|
||||||
|
echo -e "\033[31mTest impossible\033[0m"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Vérifie qu'un programme contenant des erreurs n'est pas reconnu/compilé.
|
||||||
|
# @param $1 Nom du fichier d'entrée à tester sans extension (p. ex. affect)
|
||||||
|
|
||||||
|
function test_fichier_fail() {
|
||||||
|
input=$1
|
||||||
|
echo -e "\n\033[4m ---- Test input/$input.l ----\033[0m"
|
||||||
|
${MYCOMPILODEFAULT} input/$input.l > output/$input.synt.xml
|
||||||
|
if [ $? = 0 ]; then
|
||||||
|
echo -e "\033[31mTEST REJET ÉCHOUÉ\033[0m"
|
||||||
|
echo -e "Le programme $input.l est accepté mais il devrait être rejeté"
|
||||||
|
if [ $EXITONFAIL = 1 ]; then exit 1; fi
|
||||||
|
else
|
||||||
|
echo -e "\033[32mTEST REJET OK\033[0m"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
####### ##### ###### ###### ### ##### ###############################
|
||||||
|
####### ### ##### # ###### #### ### ###############################
|
||||||
|
####### # #### ### ##### #### ## # ###############################
|
||||||
|
####### # # ### #### #### ### ###############################
|
||||||
|
####### ## ## ## ####### ## ### #### ###############################
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
make clean
|
||||||
|
make
|
||||||
|
mkdir -p output
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Vérifications initiales : MYCOMPILO et MARS bien configurés?
|
||||||
|
|
||||||
|
echo -e "Votre compilateur : ${MYCOMPILO}"
|
||||||
|
if [ ! -f ${MYCOMPILO} ]; then
|
||||||
|
echo -e "\033[31mCompilateur introuvable"
|
||||||
|
echo -e "Modifiez la variable MYCOMPILO avant de lancer l'éval\033[0m"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -n "${MYCOMPILOMIPS}" -a ! -f ${MARS} ]; then
|
||||||
|
echo -e "\033[31mMARS introuvable"
|
||||||
|
echo -e "Modifiez la variable MARS avant de lancer l'éval\033[0m"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
echo -e "\033[1m\n>> 1) Tests connus OK\033[0m"
|
||||||
|
|
||||||
|
test_fichier_ok affect
|
||||||
|
test_fichier_ok boucle
|
||||||
|
test_fichier_ok expression
|
||||||
|
# 3 cas de figure selon les entrées tapées
|
||||||
|
test_fichier_ok max "3\n10\n"
|
||||||
|
test_fichier_ok max "10\n10\n"
|
||||||
|
test_fichier_ok max "-3\n-10\n"
|
||||||
|
test_fichier_ok tri
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
echo -e "\033[1m\n>> 2) Tests connus FAIL\033[0m"
|
||||||
|
|
||||||
|
test_fichier_fail affect-err
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
echo -e "\033[1m\n>> 3) Tests nouveaux OK\033[0m"
|
||||||
|
|
||||||
|
# Coming soon ;-)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
echo -e "\033[1m\n>> 4) Tests nouveaux FAIL\033[0m"
|
||||||
|
|
||||||
|
# Coming soon ;-)
|
||||||
Reference in New Issue
Block a user