Browse Source

OK A Tester

Paul Faure 2 years ago
parent
commit
87e913b228
5 changed files with 18 additions and 10 deletions
  1. 14
    6
      Fichiers_Tests/progC
  2. 2
    2
      Lex_Yacc/as.dot
  3. 1
    1
      Lex_Yacc/as.y
  4. BIN
      Tables/Fonctions/tab_fonctions.o
  5. 1
    1
      Tables/Symboles/table_symboles.c

+ 14
- 6
Fichiers_Tests/progC View File

@@ -1,10 +1,18 @@
1
-int fonction(int p){ 
2
-	int y = p*3;
3
-	return y;
1
+int g(int tab[]){
2
+	tab[1] = 10;
3
+	printf(tab[0]);
4
+	stop(15);
5
+	return 2;
6
+}
7
+
8
+int f(int p[]){
9
+	p[0] = 1;
10
+	g(p);
11
+	return 1;
4 12
 }
5 13
 
6 14
 int main(){
7
-	int a;
8
-	int c = fonction(3);
9
-	stop(3);
15
+	int a[5];
16
+	f(a);
17
+	printf(a[1]);
10 18
 }

+ 2
- 2
Lex_Yacc/as.dot View File

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

+ 1
- 1
Lex_Yacc/as.y View File

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

BIN
Tables/Fonctions/tab_fonctions.o View File


+ 1
- 1
Tables/Symboles/table_symboles.c View File

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

Loading…
Cancel
Save