11abf12787530b4a8ec092ce7e88779e4d2eca95
[com/asn1c.git] / tests / tests-asn1c-compiler / 154-with-REAL-components-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 -- .154
7
8 ModuleREALWithComponents
9         { iso org(3) dod(6) internet(1) private(4) enterprise(1)
10                 spelio(9363) software(1) asn1c(5) test(1) 154 }
11 DEFINITIONS ::= BEGIN
12
13     UnconstrainedREAL ::= REAL
14
15     WeirdlyConstrainedREAL ::= REAL (3, ...)    -- Not really constrained
16
17     Indirect-IEEE-binary32 ::= UnconstrainedREAL (WITH COMPONENTS {
18                                     mantissa (-16777215..16777215),
19                                     base (2), exponent (-149..104)})
20
21     -- X.696 (08/2005) #12.2 and #12.3
22
23     -- IEEE 754 encoding single precision 
24     IEEE-binary32-w ::= REAL (WITH COMPONENTS { 
25                 mantissa (-16777215..16777215),
26                 base (2), exponent (-149..104)})
27
28     IEEE-binary32-0w ::= REAL (0 | WITH COMPONENTS { 
29                 mantissa (-16777215..16777215),
30                 base (2), exponent (-149..104)})
31
32     IEEE-binary32-w0 ::= REAL (WITH COMPONENTS { 
33                 mantissa (-16777215..16777215),
34                 base (2), exponent (-149..104)} | 0)
35
36     -- IEEE 754 encoding double precision 
37     IEEE-binary64-w ::= REAL (WITH COMPONENTS { 
38                 mantissa (-9007199254740991..9007199254740991),
39                 base (2), exponent (-1074..971)})
40
41     IEEE-binary64-0w ::= REAL (0 | WITH COMPONENTS { 
42                 mantissa (-9007199254740991..9007199254740991),
43                 base (2), exponent (-1074..971)})
44
45     IEEE-binary64-w0 ::= REAL (WITH COMPONENTS { 
46                 mantissa (-9007199254740991..9007199254740991),
47                 base (2), exponent (-1074..971)} | 0)
48
49     Test ::= SEQUENCE {
50         indirect-ieee-binary32 Indirect-IEEE-binary32,
51         ieee-binary32-w     IEEE-binary32-w,
52         ieee-binary32-0w    IEEE-binary32-0w,
53         ieee-binary32-w0    IEEE-binary32-w0,
54         ieee-binary64-w     IEEE-binary64-w,
55         ieee-binary64-0w    IEEE-binary64-0w,
56         ieee-binary64-w0    IEEE-binary64-w0
57     }
58
59 END