From 38771494bada2b71a5e3a320938e6a259c1e208c Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Wed, 6 Jun 2018 03:06:34 +0200 Subject: Fixing chain declarator and array conflict --- res/test_add.tpc | 5 ++--- res/test_global.tpc | 11 +++++------ res/test_mul.tpc | 7 ++++--- 3 files changed, 11 insertions(+), 12 deletions(-) (limited to 'res') diff --git a/res/test_add.tpc b/res/test_add.tpc index 2f6b9dd..848130c 100644 --- a/res/test_add.tpc +++ b/res/test_add.tpc @@ -1,12 +1,11 @@ -/* test-table-symboles.tpc */ - -/* Test file for simplified translator of a declaration of variables in C */ entier a; entier main(void) { entier a,b,res; a = 2; b = 3; + res = a + b; + print(res); res = a - b; print(res); } diff --git a/res/test_global.tpc b/res/test_global.tpc index 731fffb..8fda248 100644 --- a/res/test_global.tpc +++ b/res/test_global.tpc @@ -1,15 +1,14 @@ -/* test-table-symboles.tpc */ - -/* Test file for simplified translator of a declaration of variables in C */ entier r1,b,s,c,r2 ; caractere letter, digit, punct; +entier i; + void calcul(void) { - entier i; - i = 3; r1=12; r2=13; - b = r1 + r2 + i; + s = 3; + + b = r1 + r2 + s; print(b); } diff --git a/res/test_mul.tpc b/res/test_mul.tpc index f3b6705..62a8080 100644 --- a/res/test_mul.tpc +++ b/res/test_mul.tpc @@ -1,12 +1,13 @@ -/* test-table-symboles.tpc */ - -/* Test file for simplified translator of a declaration of variables in C */ entier a; entier main(void) { entier a,b,res; a = 2; b = 3; + res = a * b; + print(res); + res = a / b; + print(res); res = a % b; print(res); } -- cgit v1.2.3