diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-12-23 13:15:39 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-12-23 13:15:39 +0000 |
commit | 354f00f513160dfb7b03948152c605dc4a48f987 (patch) | |
tree | 4e3dfbd9514bf37ef74e75166e04d30e79a4badf /src | |
parent | 417167b77f6f6a904892e628824b26660ea809c7 (diff) | |
download | gnunet-354f00f513160dfb7b03948152c605dc4a48f987.tar.gz gnunet-354f00f513160dfb7b03948152c605dc4a48f987.zip |
moved
Diffstat (limited to 'src')
-rw-r--r-- | src/monkey/seaspider/org/gnunet/seaspider/SeaspiderTest.c | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/src/monkey/seaspider/org/gnunet/seaspider/SeaspiderTest.c b/src/monkey/seaspider/org/gnunet/seaspider/SeaspiderTest.c deleted file mode 100644 index 09e6e4710..000000000 --- a/src/monkey/seaspider/org/gnunet/seaspider/SeaspiderTest.c +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | /** | ||
2 | * @file seaspider/SeaspiderTest.c | ||
3 | * @brief C file to test Seaspider's parsing | ||
4 | */ | ||
5 | |||
6 | /* include */ | ||
7 | #include <stdio.h> | ||
8 | |||
9 | |||
10 | #define PRE_PROC_DIR 0 | ||
11 | #define MACRO_fun(arg1, arg2) (arg1 + arg2) | ||
12 | |||
13 | struct MyStruct { | ||
14 | int member; | ||
15 | struct MyStruct *part; | ||
16 | }; | ||
17 | |||
18 | |||
19 | enum MyEnum{ | ||
20 | enumMember1, | ||
21 | enumMember2, | ||
22 | enumMember3 | ||
23 | }; | ||
24 | |||
25 | |||
26 | static int fun(int arg1, int arg2) | ||
27 | { | ||
28 | return arg1 + arg2; | ||
29 | } | ||
30 | |||
31 | |||
32 | int main(int args, const char * argv[]) | ||
33 | { | ||
34 | /* variables declarations */ | ||
35 | struct MyStruct whole; | ||
36 | struct MyStruct part; | ||
37 | enum MyEnum myEnum; | ||
38 | int i; | ||
39 | int x, y; | ||
40 | |||
41 | /* Allocations and assignments */ | ||
42 | whole.member = 1; | ||
43 | whole.part = ∂ | ||
44 | whole.part->member = 2; | ||
45 | myEnum = enumMember3; | ||
46 | x = 0, y = 1; | ||
47 | |||
48 | /* block */ | ||
49 | { | ||
50 | /* arithmetic and logic operations */ | ||
51 | float f = 20.0; | ||
52 | whole.part->member = (int)(whole.part->member + 5) - 6; // cast - multilevel assignment | ||
53 | } | ||
54 | |||
55 | /* for loop */ | ||
56 | for (i = 0; i < 2; i++) { | ||
57 | /* conditional expressions */ | ||
58 | if ( x > 0) { | ||
59 | while (y < 5) { | ||
60 | y++; | ||
61 | } | ||
62 | } else if (x > 0 || y == 4) { | ||
63 | do { | ||
64 | y--; | ||
65 | } while (y != 1); | ||
66 | } | ||
67 | else { | ||
68 | switch (myEnum) { | ||
69 | case enumMember1: | ||
70 | fun(enumMember1, enumMember2); | ||
71 | break; | ||
72 | case enumMember2: | ||
73 | fun(enumMember1, enumMember2 ? enumMember2 : enumMember1); // ternary operator | ||
74 | break; | ||
75 | default: | ||
76 | MACRO_fun(enumMember1, PRE_PROC_DIR); // preprocessing directive | ||
77 | break; | ||
78 | } | ||
79 | } | ||
80 | } | ||
81 | |||
82 | return 1; | ||
83 | } | ||