blob: 586bb3d388696e8e3b6206f42afa13c1393cf14b [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
9An excellent book on ASN.1 is written by Olivier Dubuisson:
10"ASN.1 Communication between heterogeneous systems", ISBN:0-12-6333361-0.
11
12
13QUICK START
14===========
15
16After building [and installing] the compiler (see INSTALL), you may use
17the asn1c command to compile the ASN.1 specification:
18
19 asn1c <spec.asn1>
20
21If several specifications contain interdependencies, all of them must be
22specified:
23
24 asn1c <spec1.asn1> <spec2.asn1> ...
25
26The ./examples directory contains several ASN.1 modules and a script to
27extract ASN.1 modules from RFC documents. To compile X.509 PKI module:
28
29 ./asn1c/asn1c -P ./examples/*PKIX*93*.asn1
30
31In this example, -P option is used to instruct the compiler to print the
32compiled text on the standard output instead of creating multiple .c
33and .h files for every ASN.1 type found inside the specified files.
34This is useful for debugging and tests automation.
35
36The compiler -E and -EF options are used for testing the parser and
37the semantic fixer, respectively. These options will instruct the compiler
38to dump out the parsed (and fixed) ASN.1 specification as it was
39"understood" by the compiler. It might be useful for checking
40whether a particular syntactic construction is properly supported
41by the compiler.
42
43 asn1c -EF <spec-to-test.asn1>
44
45
46MODEL OF OPERATION
47==================
48
49The asn1c compiler works by processing the ASN.1 module specification
50in several stages:
511. In the first stage, the ASN.1 file is parsed.
52 (Parsing produces an ASN.1 syntax tree for the subsequent levels.)
532. In the second stage, the syntax tree is "fixed".
54 (Fixing is done by checking the tree for semantic errors
55 and by transforming the tree into the canonical representation.)
563. In the third stage, the syntax tree is compiled into the target language.
57
58There are several command-line options reserved for printing the results
59after each stage of operation:
60
61 <parser> => print (-E)
62 <parser> => <fixer> => print (-E -F)
63 <parser> => <fixer> => <compiler> => print (-P)
64 <parser> => <fixer> => <compiler> => save-compiled [default]
65
66
67--
68Lev Walkin
69vlm@lionet.info