diff options
author | Adam NAILI | 2018-04-22 14:49:42 +0200 |
---|---|---|
committer | Adam NAILI | 2018-04-22 14:49:42 +0200 |
commit | 40f423a4b3b1e64e8424ab239cc14ecc5077640f (patch) | |
tree | c7da7c2eed97d62cc8ab2e003293935cda5a93dc /res | |
parent | c0802bc17f856546b95a5b51252f7a35d9e1ab10 (diff) | |
download | tpc-compiler-40f423a4b3b1e64e8424ab239cc14ecc5077640f.tar.gz |
Beginning of the symbol table implementation
Diffstat (limited to 'res')
-rw-r--r-- | res/ko_sample.tpc | 2 | ||||
-rw-r--r-- | res/ok_sample.tpc | 4 | ||||
-rw-r--r-- | res/test-table-symboles.tpc | 13 |
3 files changed, 16 insertions, 3 deletions
diff --git a/res/ko_sample.tpc b/res/ko_sample.tpc index f3a4c7a..9dc344f 100644 --- a/res/ko_sample.tpc +++ b/res/ko_sample.tpc | |||
@@ -6,7 +6,7 @@ | |||
6 | 6 | ||
7 | const special = 'b'; | 7 | const special = 'b'; |
8 | 8 | ||
9 | char funky_func(int arg) { | 9 | caractere funky_func(entier arg) { |
10 | return !arg; | 10 | return !arg; |
11 | } | 11 | } |
12 | 12 | ||
diff --git a/res/ok_sample.tpc b/res/ok_sample.tpc index 7591dfd..7b56e7f 100644 --- a/res/ok_sample.tpc +++ b/res/ok_sample.tpc | |||
@@ -6,12 +6,12 @@ | |||
6 | 6 | ||
7 | const special = 'b'; | 7 | const special = 'b'; |
8 | 8 | ||
9 | char funky_func(int arg) { | 9 | caractere funky_func(entier arg) { |
10 | return !arg; | 10 | return !arg; |
11 | } | 11 | } |
12 | 12 | ||
13 | void main(void) { | 13 | void main(void) { |
14 | char ret; | 14 | caractere ret; |
15 | ret = 1 + funky_func(0) * 2; | 15 | ret = 1 + funky_func(0) * 2; |
16 | 16 | ||
17 | while (ret) { | 17 | while (ret) { |
diff --git a/res/test-table-symboles.tpc b/res/test-table-symboles.tpc new file mode 100644 index 0000000..3c12144 --- /dev/null +++ b/res/test-table-symboles.tpc | |||
@@ -0,0 +1,13 @@ | |||
1 | /* test-table-symboles.tpc */ | ||
2 | |||
3 | /* Test file for simplified translator of a declaration of variables in C */ | ||
4 | entier r1,b,s,c,r2 ; | ||
5 | caractere letter, digit, punct; | ||
6 | |||
7 | entier main(void) { | ||
8 | r1=12; | ||
9 | r2=24; | ||
10 | b=r1+r2; | ||
11 | punct='.'; | ||
12 | return b; | ||
13 | } | ||