From e3db20e7a0a9855dbf45e017db2f23eb91b914bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= The following example demonstrates the basic functionality used to run
the Erlang ASN.1 compiler. First, create a file called Create a file called This file ( This file ( The The ASN.1 module People is now accepted and the abstract syntax tree
- is saved in the The ASN.1 module
-People DEFINITIONS IMPLICIT TAGS ::=
-
+People DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-EXPORTS Person;
-
-Person ::= [PRIVATE 19] SEQUENCE {
- name PrintableString,
- location INTEGER {home(0),field(1),roving(2)},
- age INTEGER OPTIONAL }
+ Person ::= SEQUENCE {
+ name PrintableString,
+ location INTEGER {home(0),field(1),roving(2)},
+ age INTEGER OPTIONAL
+ }
END
-
-1>asn1ct:compile("People", [ber]).
+1> asn1ct:compile("People", [ber]).
ok
2>
-2>asn1ct:compile("People", [ber,verbose]).
+2> asn1ct:compile("People", [ber,verbose]).
Erlang ASN.1 compiling "People.asn"
--{generated,"People.asn1db"}--
--{generated,"People.hrl"}--
@@ -173,17 +171,17 @@ Erlang ASN.1 compiling "People.asn"
ok
3>
-
-
-
+
+
or
-
Assume there is a network application which receives instances of the ASN.1 defined type Person, modifies and sends them back again:
@@ -206,8 +204,7 @@ receive constructed and encoded using