blob: e725b89f892a160f58d82c3e4b64e452d742c366 [file] [log] [blame]
vlmfa67ddc2004-06-03 03:38:44 +00001WHAT TO READ?
2=============
3
4For quick installation tips read INSTALL.
5
6For more complete documentation on this compiler and on using the
7results of compilation please look into ./doc directory.
8
vlmd79b30d2004-09-05 10:41:23 +00009Please also read the FAQ file.
10
vlmfa67ddc2004-06-03 03:38:44 +000011An excellent book on ASN.1 is written by Olivier Dubuisson:
12"ASN.1 Communication between heterogeneous systems", ISBN:0-12-6333361-0.
13
vlmfa67ddc2004-06-03 03:38:44 +000014QUICK START
15===========
16
17After building [and installing] the compiler (see INSTALL), you may use
18the asn1c command to compile the ASN.1 specification:
19
vlmd79b30d2004-09-05 10:41:23 +000020 asn1c <module.asn1>
vlmfa67ddc2004-06-03 03:38:44 +000021
22If several specifications contain interdependencies, all of them must be
23specified:
24
vlmd79b30d2004-09-05 10:41:23 +000025 asn1c <module1.asn1> <module2.asn1> ...
vlmfa67ddc2004-06-03 03:38:44 +000026
27The ./examples directory contains several ASN.1 modules and a script to
28extract ASN.1 modules from RFC documents. To compile X.509 PKI module:
29
30 ./asn1c/asn1c -P ./examples/*PKIX*93*.asn1
31
32In this example, -P option is used to instruct the compiler to print the
33compiled text on the standard output instead of creating multiple .c
vlmd79b30d2004-09-05 10:41:23 +000034and .h files for every ASN.1 type found inside the specified ASN.1 modules.
35This is useful for debugging and test automation.
vlmfa67ddc2004-06-03 03:38:44 +000036
37The compiler -E and -EF options are used for testing the parser and
38the semantic fixer, respectively. These options will instruct the compiler
39to dump out the parsed (and fixed) ASN.1 specification as it was
40"understood" by the compiler. It might be useful for checking
41whether a particular syntactic construction is properly supported
42by the compiler.
43
vlmd79b30d2004-09-05 10:41:23 +000044 asn1c -EF <module-to-test.asn1>
vlmfa67ddc2004-06-03 03:38:44 +000045
46
47MODEL OF OPERATION
48==================
49
50The asn1c compiler works by processing the ASN.1 module specification
51in several stages:
521. In the first stage, the ASN.1 file is parsed.
vlmd79b30d2004-09-05 10:41:23 +000053 (Parsing produces an ASN.1 syntax tree for the subsequent levels)
vlmfa67ddc2004-06-03 03:38:44 +0000542. In the second stage, the syntax tree is "fixed".
vlmd79b30d2004-09-05 10:41:23 +000055 (Fixing is a process of checking the tree for semantic errors,
56 accompanied by the tree transformation into the canonical form)
vlmfa67ddc2004-06-03 03:38:44 +0000573. In the third stage, the syntax tree is compiled into the target language.
58
59There are several command-line options reserved for printing the results
60after each stage of operation:
61
62 <parser> => print (-E)
63 <parser> => <fixer> => print (-E -F)
64 <parser> => <fixer> => <compiler> => print (-P)
65 <parser> => <fixer> => <compiler> => save-compiled [default]
66
67
68--
69Lev Walkin
70vlm@lionet.info