Skip to content
Snippets Groups Projects
Commit 0afa042d authored by Alexis Nasr's avatar Alexis Nasr
Browse files

modification des coefficients dans evaluate.py et modification du fichier de test fibo.l

parent 7729740d
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ public class SaEval extends SaDepthFirstVisitor <TypeVal> { ...@@ -24,7 +24,7 @@ public class SaEval extends SaDepthFirstVisitor <TypeVal> {
try{ try{
appelMain.accept(this); appelMain.accept(this);
} catch(Exception e){ } catch(Exception e){
e.printStackTrace() e.printStackTrace();
} }
} }
......
...@@ -19,7 +19,7 @@ fibo fbegin #entree fonction ...@@ -19,7 +19,7 @@ fibo fbegin #entree fonction
fend fend
1 fend 1 fend
main fbegin #entree fonction main fbegin #entree fonction
param 9 param 3
@7 = call fibo @7 = call fibo
write @7 write @7
fend fend
...@@ -18,16 +18,16 @@ ERR_LEX_CODE = 6 ...@@ -18,16 +18,16 @@ ERR_LEX_CODE = 6
SC_COEFF = 4 SC_COEFF = 4
SA_DIFF_COEFF = 0 SA_DIFF_COEFF = 0
TS_DIFF_COEFF = 0 TS_DIFF_COEFF = 0
SA_COEFF = 3 SA_COEFF = 4
C3A_DIFF_COEFF = 0 C3A_DIFF_COEFF = 0
C3A_COEFF = 3 C3A_COEFF = 4
PRE_NASM_DIFF = 0 PRE_NASM_DIFF = 0
PRE_NASM_COEFF = 3 PRE_NASM_COEFF = 3
NASM_DIFF_COEFF = 0 NASM_DIFF_COEFF = 0
NASM_COEFF = 3 NASM_COEFF = 3
EXE_COEFF = 0 EXE_COEFF = 0
ERR_TS_COEFF = 2 ERR_TS_COEFF = 2
ERR_TYPE_COEFF = 2 ERR_TYPE_COEFF = 0
# Paths relative to this file (evaluate.py) # Paths relative to this file (evaluate.py)
inputPath = "./input/" inputPath = "./input/"
......
...@@ -10,5 +10,5 @@ entier fibo( entier n ) ...@@ -10,5 +10,5 @@ entier fibo( entier n )
main() main()
{ {
ecrire( fibo( 9 ) ); ecrire( fibo( 3 ) );
} }
...@@ -72,7 +72,7 @@ main : push ebp ;sauvegarde la valeur de ebp ...@@ -72,7 +72,7 @@ main : push ebp ;sauvegarde la valeur de ebp
push ecx ;sauvegarde de ecx push ecx ;sauvegarde de ecx
push edx ;sauvegarde de edx push edx ;sauvegarde de edx
sub esp, 0 ;allocation des variables locales sub esp, 0 ;allocation des variables locales
push 9 ;Param push 3 ;Param
sub esp, 4 ;allocation mémoire pour la valeur de retour sub esp, 4 ;allocation mémoire pour la valeur de retour
call fibo call fibo
pop eax ;récupération de la valeur de retour pop eax ;récupération de la valeur de retour
......
55 3
...@@ -72,7 +72,7 @@ main : push ebp ;sauvegarde la valeur de ebp ...@@ -72,7 +72,7 @@ main : push ebp ;sauvegarde la valeur de ebp
push ecx ;sauvegarde de ecx push ecx ;sauvegarde de ecx
push edx ;sauvegarde de edx push edx ;sauvegarde de edx
sub esp, 0 ;allocation des variables locales sub esp, 0 ;allocation des variables locales
push 9 ;Param push 3 ;Param
sub esp, 4 ;allocation mémoire pour la valeur de retour sub esp, 4 ;allocation mémoire pour la valeur de retour
call fibo call fibo
pop @7 ;récupération de la valeur de retour pop @7 ;récupération de la valeur de retour
......
(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)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment