snacc ASN.1 Compiler Release  1.0 - Mike Sample Nov 92
-----------------------------------------------------

This package provides the C/yacc/lex source code for snacc, an ASN.1
to C or C++ compiler.  Snacc is short for "Sample Neufeld Asn.1 to C
Compiler" and ASN.1 stands for Abstract Syntax Notation One (CCITT
X.208/ ISO 8824/8825).  See the COPYRIGHT file for copyright
information.


What It Does
------------

Given an ASN.1 source file(s) snacc produces reasonably efficient C or
C++ routines and data structures to support BER encoding and decoding
values of the given ASN.1 data structures.  Printing routines for the
decoded values are also generated.  For C only, hierarchical freeing
routines are generated (but are not recommended for efficiency reasons).
For each ASN.1 source file (module), snacc creates the following C files:

        1. .h file for the C/C++ translation of the ASN.1 data
           structure and prototypes for the generated routines.

        2. .c/.C file for the C/C++ encode, decode, print and free
           routines.

See the latex or PostScript documentation in the snacc/doc directory
for indepth information on this tool.  For a quick introduction,
look at the examples in snacc/c_examples and snacc/c++_examples.


Features of ASN.1 Supported
---------------------------

   - parses ASN.1 '88 (subtype notation etc.)
   - macro definitions do not generate syntax errors but are
     are not processed. (retained as string)
   - value notation is parsed and for OBJECT IDENTIFIERs, INTEGERs
      and BOOLEANS (any other value in { }'s is currently kept as a string)
   - handles multiple ASN.1 module compiling/linking (IMPORTS/EXPORTS)
   - some X.400 and SNMP macros are parsed
   - supports ";" separted type or value definitions in the ASN.1 source.
     This is useful when dealing with some macros that introduce parsing
     problems.
   - ANY DEFINED BY types are handled using the SNMP OBJECT-TYPE
     macro to define the identifier to type mapping.


Bugs are quite likely as this is a first release of snacc.  if you find
any or have other comments please email:
   msample@cs.ubc.ca 
   or
   neufeld@cs.ubc.ca


To Install It
-------------

By default, the snacc makefile uses GNU bison and GNU flex (instead of
yacc and lex).  If you do not have these installed, see the
snacc/src/README and snacc/src/makefile.  Otherwise, type "make" in
this directory.  Hopefully this will put the snacc binary in the
snacc/bin directory and build the C runtime library. Alternatively,
type "make both" to install the compiler and both the C and C++
library (or "make c++" for the compiler and the C++ library)

Compiling problems may occurr on different flavours of UNIX but they
should not be too difficult fix.  Likely sources of problems include
non-standard include files and lex, yacc and cc idiosyncrasies.

The snacc compiler and the generated code will compile under ANSI and
non-ANSI C compilers.  See the README and the makefile in the
snacc/src directory for more compiling information.  Snacc has been
successfully installed on SPARCs, HP700s, IBM RS 6000s and MIPS
machines.


The directory tree of this release is:

snacc/
        COPYRIGHT
        README      - this file
        asn1specs/            - ASN.1 files for useful types and examples
                1155_smi.asn1
                1157_snmp.asn1
                1213_mib2.asn1
                any.asn1
                err_test.asn1
                p_rec.asn1
                useful.asn1

        bin/
                acc*     - sh script that calls snacc and sorts errors by line
                snacc*   - ASN.1 compiler

        c++_examples/    - 4 ASN.1 to C++ examples
                any/
                        README
                        example.C
                        genber.C
                        makefile
                simple/
                        README
                        example.C
                        genber.C
                        good_pr.ber
                        makefile
                        test*
                snmp/
                        README
                        makefile
                test_lib/        - tests C++ runtime lib enc & dec routines
                        README
                        makefile
                        test_lib.C

        c++_include/       - include files for C++ ASN.1 runtime library
                asn_any.h
                asn_bits.h
                asn_bool.h
                asn_buf.h
                asn_config.h
                asn_enum.h
                asn_incl.h
                asn_int.h
                asn_len.h
                asn_list.h
                asn_null.h
                asn_octs.h
                asn_oid.h
                asn_real.h
                asn_tag.h
                asn_type.h
                asn_useful.h
                hash.h
                print.h
                str_stk.h

        c++_lib/          - C++ ASN.1 runtime library
                README
                asn_any.C
                asn_bits.C
                asn_bool.C
                asn_int.C
                asn_len.C
                asn_list.C
                asn_null.C
                asn_octs.C
                asn_oid.C
                asn_real.C
                asn_tag.C
                asn_useful.C
                hash.C
                makefile
                print.C
                str_stk.C

        c_examples/  - 4 ASN.1 to  C examples
                any/
                        README
                        example.c
                        genber.c
                        makefile

                simple/
                        README
                        expbuf_ex.c
                        genber.c
                        good_pr.ber
                        makefile
                        minbuf_ex.c
                        sbuf_ex.c
                        test*
                snmp/
                        README
                        makefile
                test_lib/  - tests C runtime lib enc & dec routines
                        README
                        makefile
                        test_lib.c

        c_include/        - include files for C ASN.1 runtime library
                asn_any.h
                asn_bits.h
                asn_bool.h
                asn_config.h
                asn_enum.h
                asn_incl.h
                asn_int.h
                asn_len.h
                asn_list.h
                asn_null.h
                asn_octs.h
                asn_oid.h
                asn_real.h
                asn_tag.h
                asn_useful.h
                exp_buf.h
                hash.h
                min_buf.h
                nibble_alloc.h
                print.h
                sbuf.h
                str_stk.h

        c_lib/            - source for C ASN.1 runtime library
                README
                asn_any.c
                asn_bits.c
                asn_bool.c
                asn_enum.c
                asn_int.c
                asn_len.c
                asn_list.c
                asn_null.c
                asn_octs.c
                asn_oid.c
                asn_real.c
                asn_tag.c
                asn_useful.c
                exp_buf.c
                hash.c
                makefile
                nibble_alloc.c
                print.c
                str_stk.c

        doc/                - latex and PostScript Documentation for snacc
                asn1.bib
                makefile
                snacc.tex  - latex version of the manul
                snacc.ps   - postscript version of the manual
                snacc.1    - manual page for snacc 
        makefile           - main makefile for installing and tar'ing

        src/               - snacc compiler C/lex/yacc source code
                README
                asn1.lex
                asn1.yacc
                asn1module.h
                basetypes.h
                ber.h
                define.c
                define.h
                dependency.c
                dependency.h
                do_macros.c
                do_macros.h
                err_chk.c
                err_chk.h
                exports.c
                exports.h
                lex_stuff.h
                lib_types.c
                lib_types.h
                link_types.c
                link_types.h
                link_values.c
                link_values.h
                list.c
                list.h
                makefile
                mem.c
                mem.h
                normalize.c
                normalize.h
                oid.c
                oid.h
                parser.h
                print.c
                print.h
                recursive.c
                recursive.h
                snacc.c
                snacc_config.h
                snacc_util.c
                snacc_util.h
                back_ends/
                        c++_gen/  - C++ backend to snacc
                                cpp_rules.c
                                cpp_rules.h
                                cpp_types.c
                                cpp_types.h
                                gen_cpp_any.c
                                gen_cpp_any.h
                                gen_cpp_code.c
                                gen_cpp_code.h
                                gen_cpp_vals.c
                                gen_cpp_vals.h
                                makefile
                        c_gen/   - C backend to snacc
                                c_kwd.c
                                c_kwd.h
                                cpp_kwd.c
                                cpp_kwd.h
                                gen_c_any.c
                                gen_c_any.h
                                gen_c_code.c
                                gen_c_code.h
                                gen_c_dec.c
                                gen_c_dec.h
                                gen_c_enc.c
                                gen_c_enc.h
                                gen_c_free.c
                                gen_c_free.h
                                gen_c_print.c
                                gen_c_print.h
                                gen_c_type.c
                                gen_c_type.h
                                gen_c_vals.c
                                gen_c_vals.h
                                makefile
                                rules.c
                                rules.h
                                str_util.c
                                str_util.h
                                tag_util.c
                                tag_util.h
                                type_info.c
                                type_info.h
                                util.c
                                util.h
        
                typetbl.c
                typetbl.h
                val_parser.c
                val_parser.h


