Module Structure

No

Feature

Example

Test case

OSS

CTB

Asn1c

Snacc

1

EMPTY MODULE SUPPORT

MY-MODULE DEFINITIONS ::= BEGIN
END

0001.asn1

S

S

S

S

2

Support of definite identifier in the module reference

MY-MODULE { iso standard(0) dod(6) internet (1) private(4)
  enterprise(1)semantix(1233) software(1) icdgen(5)
  test(1) 1
}
DEFINITIONS ::= BEGIN
END

0002.asn1

S

S

S

S

3

EXPLICIT TAGS support

MY-MODULE DEFINITIONS EXPLICIT TAGS ::= BEGIN
END

0003.asn1

S

S

S

S

4

IMPLICIT TAGS support

MY-MODULE DEFINITIONS IMPLICIT TAGS ::= BEGIN
END

0004.asn1

S

S

S

S

5

AUTOMATIC TAGS support

MY-MODULE DEFINITIONS AUTOMATIC TAGS ::= BEGIN
END

0005.asn1

S

S

S

F

6

Support of AUTOMATIC TAGS combined with EXTENSIBILITY IMPLIED

MY-MODULE DEFINITIONS AUTOMATIC TAGS EXTENSIBILITY IMPLIED ::= BEGIN
END

0006.asn1

S

S

S

F

7

Support of EXPLICIT TAGS combined with EXTENSIBILITY IMPLIED

MY-MODULE DEFINITIONS EXPLICIT TAGS EXTENSIBILITY IMPLIED ::= BEGIN
END

0007.asn1

S

S

S

F

8

Support of IMPLICIT TAGS combined with EXTENSIBILITY IMPLIED

MY-MODULE DEFINITIONS IMPLICIT TAGS EXTENSIBILITY IMPLIED ::= BEGIN
END

0008.asn1

S

S

S

F

9

Support of two modules in the same ASN.1 file

MY-MODULE1 DEFINITIONS IMPLICIT TAGS EXTENSIBILITY IMPLIED ::= BEGIN
END
MY-MODULE2 DEFINITIONS IMPLICIT TAGS EXTENSIBILITY IMPLIED ::= BEGIN
END

0009.asn1

S

S

S

F

10

EXPORTS ALL support

EXPORTS ALL;

0010.asn1

S

S[1]

S[2]

F

11

Ability to export specific types or variables

MY-MODULE DEFINITIONS ::= BEGIN
  EXPORTS MyInt, myIntVal;
  MyInt ::= INTEGER
  myIntVal INTEGER ::= 4
END

0011.asn1

S

S

S

S

12

Ability to import types or variables from another module

MY-MODULE DEFINITIONS ::= BEGIN
  IMPORTS MyInt, myIntVal FROM MY-MODULE2;
END

0012.asn1

S

S9

S10

S

13

ASN.1 Comments support

 

0013.asn1

S

S

S

S

14

Support of type assigments with the same name in different modules

ModuleDuplicateTypes1 DEFINITIONS ::= BEGIN
  Type ::= INTEGER
END
ModuleDuplicateTypes2 DEFINITIONS ::= BEGIN
  Type ::= INTEGER
END

0014.asn1

S

S

F

S

15

Prevention of declaring two modules with the same name

ModuleDuplicate DEFINITIONS ::= BEGIN
  Type ::= INTEGER
END
ModuleDuplicate DEFINITIONS ::= BEGIN
  Type2 ::= INTEGER
END

0015_FAIL.asn1

F[3]

S

S

S

16

Comments support

 

0016.asn1

F

F

S

S

 

Basic Types

No

Feature

Example

Test case

OSS

CTB

Asn1c

Snacc

1

BOOLEAN support

MY-MODULE DEFINITIONS ::= BEGIN
  MyBool ::= BOOLEAN
  myBoolVal BOOLEAN ::= TRUE
END

1001.asn1

S

S

S

S

2

NULL type support

MY-MODULE DEFINITIONS ::= BEGIN
  MyNull ::= NULL
  myNullVal NULL ::= NULL
END

1002.asn1

S

S

S

S

3

INTEGER type and variable support

MY-MODULE DEFINITIONS ::= BEGIN
  MyInt ::= INTEGER
  myIntVal INTEGER ::= 12
END

1003.asn1

S

S

S

S

4

Named INTEGER variables

MY-MODULE DEFINITIONS ::= BEGIN
  MyInt2 ::= INTEGER { one(1), two(2), minusone(-1) }
  myIntVal2 MyInt2 ::= one
END

1004.asn1

S

S

S

S

5

INTEGERS with a single value constraint

MY-MODULE DEFINITIONS ::= BEGIN
  MyInt3 ::= INTEGER (34)
END

1005.asn1

S

S

S

S

6

IINTEGER type with range support

MY-MODULE DEFINITIONS ::= BEGIN
  MyInt4 ::= INTEGER (3..40)
END

1006.asn1

S

S

S

S

7

ENUMERATED type support

MY-MODULE DEFINITIONS ::= BEGIN
  MyEnum ::= ENUMERATED { monday, tuesday(4)}
END

1007.asn1

S

S

S

F

8

REAL type and variable support

MY-MODULE DEFINITIONS ::= BEGIN
  MyReal ::= REAL
  myRealVal REAL ::= 3.14
END

1008.asn1

S

S

F

F

9

Support of trio mantissa, base and exponent for REALs

MY-MODULE DEFINITIONS ::= BEGIN
  pi REAL ::= { mantissa 314159, base 10, exponent -5 }
  e REAL ::= { mantissa 271828128459045,
       base 10, exponent -23 }
END

1009.asn1

S

S

S

S

10

Support of REAL type with range constraints

MY-MODULE DEFINITIONS ::= BEGIN
  MyReal ::= REAL(2.1..4.9)
END

1010.asn1

S

S

S

F

11

BIT STRING support

MY-MODULE DEFINITIONS ::= BEGIN
  MyBitString ::= BIT STRING
  myBitStrVal BIT STRING ::= '101101'B
  myBitStrVal2 BIT STRING ::= 'AFC11D'H
END

1011.asn1

S

S

S

S

12

BIT STRING support with SIZE constraint

MY-MODULE DEFINITIONS ::= BEGIN
  MyBitString ::= BIT STRING (SIZE(5))
END

1012.asn1

S

S

S

S

13

BIT STRING support with SIZE range constraint

MY-MODULE DEFINITIONS ::= BEGIN
  MyBitString ::= BIT STRING (SIZE(5..15))
END

1013.asn1

S

S

S

S

14

Syntax support for the BIT STRING type to declare special positions of bits

MY-MODULE DEFINITIONS ::= BEGIN
  MyBitString ::= BIT STRING { alpha(1), beta(2)}
END

1014.asn1

S

S

S

S

15

EMBEDDED PDV type support

MY-MODULE DEFINITIONS ::= BEGIN
  MyVar ::= EMBEDDED PDV
END

1015.asn1

S

S

S

F

16

EXTERNAL support

MY-MODULE DEFINITIONS ::= BEGIN
  MyExt ::= EXTERNAL
END

1016.asn1

S

S

S

S

17

OBJECT IDENTIFIER support

MY-MODULE DEFINITIONS ::= BEGIN
  internet-id OBJECT IDENTIFIER ::={ iso(1) identified-organization(3) dod(6) internet(1) }
  francetelecom-id OBJECT IDENTIFIER ::={ iso member-body f(250) type-org(1) ft(16) }
  ber-id OBJECT IDENTIFIER ::= { 2 1 1 }
END

1017.asn1

S

S

S

S

18

OBJECT IDENTIFIER support

MY-MODULE DEFINITIONS ::= BEGIN
  ID ::= OBJECT IDENTIFIER id-edims ID ::= { joint-iso-itu-t mhs-motif(6) edims(7) }
  id-bp ID ::= { id-edims 11 }
  id-bp-edifact-ISO646 ID ::= { id-bp 1 }
  id-bp-edifact-T61 ID ::= { id-bp two(2) }
  id-bp-edifact-octet ID ::= { id-bp three(3) }
  id-bp-ansiX12-ISO646 ID ::= { id-bp 4 }
  id-bp-ansiX12-T61 ID ::= { id-bp 5 }
  id-bp-ansiX12-ebcdic ID ::= { id-bp 6 }
END

1018.asn1

S

S

S

S

19

Date and time support

MY-MODULE DEFINITIONS ::= BEGIN
-- local hour:
  Now ::= GeneralizedTime
  now Now ::= "19980528142905.1"
  now2 Now ::= "19980528142905,1"
-- UTC hour:
  Utc ::=[101] GeneralizedTime
  utc-time Utc ::= "1998052814Z"
  utc-time2 Utc ::= "199805281429Z"
-- ahead of UTC:
  ahead-time Utc ::= "199805281629+0200"
END

1019.asn1

S

S

S

F

20

Tagging support

MY-MODULE DEFINITIONS ::= BEGIN
-- Tagging
  MyType ::= [1] INTEGER
END

1020.asn1

S

S

S

F

21

Tagging support

MY-MODULE DEFINITIONS ::= BEGIN
  MyType ::= [APPLICATION 1] INTEGER
END

1021.asn1

S

S

S

S

22

Tagging support

MY-MODULE DEFINITIONS ::= BEGIN
  MyType ::= [PRIVATE 1] INTEGER
END

1022.asn1

S

S

S

S

23

Tagging support

MY-MODULE DEFINITIONS ::= BEGIN
  MyType ::= [APPLICATION 100] IMPLICIT INTEGER
END

1023.asn1

S

S

S

S

24

Tagging support

MY-MODULE DEFINITIONS ::= BEGIN
  MyType ::= [APPLICATION 100] EXPLICIT INTEGER
END

1024.asn1

S

S

S

S

25

ENUMEATED type with extensions support

MY-MODULE DEFINITIONS ::= BEGIN
  MyEnum ::= ENUMERATED   {
    monday, tuesday(4),
    ...
  }
END

1025.asn1

S

S

S

F

26

Enumerated type with extensions and exceptions support

MY-MODULE DEFINITIONS ::= BEGIN
  MyEnum ::= ENUMERATED   {
    monday, tuesday(4),
    ...
    !5
  }
END

1026.asn1

S

S

F

F

27

Enumerated type with extensions, exceptions and additional values support

MY-MODULE DEFINITIONS ::= BEGIN
  MyEnum ::= ENUMERATED   {
    monday, tuesday(4),
    ...
    !5,
    wed(7)
  }
END

1027.asn1

S

S

F

F

28

ANY support

MY-MODULE DEFINITIONS ::= BEGIN
  T ::= SEQUENCE {
    i1  INTEGER ,
    any  ANY
  }
END

1028.asn1

S

S

S

S

29

ANY should not be allowed because i1 is OPTIONAL

MY-MODULE DEFINITIONS ::= BEGIN
  T ::= SEQUENCE {
    i1  INTEGER OPTIONAL,
    any  ANY
  }
END

1029_FAIL.asn1

S

S

S

S

30

Semantic Error: blue collides with green

MY-MODULE DEFINITIONS ::= BEGIN
  Enum1 ::= ENUMERATED { red, green, ...,
    blue(1) }
END

1030_FAIL.asn1

S

S

S

S

31

Semantic Error: Enumeration with non ascending order in extended values

MY-MODULE DEFINITIONS ::= BEGIN
-- The values for all enumerations which follow an ellipsis (...)
-- must be in ascending order, but the value of 'blue(6)' is less than '7',
-- the value of the preceding AdditionalEnumeration.
  Enum1 ::= ENUMERATED { red(5), ..., green(7), blue(6) }
END

1031_FAIL.asn1

S

S

S

S

32

Semantix Error: Enumerated with the same value

MY-MODULE DEFINITIONS ::= BEGIN
  Enum1 ::= ENUMERATED { red(5), blue(5) }
END

1032_FAIL.asn1

S

S

F

S

33

Semantic Error:identifiers must be distinct

MY-MODULE DEFINITIONS ::= BEGIN
  Int ::= INTEGER {
      value1(0),
      value1(2)  
    }
END

1033_FAIL.asn1

S

S

S

S

34

Semantic Error: values must be distinct

MY-MODULE DEFINITIONS ::= BEGIN
  Int ::= INTEGER {
      value1(0),
      value2(2),  
      value3(2)  
    }
END

1034_FAIL.asn1

S

S

S

S

35

Semantix Error: Infinite recursion

MY-MODULE DEFINITIONS ::= BEGIN
  alpha INTEGER ::= beta
  beta INTEGER ::= alpha
END

1035_FAIL.asn1

S

F[4]

S

S

36

Semantic Error: beta value is not defined anywhere

MY-MODULE DEFINITIONS ::= BEGIN
  alpha INTEGER ::= beta
END

1036_FAIL.asn1

S

S

S

S

 

Sequences

No

Feature

Example

Test case

OSS

CTB

Asn1c

Snacc

1

Empty SEQUENCE support

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq ::= SEQUENCE {
    }
END

2001.asn1

S

S

S

S

2

SEQUENCE support

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq ::= SEQUENCE {
      a1  INTEGER ,
      s1  OCTET STRING
    }
END

2002.asn1

S

S

S

S

3

OPTIONAL support

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq ::= SEQUENCE {
      a1  INTEGER OPTIONAL,
      s1  OCTET STRING
    }
END

2003.asn1

S

S

S

S

4

DEFAULT value support

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq ::= SEQUENCE {
      a1  INTEGER DEFAULT 5,
      s1  OCTET STRING
    }
END

2004.asn1

S

S

S

S

5

Extension marking support

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq ::= SEQUENCE {
      a1  INTEGER ,
      s1  OCTET STRING,
      ...
    }
END

2005.asn1

S

S

S

S

6

Exceptions support

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq ::= SEQUENCE {
      a1  INTEGER ,
      s1  OCTET STRING,
      ... !5
    }
END

2006.asn1

S

S

S

F

7

exceptions support

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SEQUENCE {
      a1  INTEGER ,
      s1  OCTET STRING,
      ... !myvalue
    }
END

2007.asn1

S

S

S

F

8

Exceptions support

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SEQUENCE {
      a1  INTEGER ,
      s1  OCTET STRING,
      ... ! OCTET STRING : '10FF'H
    }
END

2008.asn1

S

S

F

F

9

Extensions support

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SEQUENCE {
      a1  INTEGER ,
      s1  OCTET STRING,
      ... ! OCTET STRING : '10FF'H ,
      a2  INTEGER ,
      s2  OCTET STRING
    }
END

2009.asn1

S

S

F

F

10

Extensions support

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SEQUENCE {
      a1  INTEGER ,
      s1  OCTET STRING,
      ...,
      a2  INTEGER ,
      s2  OCTET STRING
    }
END

2010.asn1

S

S

S

S

11

Extensions support with version groups

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SEQUENCE {
      a1  INTEGER ,
      s1  OCTET STRING,
      ... ! OCTET STRING : '10FF'H ,
      [[2: a3  INTEGER ,
        s3  OCTET STRING ]]
    }
END

2011.asn1

S

S

F

F

12

Extensions support with version groups

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SEQUENCE {
      a1  INTEGER ,
      s1  OCTET STRING,
      ... ! OCTET STRING : '10FF'H ,
      [[2: a3  INTEGER ,
        s3  OCTET STRING ]],
      ...
    }
END

2012.asn1

S

S

F

F

13

Extensions support

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SEQUENCE {
      a1  INTEGER ,
      s1  OCTET STRING,
      ... ! OCTET STRING : '10FF'H ,
      [[2: a3 [100]  INTEGER ,
        s3  [101] OCTET STRING ]],
      ... ,
      a4  [102] INTEGER ,
      s4  [103] OCTET STRING
    }
END

2013.asn1

S

S

F

F

14

Extensions support

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SEQUENCE {
      ... ! OCTET STRING : '10FF'H ,
      [[2: a3 [100]  INTEGER ,
        s3  [101] OCTET STRING ]],
      ... ,
      a4  [102] INTEGER ,
      s4  [103] OCTET STRING
    }
END

2014.asn1

S

S

F

F

15

Nested SEQUENCES

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SEQUENCE {
      a4  INTEGER ,
      s4  OCTET STRING,
      myNestedSeq1 SEQUENCE {
          a4  INTEGER ,
          s4  OCTET STRING,
          myNestedSeq1 SEQUENCE {
              a4  INTEGER ,
              s4  OCTET STRING,
              myNestedSeq1 SEQUENCE {
                  a4  INTEGER ,
                  s4  OCTET STRING
                }
            }
        }
    }
END

2015.asn1

S

S

S

S

16

Value support for SEQUENCE types

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq ::= SEQUENCE {
      a1  INTEGER ,
      s1  OCTET STRING
    }
  mySeqValue MySeq ::= {
    a1 10,
    s1 'A10F'H
  }
END

2016.asn1

S

S

S

S

17

Value support for SEQUENCEs with xml notation

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq ::= SEQUENCE {
      a1  INTEGER ,
      s1  OCTET STRING
    }
  xmlValAssigment ::= <MySeq>
              <a1>1</a1>
              <s1>0A3D</s1>
            </MySeq>
END

2017.asn1

S

F

F

F

18

COMPONENTS OF support

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq1 ::= SEQUENCE {
      a1  INTEGER ,
      s1  OCTET STRING
    }
  MySeq2 ::= SEQUENCE {
      COMPONENTS OF MySeq1,
      r REAL
    }
END

2018.asn1

S

S

S

S

19

COMPONENTS OF support

MY-MODULE DEFINITIONS ::= BEGIN
  OneType ::= SEQUENCE {
    one-1   INTEGER,
    one-2  [1] BOOLEAN,
    one-3 SEQUENCE {
      alpha  INTEGER,
      beta  INTEGER,
      ...
    },
    ...,
    ignored-in-SecondType  [2] INTEGER,
    ...,
    one-4  INTEGER
  }
  SecondType ::= SEQUENCE {
    a  IA5String,
    COMPONENTS OF OneType,
    b  UniversalString
  }
END

2019.asn1

S

S

S

F

20

Semantix Error: COMPONENTS OF should point to a non built in type

MY-MODULE DEFINITIONS ::= BEGIN
  OneType ::= SEQUENCE {
    a  IA5String,
    COMPONENTS OF INTEGER,  -- Error is here
    b  UniversalString
  }
END

2020_FAIL.asn1

S

S

S

S

21

DEFAULT value supportfor nested sequences

Module1  DEFINITIONS ::=
BEGIN
  Type ::= SEQUENCE {
    other  SEQUENCE {
      member-1 INTEGER,
      member-2 NumericString
    } DEFAULT { member-1 5, member-2 "123"}
  }
END

2021.asn1

S

S

S

S

 

SETs

No

Feature

Example

Test case

OSS

CTB

Asn1c

Snacc

1

Empty SET support

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq ::= SET {
    }
END

3001.asn1

S

S

S

S

2

SET support

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq ::= SET {
      a1  INTEGER ,
      s1  OCTET STRING
    }
END

3002.asn1

S

S

S

S

3

OPTIONAL support

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq ::= SET {
      a1  INTEGER OPTIONAL,
      s1  OCTET STRING
    }
END

3003.asn1

S

S

S

S

4

DEFAULT value support

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq ::= SET {
      a1  INTEGER DEFAULT 5,
      s1  OCTET STRING
    }
END

3004.asn1

S

S

S

S

5

Exensions support

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq ::= SET {
      a1  INTEGER ,
      s1  OCTET STRING,
      ...
    }
END

3005.asn1

S

S

S

S

6

Exensions support with exception

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq ::= SET {
      a1  INTEGER ,
      s1  OCTET STRING,
      ... !5
    }
END

3006.asn1

S

S

S

F

7

Exensions support with exception

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SET {
      a1  INTEGER ,
      s1  OCTET STRING,
      ... !myvalue
    }
END

3007.asn1

S

S

S

F

8

Exensions support with exception

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SET {
      a1  INTEGER ,
      s1  OCTET STRING,
      ... ! OCTET STRING : '10FF'H
    }
END

3008.asn1

S

S

F

F

9

Exensions support

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SET {
      a1 [100] INTEGER ,
      s1 [101] OCTET STRING,
      ... ! OCTET STRING : '10FF'H ,
      a2 [102] INTEGER ,
      s2 [103] OCTET STRING
    }
END

3009.asn1

S

S

F

F

10

Exensions support

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SET {
      a1  [100] INTEGER ,
      s1  [101] OCTET STRING,
      ...,
      a2  [102] INTEGER ,
      s2  [103] OCTET STRING
    }
END

3010.asn1

S

S

S

S

11

Exensions support with version grouping

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SET {
      a1  INTEGER ,
      s1  OCTET STRING,
      ... ! OCTET STRING : '10FF'H ,
      [[2: a3  [100] INTEGER ,
        s3  [101] OCTET STRING ]]
    }
END

3011.asn1

S

S

F

F

12

Exensions support with version grouping

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SET {
      a1  INTEGER ,
      s1  OCTET STRING,
      ... ! OCTET STRING : '10FF'H ,
      [[2: a3  [100] INTEGER ,
        s3  [101] OCTET STRING ]],
      ...
    }
END

3012.asn1

S

S

F

F

13

Exensions support

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SET {
      a1  INTEGER ,
      s1  OCTET STRING,
      ... ! OCTET STRING : '10FF'H ,
      [[2: a3 [100]  INTEGER ,
        s3  [101] OCTET STRING ]],
      ... ,
      a4  [102] INTEGER ,
      s4  [103] OCTET STRING
    }
END

3013.asn1

S

S

F

F

14

Exensions support

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SET {
      ... ! OCTET STRING : '10FF'H ,
      [[2: a3 [100]  INTEGER ,
        s3  [101] OCTET STRING ]],
      ... ,
      a4  [102] INTEGER ,
      s4  [103] OCTET STRING
    }
END

3014.asn1

S

S

F

F

15

Nested SETS

MY-MODULE DEFINITIONS ::= BEGIN
  myvalue INTEGER ::= 10
  MySeq ::= SET {
      a4  INTEGER ,
      s4  OCTET STRING,
      myNestedSeq1 SET {
          a4  INTEGER ,
          s4  OCTET STRING,
          myNestedSeq1 SET {
              a4  INTEGER ,
              s4  OCTET STRING,
              myNestedSeq1 SET {
                  a4  INTEGER ,
                  s4  OCTET STRING
                }
            }
        }
    }
END

3015.asn1

S

S

S

S

16

Variables support for SETs

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq ::= SET {
      a1  INTEGER ,
      s1  OCTET STRING
    }
  mySeqValue MySeq ::= {
    a1 10,
    s1 'A10F'H
  }
END

3016.asn1

S

S

S

S

17

Xml syntax support

MY-MODULE DEFINITIONS ::= BEGIN
  MySeq ::= SET {
      a1  INTEGER ,
      s1  OCTET STRING
    }
  xmlValAssigment ::= <MySeq>
              <a1>1</a1>
              <s1>0A3D</s1>
            </MySeq>
END

3017.asn1

S

F

F

F

 

Character strings

No

Feature

Example

Test case

OSS

CTB

Asn1c

Snacc

1

BMPString support

MY-MODULE DEFINITIONS ::= BEGIN
  MyVr ::= BMPString
  MyVr2 ::= [100] BMPString (SIZE(5))
  MyVr3 ::= [101] BMPString (SIZE(5..10))
  MyVr4 ::= [102] BMPString (FROM("A".."Z"))
END

4001.asn1

S

S

S

S

2

GeneralString string support

MY-MODULE DEFINITIONS ::= BEGIN
  MyVr ::= GeneralString
END

4002.asn1

S

S

S

S

3

GraphicString string support

MY-MODULE DEFINITIONS ::= BEGIN
  MyVr ::= GraphicString
END

4003.asn1

S

S

S

S

4

IA5String string support

MY-MODULE DEFINITIONS ::= BEGIN
  MyVr ::= IA5String
END

4004.asn1

S

S

S

S

5

ISO646String string support

MY-MODULE DEFINITIONS ::= BEGIN
  MyVr ::= ISO646String
END

4005.asn1

S

S

F[5]

S

6

NumericString string support

MY-MODULE DEFINITIONS ::= BEGIN
  MyVr ::= NumericString
END

4006.asn1

S

S

S

S

7

PrintableString string support

MY-MODULE DEFINITIONS ::= BEGIN
  MyVr ::= PrintableString
END

4007.asn1

S

S

S

S

8

TeletexString string support

MY-MODULE DEFINITIONS ::= BEGIN
  MyVr ::= TeletexString
END

4008.asn1

S

S

S

S

9

T61String string support

MY-MODULE DEFINITIONS ::= BEGIN
  MyVr ::= T61String
END

4009.asn1

S

S

S

S

10

UniversalString string support

MY-MODULE DEFINITIONS ::= BEGIN
  MyVr ::= UniversalString
END

4010.asn1

S

S

S

S

11

UTF8String string support

MY-MODULE DEFINITIONS ::= BEGIN
  MyVr ::= UTF8String
END

4011.asn1

S

S

S

S

12

VideotexString string support

MY-MODULE DEFINITIONS ::= BEGIN
  MyVr ::= VideotexString
END

4012.asn1

S

S

S

S

13

VisibleString string support

MY-MODULE DEFINITIONS ::= BEGIN
  MyVr ::= VisibleString
END

4013.asn1

S

S

S

S

14

CHARACTER STRING support

MY-MODULE DEFINITIONS ::= BEGIN
  MyVr ::= CHARACTER STRING
END

4014.asn1

S

S

S

F

 

Sequence Of

No

Feature

Example

Test case

OSS

CTB

Asn1c

Snacc

1

SEQUENCE OF support

MY-MODULE DEFINITIONS ::= BEGIN
  MyVar ::= SEQUENCE OF INTEGER
END

5001.asn1

S

S

S

S

2

Variables support for SEQUENCE OF

MY-MODULE DEFINITIONS ::= BEGIN
  MyVar ::= SEQUENCE OF INTEGER
  myvar MyVar ::= {1,1,4,5}
END

5002.asn1

S

S

S

S

3

SEQUENCE OF support with size constraint

MY-MODULE DEFINITIONS ::= BEGIN
  MyVar ::= SEQUENCE SIZE(4) OF INTEGER
  myvar MyVar ::= {1,1,4,5}
END

5003.asn1

S

S

S

S

4

SEQUENCE OF support with size range constraint

MY-MODULE DEFINITIONS ::= BEGIN
  MyVar ::= SEQUENCE SIZE(4..10) OF INTEGER
  myvar MyVar ::= {1,1,4,5,5,6,6}
END

5004.asn1

S

S

S

S

5

SEQUENCE OF support with name elements

MY-MODULE DEFINITIONS ::= BEGIN
  MyVar ::= SEQUENCE SIZE(4..10) OF xmlTag INTEGER
END

5005.asn1

S

S

S

F

 

Choices

No

Feature

Example

Test case

OSS

CTB

Asn1c

Snacc

1

CHOICE support

MY-MODULE DEFINITIONS ::= BEGIN
  MyType ::= CHOICE {
      a1 [10] INTEGER,
      a2 [11] INTEGER
    }
END

6001.asn1

S

S

S

S

2

CHOICE support with just one alternative

MY-MODULE DEFINITIONS ::= BEGIN
  MyType ::= CHOICE {
      a1 [10] INTEGER
    }
END

6002.asn1

S

S

S

S

3

Variables support for CHOICEs

MY-MODULE DEFINITIONS ::= BEGIN
  MyType ::= CHOICE {
      a1 [10] INTEGER,
      a2 [11] INTEGER
    }
  myVar MyType ::= a1:10
END

6003.asn1

S

S

S

F

4

Extensions support

MY-MODULE DEFINITIONS ::= BEGIN
  MyType ::= CHOICE {
      a1 [10] INTEGER,
      a2 [11] INTEGER,
      ...
    }
END

6004.asn1

S

S

S

S

5

Extensions support with exceptions

MY-MODULE DEFINITIONS ::= BEGIN
  MyType ::= CHOICE {
      a1 [10] INTEGER,
      a2 [11] INTEGER,
      ...
      !5
    }
END

6005.asn1

S

S

S

F

6

Extensions support with exceptions and version grouping

MY-MODULE DEFINITIONS ::= BEGIN
  MyType ::= CHOICE {
      a1 [10] INTEGER,
      a2 [11] INTEGER,
      ...
      !INTEGER:100,
      [[ 2: a3 [12] INTEGER,
       a4 [13] INTEGER]],
      [[ 3: a5 [14]INTEGER,
       a6 [15] INTEGER]]
    }
END

6006.asn1

S

S

F

F

7

Extensions support with exceptions and version grouping

MY-MODULE DEFINITIONS ::= BEGIN
  MyType ::= CHOICE {
      a1 [10] INTEGER,
      a2 [11] INTEGER,
      ...
      !INTEGER:100,
      [[ 2: a3 [12] INTEGER,
       a4 [13] INTEGER]],
      [[ 3: a5 [14]INTEGER,
       a6 [15] INTEGER]],
      ...
    }
END

6007.asn1

S

S

F

F

8

Selection a single alternative from a CHOICE type

MY-MODULE DEFINITIONS ::= BEGIN
  Element ::= CHOICE {
    atomic-no INTEGER (1..103),
    symbol PrintableString
  }
  MendeleievTable ::= SEQUENCE SIZE (103) OF symbol < Element
END

6008.asn1

S

S

F

S

9

Semantic Error:Fail due of tags

MY-MODULE DEFINITIONS ::= BEGIN
  T1 ::= CHOICE {
    t-a INTEGER,
    t-b OCTET STRING,
    t-c Choice1
  }
  Choice1 ::= [100] CHOICE {      -- One more level
    c-a OCTET STRING,
    c-b INTEGER
  }
END

6009_FAIL.asn1

S

S

S

S

 

Constraints

No

Feature

Example

Test case

OSS

CTB

Asn1c

Snacc

1

MAX support

MyMod  DEFINITIONS ::=
BEGIN
  Int1 ::= INTEGER (0..MAX)
END

7001.asn1

S

S

S

S

2

MIN support

MyMod  DEFINITIONS ::=
BEGIN
  Int3 ::= INTEGER (MIN..ten)  -- Means (0..10)
  ten INTEGER ::= other-ten
  other-ten INTEGER ::= 10
END

7002.asn1

S

S

S

S

3

Constraint with extensions

MyMod  DEFINITIONS ::=
BEGIN
  Int ::= INTEGER (5..MAX,...,1..4)  
END

7003.asn1

S

S

S

F

4

Constraint with extensions and exception

MyMod  DEFINITIONS ::=
BEGIN
  Int ::= INTEGER (5..MAX,...,1..4 !100)  
END

7004.asn1

S

S

S

F

5

Range exception support

MyMod  DEFINITIONS ::=
BEGIN
  Int ::= INTEGER (MIN..5)  
END

7005.asn1

S

S

S

S

6

Subtype constraint support

MyMod  DEFINITIONS ::=
BEGIN
  Int ::= INTEGER (MIN..5)  
  Int2 ::= INTEGER (Int)
END

7006.asn1

S

S

S

F

7

Syntax Error

MyMod  DEFINITIONS ::=
BEGIN
  Int ::= INTEGER ((1..26,...) INTERSECTION (100..256))
END

7007_FAIL.asn1

S

S

F

F

8

INTERSECTION support

MyMod  DEFINITIONS ::=
BEGIN
  Str1 ::= IA5String
  Str2 ::= Str1 (SIZE(MIN..20 | 25..30))  
          -- Means (SIZE(0..20 | 25..30))
END

7008.asn1

S

S

S

S

9

Permitted alphabet support

MyMod  DEFINITIONS ::=
BEGIN
  Str ::= IA5String(SIZE(10..27))(FROM("ABC"|"def"))
          -- (SIZE(10..20,25..27))(FROM("ABCdef"))
END

7009.asn1

S

S

S

S

10

Permitted alphabet and size constraint

MyMod  DEFINITIONS ::=
BEGIN
  Str ::= IA5String("ABCD"|SIZE(4))
END

7010.asn1

S

S

S

S

11

Permitted alphabet (range)

MyMod  DEFINITIONS ::=
BEGIN
  Str ::= IA5String (FROM("A".."F"))
END

7011.asn1

S

S

S

S

12

Permitted alphabet with range and size constraint

MyMod  DEFINITIONS ::=
BEGIN
  Str ::= IA5String (FROM("AB") | SIZE(1..2))
END

7012.asn1

S

S

S

S

13

Permitted alphabet with extensions

MyMod  DEFINITIONS ::=
BEGIN
  Str ::= IA5String (FROM("AB",...))
END

7013.asn1

S

S

S

F

14

Permitted alphabet with extensions

MyMod  DEFINITIONS ::=
BEGIN
  Str ::= IA5String (FROM("AB"),...)
END

7014.asn1

S

S

S

F

15

Permitted alphabet with extensions and size constraint

MyMod  DEFINITIONS ::=
BEGIN
  Str ::= IA5String (SIZE(1..4) ^ FROM("ABCD",...))
END

7015.asn1

S

S

S

F

16

Permitted alphabet with extensions and size constraint

MyMod  DEFINITIONS ::=
BEGIN
  Str ::= IA5String (SIZE(1..4) | FROM("ABCD",...))
END

7016.asn1

S

S

S

F

17

Permitted alphabet on UTF8String

MyMod  DEFINITIONS ::=
BEGIN
  Str ::= UTF8String (FROM("A".."Z"))  
END

7017.asn1

S

S

S

S

18

Permitted alphabet

MyMod  DEFINITIONS ::=
BEGIN
  Str ::= UTF8String (FROM("A".."Z"))  
  Str1 ::= Str (FROM("A".."Z"|"a".."z"))
END

7018.asn1

S

F

S[6]

S

19

Permitted alphabet and subtype constraint

MyMod  DEFINITIONS ::=
BEGIN
  Str ::= UTF8String (FROM("A".."Z"))  
  Str2 ::= Str (SIZE(1..2))
END

7019.asn1

S

S

S

S

20

Constraint on enumerated types

MyMod  DEFINITIONS ::=
BEGIN
  Enum0  ::= [1] ENUMERATED { one, two }
  Enum1  ::= [2] ENUMERATED { one, two }  (one)
END

7020.asn1

S

S

S

F

21

SIZE constraint in SEQUENCES OF

MyMod  DEFINITIONS ::=
BEGIN
  SequenceOf ::= SEQUENCE (SIZE(1..2)) OF INTEGER
END

7021.asn1

S

S

S

F

22

Semantic Error: Permitted alphabet constraint in an INTEGER type

MyMod  DEFINITIONS ::=
BEGIN
  Int ::= INTEGER (FROM("abc"))
END

7022_FAIL.asn1

S

S

S

F

23

Semantic Error: SIZE constraint in integer type

MyMod  DEFINITIONS ::=
BEGIN
  Int ::= INTEGER (SIZE(0..4))
END

7023_FAIL.asn1

S

S

S

F

24

This is valid combination although the intersection of these two sets is NULL

MyMod  DEFINITIONS ::=
BEGIN
  Int ::= INTEGER (1..32) (MIN..63)
END

7024.asn1

S

F[7]

S

S

25

Semantic Error: # does not belong to NumericString

MyMod  DEFINITIONS ::=
BEGIN
  StrBad ::= NumericString (FROM("0".."9" | "#"))  
END

7025_FAIL.asn1

S

F

S

F

26

WITH COMPONENTS support

MyMod  DEFINITIONS ::=
BEGIN
  Quadruple ::= SEQUENCE {
    alpha ENUMERATED {state1, state2, state3},
    beta IA5String OPTIONAL,
    gamma SEQUENCE OF INTEGER,
    delta BOOLEAN DEFAULT TRUE
  }
  Quadruple1 ::= Quadruple (WITH COMPONENTS { ...,
    alpha (state1),
    gamma (SIZE (5)) }
  )
/*
copied by Dubuisson book
This type is strictly equivalent to:
  Quadruple1 ::= SEQUENCE {
    alpha ENUMERATED {state1, state2, state3} (state1),
    beta IA5String OPTIONAL,
    gamma SEQUENCE SIZE (5) OF INTEGER,
    delta BOOLEAN DEFAULT TRUE
    }
The symbol "..." means that we constrain some of the components
of the SEQUENCE (or SET) type and do not change those which do not
explicitly appear in the constraint. The symbol "..." should not be
confused with the extension marker already presented in Section 12.9
on page 244 that we will discuss on page 291 when describing extensible
constraints. A constraint WITH COMPONENTS may apply to an extensible
(or extended) type as well.
For the SEQUENCE type, the components should be in the same order
as in the type. For the SET type, the order may not be respected.
*/
END

7026.asn1

S

S

S

F

27

WITH COMPONENTS support

MyMod  DEFINITIONS ::=
BEGIN
  Quadruple ::= SEQUENCE {
    alpha ENUMERATED {state1, state2, state3},
    beta IA5String OPTIONAL,
    gamma SEQUENCE OF INTEGER,
    delta BOOLEAN DEFAULT TRUE
  }
  Quadruple1 ::= Quadruple (WITH COMPONENTS {
    alpha ,
    gamma }
  )
END

7027.asn1

S

S

S

F

28

WITH COMPONENTS support

MyMod  DEFINITIONS ::=
BEGIN
  Choice ::= CHOICE {
    a [1] INTEGER,
    b [2] INTEGER,
    c [3] INTEGER,
    d [4] INTEGER
  }
  Choice2 ::= Choice (
    WITH COMPONENTS { a ABSENT, b ABSENT}
  )
END

7028.asn1

S

S

S

S

29

WITH COMPONENT support

MyMod  DEFINITIONS ::=
BEGIN
  TextBlock ::= [1] SEQUENCE OF VisibleString
  AddressBlock ::= [2] TextBlock (WITH COMPONENT (SIZE (1..32)))
END

7029.asn1

S

S

S

S

30

WITH COMPONENT support

MyMod  DEFINITIONS ::=
BEGIN
  TextBlock ::= [1] SEQUENCE OF VisibleString
  DigitBlock ::= [2] TextBlock (WITH COMPONENT (NumericString))  
END

7030.asn1

S

S

F

F

 



[1]     CTB tool produced an error in this test case. However, it clear that the error was due to the inability of the compiler to parse the specific ASN.1 file; the compiler produced this error in order to warn the user that no symbols are exported/imported.

[2]     Same as CTB

[3]     OOS reported the error of the specific test case as a warning and not as an error

[4]     Compiler Crash !

[5]     Core dump!

[6]     Asn1c report this TC as error. OSS reported a warning. CTB reported nothing.

[7]     CTB tool failed to give an indication that the new defined type (Int) is not allowed to have any value. OSS produced a warning message while asn1c produced an error message.