source:
tests/io/io1.cfa
@
fcd65ca
Last change on this file since fcd65ca was 6083392, checked in by , 4 years ago | |
---|---|
|
|
File size: 1.7 KB |
Rev | Line | |
---|---|---|
[73abe95] | 1 | // |
[ef3403c6] | 2 | // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo |
3 | // | |
4 | // The contents of this file are covered under the licence agreement in the | |
5 | // file "LICENCE" distributed with Cforall. | |
[73abe95] | 6 | // |
[dc8511c] | 7 | // io1.cfa -- |
[73abe95] | 8 | // |
[ef3403c6] | 9 | // Author : Peter A. Buhr |
10 | // Created On : Wed Mar 2 16:56:02 2016 | |
11 | // Last Modified By : Peter A. Buhr | |
[72c6950] | 12 | // Last Modified On : Sun Feb 21 10:07:07 2021 |
13 | // Update Count : 119 | |
[73abe95] | 14 | // |
[ef3403c6] | 15 | |
[73abe95] | 16 | #include <fstream.hfa> |
[ef3403c6] | 17 | |
18 | int main() { | |
[72c6950] | 19 | sout | nlOff; // auto nl off |
[ef3403c6] | 20 | |
[5ea5b28] | 21 | sout | "opening delimiters" | nl; |
22 | sout | "x (" | 1; | |
23 | sout | "x [" | 2; | |
24 | sout | "x {" | 3; | |
25 | sout | "x =" | 4; | |
26 | sout | "x $" | 5; | |
[72c6950] | 27 | sout | "x £" | 6; |
28 | sout | "x ¥" | 7; | |
29 | sout | "x ¡" | 8; | |
30 | sout | "x ¿" | 9; | |
31 | sout | "x «" | 10; | |
[5ea5b28] | 32 | sout | nl | nl; |
[ef3403c6] | 33 | |
[5ea5b28] | 34 | sout | "closing delimiters" | nl; |
35 | sout | 1 | ", x"; | |
36 | sout | 2 | ". x"; | |
37 | sout | 3 | "; x"; | |
38 | sout | 4 | "! x"; | |
39 | sout | 5 | "? x"; | |
40 | sout | 6 | "% x"; | |
[72c6950] | 41 | sout | 7 | "¢ x"; |
42 | sout | 8 | "» x"; | |
[5ea5b28] | 43 | sout | 9 | ") x"; |
44 | sout | 10 | "] x"; | |
[7cccc20] | 45 | sout | 11 | "} x"; |
[5ea5b28] | 46 | sout | nl | nl; |
[ef3403c6] | 47 | |
[5ea5b28] | 48 | sout | "opening/closing delimiters" | nl; |
49 | sout | "x`" | 1 | "`x'" | 2; | |
50 | sout | "'x\"" | 3 | "\"x:" | 4; | |
51 | sout | ":x " | 5 | " x\t" | 6; | |
52 | sout | "\tx\f" | 7 | "\fx\v" | 8; | |
53 | sout | "\vx\n" | 9 | "\nx\r" | 10; | |
[7cccc20] | 54 | sout | "\rx"; |
[5ea5b28] | 55 | sout | nl | nl; |
[ef3403c6] | 56 | |
[72c6950] | 57 | sout | nlOn; // auto nl on |
58 | ||
[200fcb3] | 59 | sout | "override opening/closing delimiters"; |
60 | sout | "x ( " | 1 | " ) x" | 2 | " , x" | 3 | " :x: " | 4; | |
[5ea5b28] | 61 | sout | nl; |
[72c6950] | 62 | |
63 | sout | "spacing"; | |
64 | sout | 0 | 1 | 2 | 3; | |
65 | sout | '0' | '1' | '2' | '3'; | |
66 | sout | 0 | "" | 1 | "" | 2 | "" | 3; | |
67 | sout | nl; | |
68 | ||
69 | sout | "expressions"; | |
70 | int x = 3, y = 5, z = 7; | |
71 | sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2); | |
[ef3403c6] | 72 | } |
73 | ||
74 | // Local Variables: // | |
75 | // tab-width: 4 // | |
[dc8511c] | 76 | // compile-command: "cfa io1.cfa" // |
[ef3403c6] | 77 | // End: // |
Note: See TracBrowser
for help on using the repository browser.