File: recordnames.txt

package info (click to toggle)
erlang 1%3A27.3.4.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 225,000 kB
  • sloc: erlang: 1,658,966; ansic: 405,769; cpp: 177,850; xml: 82,435; makefile: 15,031; sh: 14,401; lisp: 9,812; java: 8,603; asm: 6,541; perl: 5,836; python: 5,484; sed: 72
file content (51 lines) | stat: -rw-r--r-- 1,233 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
For each ASN1 types SET and SEQUENCE a record is generated in the .hrl
file with the same name as the corresponding type.
A decoded value is also returned as a record with the appropriate name.
An internally defined type as the type in component 'a' in the
following example will result in a record with name 'Seq_a':

Seq ::= SEQUENCE{
    a	SEQUENCE{
	b INTEGER
	}
}

For each further internally defined type in a SET/SEQUENCE a
'_componentname' is added.

If an internally defined type is an CHOICE alternative the record name
will get the alternative name as a unique part of the name.

Seq ::= SEQUENCE{
    a	CHOICE{
	b SEQUENCE {
	   c  INTEGER
	   }
	}
}

This will produece a record 'Seq_a_b'.

If an component is a SEQUENCE OF a SEQUENCE as in:
Seq ::= SEQUENCE {
    a SEQUENCE OF SEQUENCE {
	       b
	       }
    c SET OF SEQUENCE {
	     d
	     }
}
There will be a record 'Seq_a_SEQOF' and 'Seq_c_SETOF'

A parameterized type should be considered as an internally defined
type. Each time a such type is referenced an instance of it is
defined. Thus in the following example a record 'Seq_b' is generated
in .hrl and used in .erl by decode.

Seq ::= SEQUENCE {
    b PType{INTEGER}
}

PType{T} ::= SEQUENCE{
    id T
}