OK A Tester

This commit is contained in:
Paul Faure 2021-05-10 14:16:21 +02:00
parent f4356f9d58
commit 87e913b228
5 changed files with 18 additions and 10 deletions

View file

@ -1,10 +1,18 @@
int fonction(int p){ int g(int tab[]){
int y = p*3; tab[1] = 10;
return y; printf(tab[0]);
stop(15);
return 2;
}
int f(int p[]){
p[0] = 1;
g(p);
return 1;
} }
int main(){ int main(){
int a; int a[5];
int c = fonction(3); f(a);
stop(3); printf(a[1]);
} }

View file

@ -1,6 +1,6 @@
// Produit par GNU Bison 3.5.1. // Produit par GNU Bison 3.0.4.
// Rapporter les bugs à <bug-bison@gnu.org>. // Rapporter les bugs à <bug-bison@gnu.org>.
// Page d'accueil: <https://www.gnu.org/software/bison/>. // Page d'accueil: <http://www.gnu.org/software/bison/>.
digraph "Lex_Yacc/as.y" digraph "Lex_Yacc/as.y"
{ {

View file

@ -104,7 +104,7 @@ else{
$$ = push("0_TEMPORARY_RETURN", 0, fonc.return_type); $$ = push("0_TEMPORARY_RETURN", 0, fonc.return_type);
}}; }};
Invocation : tPRINTF tOBRACE E tCBRACE{add_operation(PRI,$3,0,0); pop();}; Invocation : tPRINTF tOBRACE E tCBRACE{add_operation(PRI,$3,0,0);};
Params : {$$ = 0; printf("Sans Params\n"); } ; Params : {$$ = 0; printf("Sans Params\n"); } ;
Params : Param SuiteParams {$$ = $2 + 1;}; Params : Param SuiteParams {$$ = $2 + 1;};

Binary file not shown.

View file

@ -34,7 +34,7 @@ Opérations possible :
int last_addr = 0; int last_addr = 0;
int temp_addr = MAXADDR; int temp_addr = MAXADDR;
int taille_types[] = {-1, 4}; int taille_types[] = {-1, 1};
int profondeur = 0; int profondeur = 0;
int last_temp_var_size; int last_temp_var_size;
const struct type_t integer = {INT, 0, 1}; const struct type_t integer = {INT, 0, 1};