4b0df810c5caff5616d882169e4296110d779bf4
[com/asn1c.git] / tests / tests-asn1c-compiler / 14-resolver-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 -- .14 1
7 -- .14 2
8 -- .14 3
9
10 ModuleTestResolver2
11         { iso org(3) dod(6) internet(1) private(4) enterprise(1)
12                 spelio(9363) software(1) asn1c(5) test(1) 14 1 }
13         DEFINITIONS ::=
14 BEGIN
15         IMPORTS Enumeration, beta, gamma FROM
16                 OtherModuleRenamed
17                 { iso org(3) dod(6) internet(1) private(4) enterprise(1)
18                         spelio(9363) software(1) asn1c(5) test(1) 14 2 };
19
20         -- external references
21         alpha Enumeration ::= beta
22         other Enumeration ::= gamma
23         
24         Struct ::= SEQUENCE {
25                 member1 [1]     ModuleTestResolver3.Enumeration OPTIONAL,
26                 member2 [2]     OtherModuleRenamed.Enumeration DEFAULT b
27         }
28
29         -- 
30         -- The following are for post-fix checking by the check_fixer.
31         -- It will be able to pick-up these values if the file is parseable,
32         -- even if it contains some semantic errors.
33         -- 
34
35         check-alpha INTEGER ::= 2
36         check-other INTEGER ::= 1
37
38 END
39
40 ModuleTestResolver3
41         { iso org(3) dod(6) internet(1) private(4) enterprise(1)
42                 spelio(9363) software(1) asn1c(5) test(1) 14 2 }
43         DEFINITIONS ::=
44 BEGIN
45         EXPORTS Enumeration, beta, gamma;
46         IMPORTS gamma, HiddenEnum FROM HiddenModule;
47
48         beta HiddenEnum ::= b
49
50         Enumeration ::= ENUMERATED { a(1), b(2) }       -- the same type --
51
52 END
53
54 HiddenModule
55         { iso org(3) dod(6) internet(1) private(4) enterprise(1)
56                 spelio(9363) software(1) asn1c(5) test(1) 14 3 }
57         DEFINITIONS ::=
58 BEGIN
59         EXPORTS HiddenEnum, gamma;
60         IMPORTS Enumeration FROM ModuleTestResolver3;
61
62         HiddenEnum ::= ENUMERATED { a(1), b(2) }
63
64         gamma Enumeration ::= a
65
66 END