og.pr 5.96 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
/* CIF PROCESS (149, 150), (150, 75) */
PROCESS og;
    /* CIF TEXT (0, 0), (539, 348) */
    -- A Demo to test the generation of _Equal functions from ASN1SCC

dcl V1 My_OctStr :=  'Hello';
dcl V2 My_OctStr := 'World!';

dcl V3 SeqOf := { 'Hello', 'World!' };
dcl V4 SeqOf := { 'Hello', 'World' };

dcl fail t_bool := false;
13
14
15
16
17
18

-- Test optional field
dcl V5 Toto := { elem_1 'Hello' }; 
dcl V6 Toto := { elem_1 'Hello', elem_2 {'Hello', 'World'} };

dcl V7 AChoice := a: TRUE;
19
dcl V8 ACHoice := b: {'Hello', 'World!'};
20
    /* CIF ENDTEXT */
21
    /* CIF START (1109, 72), (60, 30) */
22
    START;
23
24
25
        /* CIF TASK (1050, 118), (177, 35) */
        TASK v8 := b: {'hello', 'world'} ;
        /* CIF LABEL (1104, 168), (70, 35) */
26
        one:
27
        /* CIF DECISION (1090, 218), (98, 50) */
28
        DECISION V1 = V2;
29
                /* CIF ANSWER (962, 288), (73, 28) */
30
                (true):
31
                    /* CIF TASK (937, 331), (123, 35) */
32
                    TASK fail := false;
33
                    /* CIF PROCEDURECALL (923, 381), (150, 38) */
34
                    CALL writeln('2');
35
                    /* CIF LABEL (963, 434), (70, 35) */
36
                    two:
37
                    /* CIF DECISION (949, 484), (98, 50) */
38
                    DECISION V3 = V4;
39
                            /* CIF ANSWER (616, 554), (73, 28) */
40
                            (true):
41
                                /* CIF TASK (591, 597), (123, 35) */
42
                                TASK fail := false;
43
                                /* CIF PROCEDURECALL (577, 647), (150, 38) */
44
                                CALL writeln('4');
45
                                /* CIF LABEL (611, 700), (82, 35) */
46
                                three:
47
                                /* CIF DECISION (574, 750), (156, 95) */
48
49
                                DECISION V5 /= V6
and V7 /= V8;
50
                                        /* CIF ANSWER (540, 865), (73, 28) */
51
                                        (true):
52
                                            /* CIF PROCEDURECALL (501, 908), (150, 38) */
53
                                            CALL writeln('5');
54
                                            /* CIF TASK (454, 961), (245, 68) */
55
56
57
                                            TASK V5 := V6,
V7 := b: {'Hello', 'World'},
V8!b(1) := V7!b(1)(0 ,4);
58
                                            /* CIF JOIN (559, 1044), (35, 35) */
59
                                            JOIN three;
60
                                        /* CIF ANSWER (745, 865), (78, 28) */
61
                                        (false):
62
                                            /* CIF PROCEDURECALL (709, 908), (150, 38) */
63
                                            CALL writeln('6');
64
                                            /* CIF NEXTSTATE (749, 961), (70, 35) */
65
66
                                            NEXTSTATE wait;
                                ENDDECISION;
67
                            /* CIF ANSWER (1530, 554), (78, 28) */
68
                            (false):
69
                                /* CIF DECISION (1530, 597), (78, 50) */
70
                                DECISION fail;
71
                                        /* CIF ANSWER (1423, 667), (73, 28) */
72
                                        (true):
73
                                            /* CIF PROCEDURECALL (1233, 710), (452, 38) */
74
                                            CALL writeln('FAIL: V3 = V4 reports FALSE, but...');
75
                                            /* CIF PROCEDURECALL (1190, 763), (539, 35) */
76
                                            CALL writeln('Length of V3(1) =', Length(V3(1)), ' and Value = ', V3(1));
77
                                            /* CIF PROCEDURECALL (1185, 813), (549, 35) */
78
                                            CALL writeln('Length of V4(1) =', Length(V4(1)), ' and Value = ', V4(1));
79
                                            /* CIF NEXTSTATE (1424, 863), (70, 35) */
80
                                            NEXTSTATE wait;
81
                                        /* CIF ANSWER (1803, 667), (78, 28) */
82
                                        (false):
83
                                            /* CIF PROCEDURECALL (1767, 710), (150, 38) */
84
                                            CALL writeln('3');
85
                                            /* CIF TASK (1744, 763), (196, 35) */
86
                                            TASK V3(1) := V4(1)(0,4);
87
                                            /* CIF TASK (1783, 813), (118, 35) */
88
                                            TASK fail := true;
89
                                            /* CIF JOIN (1824, 863), (35, 35) */
90
                                            JOIN two;
91
92
                                ENDDECISION;
                    ENDDECISION;
93
                /* CIF ANSWER (2032, 288), (78, 28) */
94
                (false):
95
                    /* CIF DECISION (2032, 331), (78, 50) */
96
                    DECISION fail;
97
                            /* CIF ANSWER (1990, 401), (73, 28) */
98
                            (true):
99
                                /* CIF PROCEDURECALL (1950, 444), (153, 38) */
100
                                CALL writeln('FAIL');
101
                                /* CIF NEXTSTATE (1991, 497), (70, 35) */
102
                                NEXTSTATE wait;
103
                            /* CIF ANSWER (2150, 401), (78, 28) */
104
                            (false):
105
                                /* CIF PROCEDURECALL (2114, 444), (150, 38) */
106
                                CALL writeln('1');
107
                                /* CIF TASK (2135, 497), (108, 35) */
108
                                TASK V2 := V1;
109
                                /* CIF TASK (2130, 547), (118, 35) */
110
                                TASK fail := true;
111
                                /* CIF JOIN (2171, 597), (35, 35) */
112
                                JOIN one;
113
114
                    ENDDECISION;
        ENDDECISION;
115
    /* CIF STATE (130, 407), (70, 35) */
116
117
118
    STATE wait;
    ENDSTATE;
ENDPROCESS og;