diff options
author | Adam NAILI | 2018-02-23 22:03:52 +0100 |
---|---|---|
committer | Adam NAILI | 2018-02-23 22:03:52 +0100 |
commit | 4d52709e24e05d3f2e1ea449b4a4203604b41aec (patch) | |
tree | 24da9272cdae9e5777e3b27bc3113cafec8bebfc /res/ok_sample.tpc | |
parent | de916ff97b1a15f7188295cb084058dc5e8054c1 (diff) | |
parent | f83fee146e1159344ee30711652b0ae6ebf07a5d (diff) | |
download | tpc-compiler-4d52709e24e05d3f2e1ea449b4a4203604b41aec.tar.gz |
Merge branch 'master' of https://github.com/pacien/upem-compil-tpc
Diffstat (limited to 'res/ok_sample.tpc')
-rw-r--r-- | res/ok_sample.tpc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/res/ok_sample.tpc b/res/ok_sample.tpc new file mode 100644 index 0000000..7591dfd --- /dev/null +++ b/res/ok_sample.tpc | |||
@@ -0,0 +1,24 @@ | |||
1 | /** | ||
2 | * UPEM / Compilation / Projet TPC | ||
3 | * Exemple de fichier source TPC valide | ||
4 | * Pacien TRAN-GIRARD, Adam NAILI | ||
5 | */ | ||
6 | |||
7 | const special = 'b'; | ||
8 | |||
9 | char funky_func(int arg) { | ||
10 | return !arg; | ||
11 | } | ||
12 | |||
13 | void main(void) { | ||
14 | char ret; | ||
15 | ret = 1 + funky_func(0) * 2; | ||
16 | |||
17 | while (ret) { | ||
18 | readc(ret); | ||
19 | print(ret); | ||
20 | |||
21 | if (ret == special) print('!'); | ||
22 | } | ||
23 | } | ||
24 | |||