File: README

package info (click to toggle)
snacc 1.3.1-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,132 kB
  • sloc: ansic: 33,001; cpp: 5,163; yacc: 2,217; sh: 2,146; makefile: 839; lex: 517; sed: 4
file content (83 lines) | stat: -rw-r--r-- 2,571 bytes parent folder | download | duplicates (4)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
(RCS control information is at the end of this file.)


Table encoder/decoder example README - MS 93
------------------------------------

This directory contains an example that shows:

   1. the process of creating and using tables.
   2. examples of decoding, printing, and encoding.


To dive right in just type "make" in this directory.  That will
create the "example" executable (you should have previously installed
the snacc and mkchdr progs and the table library).

Then type:

 make check

and see what happens. Look in example.c and makefile to see how things
work.



Questions and Answers
---------------------

Q. What is a table? (also refered to a type table or type tree)

A. A table is simply a data structure that holds a description of
   the types from an ASN.1 module.  This table can then be used
   by a number of "generic" routines to do ASN.1 related (BER
   encoding/decoding) or other useful things such as printing
   values, freeing values and whatever else you can dream up.


Q. How do I create a table from my ASN.1 source files?

A. Run snacc with the -T option, e.g.:

     snacc -T mytbls.tt myMod1.asn1 myMod2.asn1

   the above command will create the "mytbls.tt" file that
   holds the descriptions of the ASN.1 types in the "myMod1.asn1"
   and "myMod2.asn1" files. (look in the makefile in this directory)


Q. Why is there only a C interface to tables?

A. Time. Tables drivers create/read/free these types
   without having seen a typedef for them.  The C implementation
   uses some assumptions about how structures etc. are allocated
   and accessed.  With C++ this is much more difficult.  It can
   be done but required more time than I had.


Q. Ok, tables sound great, what's the catch?

A. Well,

   1. table driven encoding and decoding is something like
      4 times slower than the C or C++ version.
      (but tables are *way* smaller than the .o's for the compiled approach)
   2. the ANY DEFINED BY stuff is not supported at all.
   3. subtype information is not included in the tables (time crunch again)
      (PER encoders/decoders will need the subtype info)
   4. Values from the ASN.1 source are not included in the table.

   If you have the time and skills, you can fix 2, 3 and 4.  1 is harder.



Q.  Tell me more.

A.  Look at the manual. (in .../doc/)

#-------------------------------------------------------------------------------
# $Header: /usr/app/odstb/CVS/snacc/tbl-example/README,v 1.1 1997/02/15 19:33:24 rj Exp $
# $Log: README,v $
# Revision 1.1  1997/02/15 19:33:24  rj
# first check-in
#