aboutsummaryrefslogtreecommitdiff
path: root/src/tpc.y
diff options
context:
space:
mode:
authorAdam NAILI2018-05-14 15:48:01 +0200
committerAdam NAILI2018-05-14 15:48:01 +0200
commit67fc7933df394848eeb86a45f37e35ded032e5e9 (patch)
treef5453f99cbbea8267f765120389372d7f5d1a32d /src/tpc.y
parent337ca2a847e6c5f7555c90807f13412c349b753f (diff)
downloadtpc-compiler-67fc7933df394848eeb86a45f37e35ded032e5e9.tar.gz
Not working properly: Beginning of the implementation of globals -> need to modify if(global) else
Diffstat (limited to 'src/tpc.y')
-rw-r--r--src/tpc.y7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tpc.y b/src/tpc.y
index 17b8718..6da63ef 100644
--- a/src/tpc.y
+++ b/src/tpc.y
@@ -12,6 +12,7 @@
12 */ 12 */
13 13
14#include <stdio.h> 14#include <stdio.h>
15int nb_globals = 0;
15#include "symbol_table.h" 16#include "symbol_table.h"
16#include "generator.h" 17#include "generator.h"
17 18
@@ -89,9 +90,11 @@ DeclFonct:
89 Corps { scope = GLOBAL; } 90 Corps { scope = GLOBAL; }
90; 91;
91EnTeteFonct: 92EnTeteFonct:
92 TYPE IDENT '(' Parametres ')' 93 TYPE IDENT Prologue '(' Parametres ')'
93| VOID IDENT '(' Parametres ')' 94| VOID IDENT Prologue '(' Parametres ')'
94; 95;
96Prologue: {gen_prologue_continue();};
97
95Parametres: 98Parametres:
96 VOID 99 VOID
97| ListTypVar 100| ListTypVar