og.pr 3.52 KB
Newer Older
1
/* CIF PROCESS (252, 216), (150, 75) */
Maxime Perrotin's avatar
Maxime Perrotin committed
2
PROCESS og;
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
STATE all_done;
SUBSTRUCTURE
STATE Bonjour;
SUBSTRUCTURE
/* CIF PROCEDURE (72, 110), (73, 35) */
PROCEDURE entry;
/* CIF START (258, 113), (70, 35) */
START;
/* CIF PROCEDURECALL (202, 163), (181, 35) */
CALL writeln('bonjour entry');
/* CIF RETURN (275, 213), (35, 35) */
RETURN ;
ENDPROCEDURE;
/* CIF START (190, 52), (70, 35) */
START;
/* CIF NEXTSTATE (189, 102), (72, 35) */
NEXTSTATE dumb;
/* CIF STATE (312, 42), (72, 35) */
STATE dumb;
ENDSTATE;
Maxime Perrotin's avatar
Maxime Perrotin committed
23

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
ENDSUBSTRUCTURE;
/* CIF TEXT (118, 110), (298, 140) */
-- Declare your variables

-- Syntax: DCL <variable name> <type name>;

dcl tmp my_OctStr;
/* CIF ENDTEXT */
/* CIF PROCEDURE (298, 308), (73, 35) */
PROCEDURE entry;
/* CIF START (171, 108), (70, 35) */
START;
/* CIF PROCEDURECALL (131, 158), (149, 35) */
CALL writeln('All done');
/* CIF RETURN (188, 208), (35, 35) */
RETURN ;
ENDPROCEDURE;
/* CIF START (473, 144), (70, 35) */
START;
/* CIF NEXTSTATE (466, 194), (84, 35) */
NEXTSTATE Bonjour;

/* CIF STATE (564, 193), (125, 35) */
STATE Dumb, Bonjour;
/* CIF INPUT (583, 248), (87, 35) */
INPUT go(tmp);
50
51
52
/* CIF PROCEDURECALL (545, 298), (162, 35) */
CALL writeln('TEST');
/* CIF NEXTSTATE (591, 348), (70, 35) */
53
54
55
56
57
58
59
60
NEXTSTATE -;
ENDSTATE;
/* CIF STATE (459, 366), (84, 35) */
STATE Bonjour;
ENDSTATE;

ENDSUBSTRUCTURE;
/* CIF TEXT (0, 0), (229, 98) */
Maxime Perrotin's avatar
Maxime Perrotin committed
61
62
63
64
-- Testing decisions

dcl test myInteger := 3;
/* CIF ENDTEXT */
65
/* CIF START (342, 35), (70, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
66
START;
67
/* CIF LABEL (334, 85), (85, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
68
again:
69
/* CIF DECISION (342, 135), (70, 50) */
Maxime Perrotin's avatar
Maxime Perrotin committed
70
DECISION test;
71
/* CIF ANSWER (-7, 205), (70, 23) */
Maxime Perrotin's avatar
Maxime Perrotin committed
72
(3):
73
/* CIF PROCEDURECALL (-25, 243), (106, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
74
CALL writeln('1');
75
/* CIF TASK (-15, 293), (87, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
76
TASK test := 5;
77
/* CIF JOIN (10, 343), (35, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
78
JOIN again;
79
/* CIF ANSWER (486, 205), (70, 23) */
Maxime Perrotin's avatar
Maxime Perrotin committed
80
(>5):
81
/* CIF PROCEDURECALL (464, 243), (113, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
82
CALL writeln('4');
83
/* CIF TASK (477, 293), (87, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
84
TASK test := 7;
85
/* CIF LABEL (472, 343), (98, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
86
and_again:
87
/* CIF DECISION (486, 393), (70, 50) */
Maxime Perrotin's avatar
Maxime Perrotin committed
88
DECISION test;
89
/* CIF ANSWER (585, 463), (70, 23) */
Maxime Perrotin's avatar
Maxime Perrotin committed
90
(<=5):
91
/* CIF DECISION (585, 501), (70, 50) */
Maxime Perrotin's avatar
Maxime Perrotin committed
92
DECISION test;
93
/* CIF ANSWER (480, 571), (70, 23) */
Maxime Perrotin's avatar
Maxime Perrotin committed
94
(>=5):
95
/* CIF PROCEDURECALL (449, 609), (132, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
96
CALL writeln('6');
97
/* CIF ANSWER (650, 571), (70, 23) */
Maxime Perrotin's avatar
Maxime Perrotin committed
98
else:
99
/* CIF PROCEDURECALL (611, 609), (148, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
100
101
CALL writeln('[ERROR]');
ENDDECISION;
102
/* CIF ANSWER (348, 463), (70, 23) */
Maxime Perrotin's avatar
Maxime Perrotin committed
103
(/=5):
104
/* CIF PROCEDURECALL (326, 501), (113, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
105
CALL writeln('5');
106
/* CIF TASK (339, 551), (87, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
107
TASK test := 5;
108
/* CIF JOIN (365, 601), (35, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
109
110
JOIN and_again;
ENDDECISION;
111
/* CIF ANSWER (225, 205), (70, 23) */
Maxime Perrotin's avatar
Maxime Perrotin committed
112
(<5):
113
/* CIF PROCEDURECALL (203, 243), (113, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
114
CALL writeln('3');
115
/* CIF TASK (213, 293), (94, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
116
TASK test := 6;
117
/* CIF JOIN (242, 343), (35, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
118
JOIN again;
119
/* CIF ANSWER (106, 205), (70, 23) */
Maxime Perrotin's avatar
Maxime Perrotin committed
120
(=5):
121
/* CIF PROCEDURECALL (88, 243), (106, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
122
CALL writeln('2');
123
/* CIF TASK (94, 293), (94, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
124
TASK test := 4;
125
/* CIF JOIN (123, 343), (35, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
126
JOIN again;
127
/* CIF ANSWER (808, 205), (70, 23) */
Maxime Perrotin's avatar
Maxime Perrotin committed
128
else:
129
/* CIF PROCEDURECALL (769, 243), (148, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
130
131
CALL writeln('[ERROR]');
ENDDECISION;
132
/* CIF PROCEDURECALL (293, 689), (167, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
133
CALL writeln('end of test');
134
/* CIF NEXTSTATE (332, 739), (90, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
135
NEXTSTATE all_done;
136
137
138
139
140
141
142
143
144
145
146

/* CIF STATE (927, 81), (124, 35) */
STATE toto, all_done;
/* CIF INPUT (954, 136), (70, 35) */
INPUT bye;
/* CIF PROCEDURECALL (928, 186), (122, 35) */
CALL writeln('Bye');
/* CIF NEXTSTATE (954, 236), (70, 35) */
NEXTSTATE -;
ENDSTATE;
/* CIF STATE (1061, 79), (90, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
147
148
149
150
STATE all_done;
ENDSTATE;

ENDPROCESS og;