e57312de49ff27150611cb0abce53f4db5558ea9
[com/asn1c.git] / tests / tests-asn1c-compiler / 92-circular-loops-OK.asn1
1
2 -- OK: Everything is fine
3
4 -- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
5 -- .spelio.software.asn1c.test (9363.1.5.1)
6 -- .92
7
8 ModuleCircularReferences
9         { iso org(3) dod(6) internet (1) private(4) enterprise(1)
10                 spelio(9363) software(1) asn1c(5) test(1) 92 }
11 DEFINITIONS AUTOMATIC TAGS ::=
12 BEGIN
13
14         Everything ::= SEQUENCE {
15                 ch1     Choice1,
16                 ch2     Choice2,
17                 ch3     Choice3,
18                 set     Set,
19                 a       Alpha,
20                 b       Beta,
21                 g       Gamma,
22                 ot      OneTwo,
23                 tt      TwoThree,
24                 to      ThreeOne
25         }
26
27         -- This type refers to the type directly containing itself.
28         Choice1 ::= CHOICE {
29                 something Everything,
30                 ...,
31                 some2   Everything
32         }
33
34         Choice2 ::= CHOICE {
35                 typeref TypeRef,
36                 ...,
37                 some3   Everything
38         }
39
40         Choice3 ::= CHOICE {
41                         a SEQUENCE {
42                                 aa Everything
43                         },
44                         b  Everything,
45                         c SEQUENCE OF Choice3
46                 }
47
48         Set ::= SET OF SEQUENCE {
49                         int     INTEGER,
50                         set     Set,
51                         seq     Sequence,
52                         set2    Set OPTIONAL,
53                         ...,
54                         set3    Set
55                 }
56
57         Sequence ::= SEQUENCE {
58                         a       INTEGER,
59                         seq     Sequence OPTIONAL,
60                         ...,
61                         b       INTEGER,
62                         set     Set OPTIONAL
63                 }
64
65         TypeRef ::= Sequence
66
67         Alpha ::= SEQUENCE {
68                         a Beta,
69                         b SEQUENCE {
70                                 b Beta OPTIONAL
71                         }
72                 }
73
74         Beta ::= SEQUENCE {
75                         b Alpha OPTIONAL,
76                         g Gamma OPTIONAL
77                 }
78
79         Gamma ::= SEQUENCE {
80                         o TwoThree,
81                         a Alpha,        -- expected inline
82                         b Beta          -- expected inline
83                 }
84
85         -- This is a true superdependency.
86         OneTwo ::= SET { m12 TwoThree }
87         TwoThree ::= SET { m23 ThreeOne }
88         ThreeOne ::= SET { m31 OneTwo, g Gamma }
89
90 END