|
@@ -30,7 +30,7 @@ int nbs_instructions_to_patch[10];
|
30
|
30
|
%token tMUL tDIV tADD tSUB tEQ
|
31
|
31
|
%token<nombre> tNB tNBEXP
|
32
|
32
|
%token<id> tID
|
33
|
|
-%token tPRINTF tGET
|
|
33
|
+%token tPRINTF tGET tSTOP
|
34
|
34
|
%token tERROR
|
35
|
35
|
%token<nombre> tIF tWHILE tELSE
|
36
|
36
|
%token tRETURN
|
|
@@ -69,6 +69,8 @@ Fonction : Main {print_fonctions();};
|
69
|
69
|
|
70
|
70
|
Get : tGET tOBRACE tCBRACE {int addr = push("0_TEMPORARY", 0, integer); add_operation(GET,addr,0,0); $$ = addr;};
|
71
|
71
|
|
|
72
|
+Stop : tSTOP tOBRACE tNB tCBRACE {add_operation(STOP,$3,0,0);};
|
|
73
|
+
|
72
|
74
|
Return : tRETURN E tPV {add_operation(COP,0,$2,0); pop(); };
|
73
|
75
|
|
74
|
76
|
Args : Arg ArgSuite {$$ = $1 + $2; printf("Les arguments de la fonctions vont avoir une taille dans la pile de : %d\n",$$);};
|
|
@@ -90,6 +92,7 @@ Instruction : Invocation tPV{pop();};
|
90
|
92
|
Instruction : If {};
|
91
|
93
|
Instruction : While {};
|
92
|
94
|
Instruction : Return {};
|
|
95
|
+Instruction : Stop tPV {};
|
93
|
96
|
|
94
|
97
|
|
95
|
98
|
Invocation : tID tOBRACE {struct fonction_t fonc = get_fonction($1);}
|