From 0afa042dcd8b04c262466632caffa556fd358155 Mon Sep 17 00:00:00 2001
From: Alexis Nasr <alexis.nasr@lif.univ-mrs.fr>
Date: Fri, 29 Mar 2024 11:33:52 +0100
Subject: [PATCH] modification des coefficients dans evaluate.py et
 modification du fichier de test fibo.l

---
 src/sa/SaEval.java              | 2 +-
 test/c3a-ref/fibo.c3a           | 2 +-
 test/evaluate.py                | 6 +++---
 test/input/fibo.l               | 2 +-
 test/nasm-ref/fibo.nasm         | 2 +-
 test/out-ref/fibo.out           | 2 +-
 test/pre-nasm-ref/fibo.pre-nasm | 2 +-
 test/sa-ref/fibo.sa             | 2 +-
 8 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/sa/SaEval.java b/src/sa/SaEval.java
index 434054b..afa7375 100644
--- a/src/sa/SaEval.java
+++ b/src/sa/SaEval.java
@@ -24,7 +24,7 @@ public class SaEval extends SaDepthFirstVisitor <TypeVal> {
 		try{
 			appelMain.accept(this);
 		} catch(Exception e){
-		    e.printStackTrace()
+		    e.printStackTrace();
 		}
 	}
 
diff --git a/test/c3a-ref/fibo.c3a b/test/c3a-ref/fibo.c3a
index a67a525..54c7eee 100644
--- a/test/c3a-ref/fibo.c3a
+++ b/test/c3a-ref/fibo.c3a
@@ -19,7 +19,7 @@ fibo	fbegin	#entree fonction
 	fend
 1	fend
 main	fbegin	#entree fonction
-	param 9
+	param 3
 	@7 = call fibo
 	write @7	
 	fend
diff --git a/test/evaluate.py b/test/evaluate.py
index febaaf2..cace0c2 100755
--- a/test/evaluate.py
+++ b/test/evaluate.py
@@ -18,16 +18,16 @@ ERR_LEX_CODE = 6
 SC_COEFF = 4
 SA_DIFF_COEFF = 0
 TS_DIFF_COEFF = 0
-SA_COEFF = 3
+SA_COEFF = 4
 C3A_DIFF_COEFF = 0
-C3A_COEFF = 3
+C3A_COEFF = 4
 PRE_NASM_DIFF = 0
 PRE_NASM_COEFF = 3
 NASM_DIFF_COEFF = 0
 NASM_COEFF = 3
 EXE_COEFF = 0
 ERR_TS_COEFF = 2
-ERR_TYPE_COEFF = 2
+ERR_TYPE_COEFF = 0
 
 # Paths relative to this file (evaluate.py)
 inputPath = "./input/"
diff --git a/test/input/fibo.l b/test/input/fibo.l
index f67922d..71b4af8 100644
--- a/test/input/fibo.l
+++ b/test/input/fibo.l
@@ -10,5 +10,5 @@ entier fibo( entier n )
 
 main()
 {
-  ecrire( fibo( 9 ) );
+  ecrire( fibo( 3 ) );
 }
diff --git a/test/nasm-ref/fibo.nasm b/test/nasm-ref/fibo.nasm
index ec408a3..21a296f 100644
--- a/test/nasm-ref/fibo.nasm
+++ b/test/nasm-ref/fibo.nasm
@@ -72,7 +72,7 @@ main :	push	ebp	;sauvegarde la valeur de ebp
 	push	ecx	;sauvegarde de ecx
 	push	edx	;sauvegarde de edx
 	sub	esp,	0	;allocation des variables locales
-	push	9	;Param
+	push	3	;Param
 	sub	esp,	4	;allocation mémoire pour la valeur de retour
 	call	fibo
 	pop	eax	;récupération de la valeur de retour
diff --git a/test/out-ref/fibo.out b/test/out-ref/fibo.out
index c3f407c..00750ed 100644
--- a/test/out-ref/fibo.out
+++ b/test/out-ref/fibo.out
@@ -1 +1 @@
-55
+3
diff --git a/test/pre-nasm-ref/fibo.pre-nasm b/test/pre-nasm-ref/fibo.pre-nasm
index bea531a..e157dca 100644
--- a/test/pre-nasm-ref/fibo.pre-nasm
+++ b/test/pre-nasm-ref/fibo.pre-nasm
@@ -72,7 +72,7 @@ main :	push	ebp	;sauvegarde la valeur de ebp
 	push	ecx	;sauvegarde de ecx
 	push	edx	;sauvegarde de edx
 	sub	esp,	0	;allocation des variables locales
-	push	9	;Param
+	push	3	;Param
 	sub	esp,	4	;allocation mémoire pour la valeur de retour
 	call	fibo
 	pop	@7	;récupération de la valeur de retour
diff --git a/test/sa-ref/fibo.sa b/test/sa-ref/fibo.sa
index 407ebde..86e597c 100644
--- a/test/sa-ref/fibo.sa
+++ b/test/sa-ref/fibo.sa
@@ -1 +1 @@
-(SaProg null (SaLDecFonc (SaDecFonc fibo entier (SaLDecVar (SaDecVarSimple n entier) null) null (SaInstBloc (SaLInst (SaInstSi (SaExpInf (SaExpVar (SaVarSimple n)) 2) (SaInstBloc (SaLInst (SaInstRetour 1) null)) (SaInstBloc (SaLInst (SaInstRetour (SaExpAdd (SaExpAppel (SaAppel fibo (SaLExp (SaExpSub (SaExpVar (SaVarSimple n)) 1) null))) (SaExpAppel (SaAppel fibo (SaLExp (SaExpSub (SaExpVar (SaVarSimple n)) 2) null))))) null))) null))) (SaLDecFonc (SaDecFonc main nul null null (SaInstBloc (SaLInst (SaInstEcriture (SaExpAppel (SaAppel fibo (SaLExp 9 null)))) null))) null)))
+(SaProg null (SaLDecFonc (SaDecFonc fibo entier (SaLDecVar (SaDecVarSimple n entier) null) null (SaInstBloc (SaLInst (SaInstSi (SaExpInf (SaExpVar (SaVarSimple n)) 2) (SaInstBloc (SaLInst (SaInstRetour 1) null)) (SaInstBloc (SaLInst (SaInstRetour (SaExpAdd (SaExpAppel (SaAppel fibo (SaLExp (SaExpSub (SaExpVar (SaVarSimple n)) 1) null))) (SaExpAppel (SaAppel fibo (SaLExp (SaExpSub (SaExpVar (SaVarSimple n)) 2) null))))) null))) null))) (SaLDecFonc (SaDecFonc main nul null null (SaInstBloc (SaLInst (SaInstEcriture (SaExpAppel (SaAppel fibo (SaLExp 3 null)))) null))) null)))
-- 
GitLab