diff options
author | Adam NAILI | 2018-05-14 15:48:01 +0200 |
---|---|---|
committer | Adam NAILI | 2018-05-14 15:48:01 +0200 |
commit | 67fc7933df394848eeb86a45f37e35ded032e5e9 (patch) | |
tree | f5453f99cbbea8267f765120389372d7f5d1a32d /src/tpc.y | |
parent | 337ca2a847e6c5f7555c90807f13412c349b753f (diff) | |
download | tpc-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.y | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -12,6 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <stdio.h> | 14 | #include <stdio.h> |
15 | int 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 | ; |
91 | EnTeteFonct: | 92 | EnTeteFonct: |
92 | TYPE IDENT '(' Parametres ')' | 93 | TYPE IDENT Prologue '(' Parametres ')' |
93 | | VOID IDENT '(' Parametres ')' | 94 | | VOID IDENT Prologue '(' Parametres ')' |
94 | ; | 95 | ; |
96 | Prologue: {gen_prologue_continue();}; | ||
97 | |||
95 | Parametres: | 98 | Parametres: |
96 | VOID | 99 | VOID |
97 | | ListTypVar | 100 | | ListTypVar |