og.pr 6.08 KB
Newer Older
1
2
/* CIF PROCESS (149, 150), (150, 75) */
PROCESS og;
Maxime Perrotin's avatar
Maxime Perrotin committed
3
    /* CIF TEXT (97, 0), (427, 348) */
4
5
6
7
8
9
10
11
12
    -- 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

-- Test optional field
dcl V5 Toto := { elem_1 'Hello' }; 
16
dcl V6 Toto := { elem_1 'Hello', elem_2 {'Ola', 'TheWorld'} };
17
18

dcl V7 AChoice := a: TRUE;
19
dcl V8 ACHoice := b: {'Hello', 'World!'};
20
    /* CIF ENDTEXT */
Maxime Perrotin's avatar
Maxime Perrotin committed
21
    /* CIF START (1065, 26), (60, 30) */
22
    START;
Maxime Perrotin's avatar
Maxime Perrotin committed
23
        /* CIF TASK (1007, 72), (177, 35) */
24
        TASK v8 := b: {'hello', 'world'};
Maxime Perrotin's avatar
Maxime Perrotin committed
25
        /* CIF LABEL (1060, 122), (70, 35) */
26
        one:
Maxime Perrotin's avatar
Maxime Perrotin committed
27
        /* CIF DECISION (1046, 172), (98, 50) */
28
        DECISION V1 = V2;
Maxime Perrotin's avatar
Maxime Perrotin committed
29
                /* CIF ANSWER (669, 242), (73, 28) */
30
                (true):
Maxime Perrotin's avatar
Maxime Perrotin committed
31
                    /* CIF TASK (644, 285), (123, 35) */
32
                    TASK fail := false;
Maxime Perrotin's avatar
Maxime Perrotin committed
33
                    /* CIF PROCEDURECALL (653, 335), (106, 38) */
34
                    CALL writeln('2');
Maxime Perrotin's avatar
Maxime Perrotin committed
35
                    /* CIF LABEL (671, 388), (70, 35) */
36
                    two:
Maxime Perrotin's avatar
Maxime Perrotin committed
37
                    /* CIF DECISION (657, 438), (98, 50) */
38
                    DECISION V3 = V4;
Maxime Perrotin's avatar
Maxime Perrotin committed
39
                            /* CIF ANSWER (452, 508), (73, 28) */
40
                            (true):
Maxime Perrotin's avatar
Maxime Perrotin committed
41
                                /* CIF TASK (427, 551), (123, 35) */
42
                                TASK fail := false;
Maxime Perrotin's avatar
Maxime Perrotin committed
43
                                /* CIF PROCEDURECALL (436, 601), (106, 38) */
44
                                CALL writeln('4');
Maxime Perrotin's avatar
Maxime Perrotin committed
45
                                /* CIF LABEL (448, 654), (82, 35) */
46
                                three:
Maxime Perrotin's avatar
Maxime Perrotin committed
47
                                /* CIF DECISION (411, 704), (156, 95) */
48
49
                                DECISION V5 /= V6
and V7 /= V8;
Maxime Perrotin's avatar
Maxime Perrotin committed
50
                                        /* CIF ANSWER (376, 819), (73, 28) */
51
                                        (true):
Maxime Perrotin's avatar
Maxime Perrotin committed
52
                                            /* CIF PROCEDURECALL (360, 862), (106, 38) */
53
                                            CALL writeln('5');
Maxime Perrotin's avatar
Maxime Perrotin committed
54
                                            /* CIF TASK (323, 915), (179, 48) */
55
                                            TASK V5 := V6,
56
V7 := b: {'Hello', 'World'};
Maxime Perrotin's avatar
Maxime Perrotin committed
57
                                            /* CIF TASK (323, 978), (180, 35) */
58
                                            TASK V8 := b: {'Hello', 'world' };
Maxime Perrotin's avatar
Maxime Perrotin committed
59
                                            /* CIF JOIN (395, 1028), (35, 35) */
60
                                            JOIN three;
Maxime Perrotin's avatar
Maxime Perrotin committed
61
                                        /* CIF ANSWER (581, 819), (78, 28) */
62
                                        (false):
Maxime Perrotin's avatar
Maxime Perrotin committed
63
                                            /* CIF PROCEDURECALL (567, 862), (106, 38) */
64
                                            CALL writeln('6');
Maxime Perrotin's avatar
Maxime Perrotin committed
65
                                            /* CIF NEXTSTATE (585, 915), (70, 35) */
66
67
                                            NEXTSTATE wait;
                                ENDDECISION;
Maxime Perrotin's avatar
Maxime Perrotin committed
68
                            /* CIF ANSWER (962, 508), (78, 28) */
69
                            (false):
Maxime Perrotin's avatar
Maxime Perrotin committed
70
                                /* CIF DECISION (962, 551), (78, 50) */
71
                                DECISION fail;
Maxime Perrotin's avatar
Maxime Perrotin committed
72
                                        /* CIF ANSWER (855, 621), (73, 28) */
73
                                        (true):
Maxime Perrotin's avatar
Maxime Perrotin committed
74
                                            /* CIF PROCEDURECALL (742, 664), (299, 38) */
75
                                            CALL writeln('FAIL: V3 = V4 reports FALSE, but...');
Maxime Perrotin's avatar
Maxime Perrotin committed
76
                                            /* CIF PROCEDURECALL (683, 717), (417, 35) */
77
                                            CALL writeln('Length of V3(1) =', Length(V3(1)), ' and Value = ', V3(1));
Maxime Perrotin's avatar
Maxime Perrotin committed
78
                                            /* CIF PROCEDURECALL (683, 767), (417, 35) */
79
                                            CALL writeln('Length of V4(1) =', Length(V4(1)), ' and Value = ', V4(1));
Maxime Perrotin's avatar
Maxime Perrotin committed
80
                                            /* CIF NEXTSTATE (857, 817), (70, 35) */
81
                                            NEXTSTATE wait;
Maxime Perrotin's avatar
Maxime Perrotin committed
82
                                        /* CIF ANSWER (1145, 621), (78, 28) */
83
                                        (false):
Maxime Perrotin's avatar
Maxime Perrotin committed
84
                                            /* CIF PROCEDURECALL (1131, 664), (106, 38) */
85
                                            CALL writeln('3');
Maxime Perrotin's avatar
Maxime Perrotin committed
86
                                            /* CIF TASK (1113, 717), (141, 35) */
87
                                            TASK V3(1) := V4(1)(0,4);
Maxime Perrotin's avatar
Maxime Perrotin committed
88
                                            /* CIF TASK (1133, 767), (101, 35) */
89
                                            TASK fail := true;
Maxime Perrotin's avatar
Maxime Perrotin committed
90
                                            /* CIF JOIN (1166, 817), (35, 35) */
91
                                            JOIN two;
92
93
                                ENDDECISION;
                    ENDDECISION;
Maxime Perrotin's avatar
Maxime Perrotin committed
94
                /* CIF ANSWER (1331, 242), (78, 28) */
95
                (false):
Maxime Perrotin's avatar
Maxime Perrotin committed
96
                    /* CIF DECISION (1331, 285), (78, 50) */
97
                    DECISION fail;
Maxime Perrotin's avatar
Maxime Perrotin committed
98
                            /* CIF ANSWER (1289, 355), (73, 28) */
99
                            (true):
Maxime Perrotin's avatar
Maxime Perrotin committed
100
                                /* CIF PROCEDURECALL (1264, 398), (122, 38) */
101
                                CALL writeln('FAIL');
Maxime Perrotin's avatar
Maxime Perrotin committed
102
                                /* CIF NEXTSTATE (1290, 451), (70, 35) */
103
                                NEXTSTATE wait;
Maxime Perrotin's avatar
Maxime Perrotin committed
104
                            /* CIF ANSWER (1449, 355), (78, 28) */
105
                            (false):
Maxime Perrotin's avatar
Maxime Perrotin committed
106
                                /* CIF PROCEDURECALL (1435, 398), (106, 38) */
107
                                CALL writeln('1');
Maxime Perrotin's avatar
Maxime Perrotin committed
108
                                /* CIF TASK (1445, 451), (86, 35) */
109
                                TASK V2 := V1;
Maxime Perrotin's avatar
Maxime Perrotin committed
110
                                /* CIF TASK (1437, 501), (101, 35) */
111
                                TASK fail := true;
Maxime Perrotin's avatar
Maxime Perrotin committed
112
                                /* CIF JOIN (1470, 551), (35, 35) */
113
                                JOIN one;
114
115
                    ENDDECISION;
        ENDDECISION;
Maxime Perrotin's avatar
Maxime Perrotin committed
116
    /* CIF STATE (534, 53), (70, 35) */
117
118
119
    STATE wait;
    ENDSTATE;
ENDPROCESS og;