BSD 4_3_Net_2 development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Fri, 22 Feb 1991 02:50:12 +0000 (18:50 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Fri, 22 Feb 1991 02:50:12 +0000 (18:50 -0800)
Work on file usr/src/contrib/isode/pepsy/pepsy-driver.h
Work on file usr/src/contrib/isode/pepsy/pepsy.1
Work on file usr/src/contrib/isode/pepsy/pepsy.h.gnrc
Work on file usr/src/contrib/isode/pepsy/pepsy_strings.c
Work on file usr/src/contrib/isode/pepsy/pepy-refs.h
Work on file usr/src/contrib/isode/pepsy/py_advise.c
Work on file usr/src/contrib/isode/pepsy/sym.h
Work on file usr/src/contrib/isode/pepsy/t2.py
Work on file usr/src/contrib/isode/pepsy/tt.py

Synthesized-from: CSRG/cd2/net.2

usr/src/contrib/isode/pepsy/pepsy-driver.h [new file with mode: 0644]
usr/src/contrib/isode/pepsy/pepsy.1 [new file with mode: 0644]
usr/src/contrib/isode/pepsy/pepsy.h.gnrc [new file with mode: 0644]
usr/src/contrib/isode/pepsy/pepsy_strings.c [new file with mode: 0644]
usr/src/contrib/isode/pepsy/pepy-refs.h [new file with mode: 0644]
usr/src/contrib/isode/pepsy/py_advise.c [new file with mode: 0644]
usr/src/contrib/isode/pepsy/sym.h [new file with mode: 0644]
usr/src/contrib/isode/pepsy/t2.py [new file with mode: 0644]
usr/src/contrib/isode/pepsy/tt.py [new file with mode: 0644]

diff --git a/usr/src/contrib/isode/pepsy/pepsy-driver.h b/usr/src/contrib/isode/pepsy/pepsy-driver.h
new file mode 100644 (file)
index 0000000..3ce1cad
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * common definitions for the pepsy driver routines
+ */
+#define PEPSY_VERSION  2
+
+/* find the default entry for this entry - for decoding
+ * - assumes its the next or the one after or the one after that.
+ * old version
+#define FDFLT_B(p)     ((((p) + 1)->pe_type == DFLT_B) ? ((p) + 1) : \
+                       ((((p) + 2)->pe_type == DFLT_B) ? ((p) + 2): ((p) + 3)))
+ */
+#define FDFLT_B(p)     fdflt_b(p)      /* try a function */
+
+/* find the entry for this default entry - for encoding
+ * call a function - to keep looking till it finds it, this is the
+ * alternative to the above scheme.
+ */
+#define FDFLT_F(p)     fdflt_f(p)      /* have to use a function */
+
+/* assumes encoding tables */
+#define OPT_PRESENT(p, parm)   (BITTEST(parm + p->pe_ucode, p->pe_tag))
+
+/* assumes decoding tables */
+#define SET_OPT_PRESENT(p, parm)       (BITSET(*parm + p->pe_ucode, p->pe_tag))
+#define CLR_OPT_PRESENT(p, parm)       (BITCLR(*parm + p->pe_ucode, p->pe_tag))
+
+#define NO_DATA_USED   (OK + 1)
diff --git a/usr/src/contrib/isode/pepsy/pepsy.1 b/usr/src/contrib/isode/pepsy/pepsy.1
new file mode 100644 (file)
index 0000000..f769972
--- /dev/null
@@ -0,0 +1,67 @@
+.TH PEPSY 1 "24 Jun 1990"
+.\" $Header: /f/osi/pepsy/RCS/pepsy.1,v 7.1 91/02/22 09:49:37 mrose Interim $
+.\"
+.\"
+.\" $Log:      pepsy.1,v $
+.\" Revision 7.1  91/02/22  09:49:37  mrose
+.\" Interim 6.8
+.\" 
+.\" Revision 7.0  90/07/01  19:54:47  mrose
+.\" *** empty log message ***
+.\" 
+.SH NAME
+pepsy \- table driven replacement for posy/pepy
+.SH SYNOPSIS
+.in +.5i
+.ti -.5i
+.B pepsy
+\%[\-A]
+\%[\-a]
+\%[\-f]
+\%[\-h\fIoption\fP]
+\%[\-s]
+\fImodule.py\fR
+.in -.5i
+.SH DESCRIPTION
+The \fIpepsy\fR program reads a description of a \fIpresentation\fR module and
+produces definitions and tables for use with the \fIC\fR programming language.
+It is meant to be backwards-compatible with the \fIposy\fR system.
+(So, \fIpepsy\fR will ignore any \fIpepy\fR-style augmentations in the
+input file.)
+.PP
+The `\-A' (All) switch directs \fIpepsy\fR to generate tables for encoders,
+decoders, and printers.
+.PP
+The `\-a' switch directs \fIpepsy\fR to augment the #include file with
+commentary text.
+.PP
+The `\-f' switch directs \fIpepsy\fR to generate \fIC\fR macros to deallocate
+the structures it defines.
+.PP
+The `\-h' switch enables additional heuristics when \fIpepsy\fR generates a
+\fIC\fR language structure definition.
+Option `0' enables the default heuristics.
+Enabling any other option also results in enabling option `0'.
+Option `1' enables \*(lqclever\*(rq but non\-unique structure naming.
+Option `2' enables the generation of arrays rather than linked-lists
+whenever possible.
+.PP
+Normally, \fIpepsy\fR prints the name of each type as it works.
+The `\-s' switch disables this behavior.
+.SH FILES
+.nf
+.ta \w'\fImodule\fR_pre_defs.h  'u
+\fImodule\fR.ph        extern type definitions from \fImodule\fR
+\fImodule\fR_tables.c  initialised tables for processing \fImodule\fR
+\fImodule\fR-types.h   \fIC\fR structure definitions from \fImodule\fR
+\fImodule\fR_pre_defs.h        Preprocessor constants for each type in \fImodule\fR
+\fImodule\fR_defs.h    macros to support pepy routines for \fImodule\fR's types
+.re
+.fi
+.SH "SEE ALSO"
+pepy(1), posy(1),
+.br
+\fIThe ISO Development Environment: User's Manual\fR
+.SH AUTHOR
+Andrew Worsley,
+CSIRO and UCL
diff --git a/usr/src/contrib/isode/pepsy/pepsy.h.gnrc b/usr/src/contrib/isode/pepsy/pepsy.h.gnrc
new file mode 100644 (file)
index 0000000..5035f69
--- /dev/null
@@ -0,0 +1,342 @@
+%BEGIN(PEPSY)%
+/* pepsy.h - definitions for pepsy */
+%END(PEPSY)%
+%BEGIN(PEPY)%
+/* pepy.h - definitions for pepy */
+%END(PEPY)%
+%BEGIN(ROSY)%
+/* rosy-defs.h - definitions for rosy */
+%END(ROSY)%
+%BEGIN(MOSY)%
+/* mosy-defs.h - definitions for mosy */
+%END(MOSY)%
+/* %WARNING% */
+
+/* 
+ * $Header: /f/osi/pepsy/RCS/pepsy.h.gnrc,v 7.1 91/02/22 09:49:47 mrose Interim $
+ *
+ *
+ * $Log:       pepsy.h.gnrc,v $
+ * Revision 7.1  91/02/22  09:49:47  mrose
+ * Interim 6.8
+ * 
+ * Revision 7.0  90/07/01  19:54:36  mrose
+ * *** empty log message ***
+ * 
+ * Revision 7.0  89/11/23  22:11:48  mrose
+ * Release 6.0
+ * 
+ * Revision 6.1  89/07/30  12:16:16  mrose
+ */
+
+/*
+ *                               NOTICE
+ *
+ *    Acquisition, use, and distribution of this module and related
+ *    materials are subject to the restrictions of a license agreement.
+ *    Consult the Preface in the User's Manual for the full terms of
+ *    this agreement.
+ *
+ */
+
+
+#include "psap.h"
+
+struct tuple {
+    int     t_type;
+    char   *t_class;
+    char   *t_form;
+    char   *t_id;
+    PElementClass t_classnum;
+    int            t_idnum;
+};
+
+typedef struct ypv {
+    int     yv_code;
+#define        YV_UNDF         0x00    /* ??? */
+#define        YV_NUMBER       0x01    /* LITNUMBER */
+#define        YV_BOOL         0x02    /* TRUE | FALSE */
+#define        YV_STRING       0x03    /* LITSTRING */
+#define        YV_IDEFINED     0x04    /* ID */
+#define        YV_IDLIST       0x05    /* IdentifierList */
+#define        YV_VALIST       0x06    /* { Values } */
+#define        YV_NULL         0x07    /* NULL */
+#define YV_ABSENT      0x08    /* WITH COMPONENTS .. ABSENT */
+#define YV_PRESENT     0x09    /*  "   "          .. PRESENT */
+#define YV_INCLUDES    0x0a    /* INCLUDES ... */
+#define YV_WITHCOMPS   0x0b    /* WITH COMPONENTS */
+#define        YV_OIDLIST      0x0c    /* { object identifier } */
+#define YV_REAL                0x0d    /* real value */
+
+    union {
+       int         yv_un_number;               /* code = YV_NUMBER
+                                                  code = YV_BOOL */
+
+       double      yv_un_real;                 /* code = YV_REAL */
+
+       char       *yv_un_string;               /* code = YV_STRING */
+
+       struct {                                /* code = YV_IDEFINED */
+           char   *yv_st_module;
+           char   *yv_st_modid;
+           char   *yv_st_identifier;
+       }               yv_st;
+
+        struct ypv *yv_un_idlist;              /* code = YV_IDLIST
+                                                  code = YV_VALIST
+                                                  code = YV_OIDLIST */
+    }                   yv_un;
+#define        yv_number       yv_un.yv_un_number
+#define        yv_string       yv_un.yv_un_string
+#define        yv_identifier   yv_un.yv_st.yv_st_identifier
+#define        yv_module       yv_un.yv_st.yv_st_module
+#define yv_modid       yv_un.yv_st.yv_st_modid
+#define yv_idlist      yv_un.yv_un_idlist
+#define yv_real                yv_un.yv_un_real
+
+    char   *yv_action;
+    int            yv_act_lineno;
+
+    int            yv_flags;
+#define        YV_NOFLAGS      0x00    /* no flags */
+#define        YV_ID           0x01    /* ID Value */
+#define        YV_NAMED        0x02    /* NamedNumber */
+#define        YV_TYPE         0x04    /* TYPE Value */
+#define        YV_BOUND        0x08    /* named value */
+#define        YVBITS  "\020\01ID\02NAMED\03TYPE\04BOUND"
+
+    char   *yv_id;                             /* flags & YV_ID */
+
+    char   *yv_named;                          /* flags & YV_NAMED */
+
+    struct ype *yv_type;                       /* flags & YV_TYPE */
+
+    struct ypv *yv_next;
+}                      ypv, *YV;
+#define        NULLYV  ((YV) 0)
+
+YV     new_value (), add_value (), copy_value ();
+
+/* \f */
+
+typedef struct ypt {
+    PElementClass   yt_class;
+
+    YV             yt_value;
+}                      ypt, *YT;
+#define        NULLYT  ((YT) 0)
+
+YT     new_tag (), copy_tag ();
+
+/* \f */
+
+typedef struct ype {
+    int     yp_code;
+#define        YP_UNDF         0x00    /* type not yet known */
+#define        YP_BOOL         0x01    /* BOOLEAN */
+#define        YP_INT          0x02    /* INTEGER */
+#define        YP_INTLIST      0x03    /* INTEGER [ NamedNumberList ] */
+#define        YP_BIT          0x04    /* BITSTRING */
+#define        YP_BITLIST      0x05    /* BITSTRING [ NamedNumberList ] */
+#define        YP_OCT          0x06    /* OCTETSTRING */
+#define        YP_NULL         0x07    /* NULL */
+#define        YP_SEQ          0x08    /* SEQUENCE */
+#define        YP_SEQTYPE      0x09    /* SEQUENCE OF Type */
+#define        YP_SEQLIST      0x0a    /* SEQUENCE [ ElementTypes ] */
+#define        YP_SET          0x0b    /* SET */
+#define        YP_SETTYPE      0x0c    /* SET OF Type */
+#define        YP_SETLIST      0x0d    /* SET [ MemberTypes ] */
+#define        YP_CHOICE       0x0e    /* CHOICE [ AlternativeTypeList ] */
+#define        YP_ANY          0x0f    /* ANY */
+#define        YP_OID          0x10    /* OBJECT IDENTIFIER */
+#define        YP_IDEFINED     0x11    /* identifier */
+#define YP_ENUMLIST    0x12    /* ENUMERATED */
+#define YP_REAL                0x13    /* Real (floating-point) */
+
+    int     yp_direction;
+#define YP_DECODER     0x01
+#define YP_ENCODER     0x02
+#define        YP_PRINTER      0x04
+
+    union {
+       struct {                                /* code = YP_IDEFINED */
+           char   *yp_st_module;                   /* module name */
+           OID     yp_st_modid;                    /* module id */
+           char   *yp_st_identifier;               /* definition name */
+       }               yp_st;
+
+       struct ype *yp_un_type;                 /* code = YP_SEQTYPE
+                                                  code = YP_SEQLIST
+                                                  code = YP_SETTYPE
+                                                  code = YP_SETLIST
+                                                  code = YP_CHOICE */
+
+       YV          yp_un_value;                /* code = YP_INTLIST
+                                                  code = YP_BITLIST */
+    }                   yp_un;
+#define        yp_identifier   yp_un.yp_st.yp_st_identifier
+#define        yp_module       yp_un.yp_st.yp_st_module
+#define yp_modid       yp_un.yp_st.yp_st_modid
+#define        yp_type         yp_un.yp_un_type
+#define        yp_value        yp_un.yp_un_value
+
+    char   *yp_intexp;         /* expressions to pass (use) as extra */
+    char   *yp_strexp;         /* parameters (primitive values) */
+    char    yp_prfexp;
+
+    char   *yp_declexp;
+    char   *yp_varexp;
+
+    char   *yp_structname;
+    char   *yp_ptrname;
+
+    char   *yp_param_type;
+
+    char   *yp_action0;
+    int     yp_act0_lineno;
+
+    char   *yp_action05;
+    int            yp_act05_lineno;
+
+    char   *yp_action1;
+    int            yp_act1_lineno;
+
+    char   *yp_action2;
+    int            yp_act2_lineno;
+
+    char   *yp_action3;
+    int            yp_act3_lineno;
+
+    int     yp_flags;
+#define        YP_NOFLAGS      0x0000  /* no flags */
+#define        YP_OPTIONAL     0x0001  /* OPTIONAL */
+#define        YP_COMPONENTS   0x0002  /* COMPONENTS OF */
+#define        YP_IMPLICIT     0x0004  /* IMPLICIT */
+#define        YP_DEFAULT      0x0008  /* DEFAULT */
+#define        YP_ID           0x0010  /* ID */
+#define        YP_TAG          0x0020  /* Tag */
+#define        YP_BOUND        0x0040  /* ID LANGLE */
+#define        YP_PULLEDUP     0x0080  /* member is a choice */
+#define YP_PARMVAL     0x0100  /* value to be passed to parm is present */
+#define YP_CONTROLLED  0x0200  /* encoding item has a controller */
+#define        YP_OPTCONTROL   0x0400  /*   .. */
+#define        YP_ACTION1      0x0800  /* action1 acted upon */
+#define        YP_PARMISOID    0x1000  /* value to be passed to parm is OID */
+#define YP_ENCRYPTED   0x2000  /* encypted - which is a bit hazy */
+#define YP_IMPORTED    0x4000  /* value imported from another module */
+#define YP_EXPORTED    0x8000  /* value exported to another module */
+#define        YPBITS  "\020\01OPTIONAL\02COMPONENTS\03IMPLICIT\04DEFAULT\05ID\06TAG\
+\07BOUND\010PULLEDUP\011PARMVAL\012CONTROLLED\013OPTCONTROL\
+\014ACTION1\015PARMISOID\016ENCRYPTED\017IMPORTED\020EXPORTED"
+
+    YV     yp_default;                         /* flags & YP_DEFAULT */
+
+    char   *yp_id;                             /* flags & YP_ID */
+
+    YT     yp_tag;                             /* flags & YP_TAG */
+
+    char   *yp_bound;                          /* flags & YP_BOUND */
+
+    char   *yp_parm;                           /* flags & YP_PARMVAL */
+
+    char   *yp_control;                                /* flags & YP_CONTROLLED */
+
+    char   *yp_optcontrol;                     /* flags & YP_OPTCONTROL */
+
+    char   *yp_offset;
+
+    struct ype *yp_next;
+}                      ype, *YP;
+#define        NULLYP  ((YP) 0)
+
+YP     new_type (), add_type (), copy_type ();
+
+char   *new_string ();
+
+#define        TBL_EXPORT      0
+#define TBL_IMPORT     1
+#define MAX_TBLS       2
+
+extern int tagcontrol;
+#define TAG_UNKNOWN    0
+#define TAG_IMPLICIT   1
+#define TAG_EXPLICIT   2
+
+#define CH_FULLY       0
+#define CH_PARTIAL     1
+
+typedef struct yop {
+    char   *yo_name;
+
+    YP     yo_arg;
+    YP     yo_result;
+    YV     yo_errors;
+    YV     yo_linked;
+
+    int            yo_opcode;
+}              yop, *YO;
+#define        NULLYO  ((YO) 0)
+
+
+typedef struct yerr {
+    char   *ye_name;
+
+    YP     ye_param;
+
+    int            ye_errcode;
+
+    int            ye_offset;
+}          yerr, *YE;
+#define        NULLYE  ((YE) 0)
+
+/* \f */
+
+%BEGIN(PEPSY)%
+extern char *pepsyversion;
+%END(PEPSY)%
+%BEGIN(PEPY)%
+extern char *pepyversion;
+%END(PEPY)%
+%BEGIN(ROSY)%
+extern char *rosyversion;
+%END(ROSY)%
+%BEGIN(MOSY)%
+extern char *mosyversion;
+%END(MOSY)%
+
+extern int yysection;
+extern char *yyencpref;
+extern char *yydecpref;
+extern char *yyprfpref;
+extern char *yyencdflt;
+extern char *yydecdflt;
+extern char *yyprfdflt;
+
+extern int yydebug;
+extern int yylineno;
+
+#ifndef        HPUX
+extern char yytext[];
+#else
+extern unsigned char yytext[];
+#endif
+
+extern char *mymodule;
+
+extern OID   mymoduleid;
+
+extern char *bflag;
+extern int   Cflag;
+extern int   dflag;
+extern int   Pflag;
+extern char *sysin;
+
+extern char *module_actions;
+
+OID    addoid ();
+OID    int2oid ();
+OID    oidlookup ();
+char   *oidname ();
+char   *oidprint ();
+
+extern int errno;
diff --git a/usr/src/contrib/isode/pepsy/pepsy_strings.c b/usr/src/contrib/isode/pepsy/pepsy_strings.c
new file mode 100644 (file)
index 0000000..6082778
--- /dev/null
@@ -0,0 +1,60 @@
+/* pepy_strings.c - constant strings used in pepy */
+
+#ifndef        lint
+static char *rcsid = "$Header: /f/osi/pepsy/RCS/pepsy_strings.c,v 7.1 91/02/22 09:49:50 mrose Interim $";
+#endif
+
+/* 
+ * $Header: /f/osi/pepsy/RCS/pepsy_strings.c,v 7.1 91/02/22 09:49:50 mrose Interim $
+ *
+ *
+ * $Log:       pepsy_strings.c,v $
+ * Revision 7.1  91/02/22  09:49:50  mrose
+ * Interim 6.8
+ * 
+ * Revision 7.0  90/07/01  19:54:28  mrose
+ * *** empty log message ***
+ * 
+ * Revision 7.0  89/11/23  22:11:54  mrose
+ * Release 6.0
+ * 
+ */
+
+/*
+ *                               NOTICE
+ *
+ *    Acquisition, use, and distribution of this module and related
+ *    materials are subject to the restrictions of a license agreement.
+ *    Consult the Preface in the User's Manual for the full terms of
+ *    this agreement.
+ *
+ */
+
+char   *pepy_strings[] = {
+       "bad ",                         /* PEPY_ERR_BAD */
+       "bad bitstring: ",              /* PEPY_ERR_BAD_BITS */
+       "bad boolean: ",                /* PEPY_ERR_BAD_BOOLEAN */
+       "bad class/id: ",               /* PEPY_ERR_BAD_CLASS */
+       "bad class/form/id: ",          /* PEPY_ERR_BAD_CLASS_FORM_ID */
+       "bad form ",                    /* PEPY_ERR_BAD_FORM */
+       "bad integer: ",                /* PEPY_ERR_BAD_INTEGER */
+       "bad object identifier: ",      /* PEPY_ERR_BAD_OID */
+       "bad octetstring: ",            /* PEPY_ERR_BAD_OCTET */
+       "bad real: ",                   /* PEPY_ERR_BAD_REAL */
+       "bad sequence: ",               /* PEPY_ERR_BAD_SEQ */
+       "bad set: ",                    /* PEPY_ERR_BAD_SET */
+       "has too many bits",            /* PEPY_ERR_TOO_MANY_BITS */
+       "has too many elements",        /* PEPY_ERR_TOO_MANY_ELEMENTS */
+       "has unknown choice: ",         /* PEPY_ERR_UNKNOWN_CHOICE */
+       "has unknown component: ",      /* PEPY_ERR_UNK_COMP */
+       "initialization fails",         /* PEPY_ERR_INIT_FAILED */
+       "invalid choice selected: ",    /* PEPY_ERR_INVALID_CHOICE */
+       "missing ",                     /* PEPY_ERR_MISSING */
+       "out of memory",                /* PEPY_ERR_NOMEM  */
+       "too many elements for tagged ", /* PEPY_ERR_TOO_MANY_TAGGED */
+       "warning: extra or duplicate members present in SET",
+                                       /* PEPY_ERR_EXTRA_MEMBERS */
+       (char *)0
+};
+       
+       
diff --git a/usr/src/contrib/isode/pepsy/pepy-refs.h b/usr/src/contrib/isode/pepsy/pepy-refs.h
new file mode 100644 (file)
index 0000000..d5e6cee
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * data structure(s) for module T3 (t3.py)
+ */
+
+/* bits to use for optional fields */
+#define OPT_REAL1      0
+#define OPT_INT1       1
+#define OPT_INT2       2
+#define OPT_ENUM1      3
+#define OPT_ENUM2      4
+#define OPT_BOOL1      5
+#define OPT_BOOL2      6
+#define OPT_REAL2      7
+#define NUMOPT         8
+
+struct pepy_refs {
+    integer            t_int;
+    integer            t_enum;
+    struct qbuf                *t_qbuf;
+    char               *t_string;
+    char               *t_ostring;
+    char               *t_bstring;
+    int                        t_blen;
+    int                        t_olen;
+    char               t_bool;
+    double             t_real;
+    OID                        t_oid;
+    PE                 t_pe;
+    PE                 t_any;
+    struct pepy_refs1  *t_def;
+    struct pepy_refs1  *t_opt;
+    char       opt_set[NBITS2NCHARS(NUMOPT)]
+       };
+
+struct pepy_refs1 {
+    integer            t_int;
+    integer            t_int1;
+    integer            t_enum;
+    integer            t_enum1;
+    struct qbuf                *t_qbuf;
+    struct qbuf                *t_qbuf1;
+    char               *t_string;
+    char               *t_string1;
+    char               *t_ostring;
+    char               *t_ostring1;
+    char               *t_bstring;
+    int                        t_blen;
+    char               *t_bstring1;
+    int                        t_blen1;
+    int                        t_olen;
+    int                        t_olen1;
+    char               t_bool;
+    char               t_bool1;
+    double             t_real;
+    double             t_real1;
+    OID                        t_oid;
+    OID                        t_oid1;
+    PE                 t_pe;
+    PE                 t_pe1;
+    PE                 t_any;
+    char       opt_set[NBITS2NCHARS(NUMOPT)]
+       };
+
+struct rep_elem {
+       int             r_int;
+       char            *r_ostring;
+       char            *r_bstring;
+       struct rep_elem *r_next;
+    };
+#define NULLREP_ELEM   (struct rep_elem *)0
+
+struct rep_int {
+       int             i;
+       struct rep_int  *r;
+       };
+#define NULLREP_INT    (struct rep_int *)0
+
+
+struct repeats {
+       struct rep_int  *rp_sq1;        /* SEQUECE of INTEGER */
+       struct rep_elem *rp_sq2;        /* SEQUENCE OF Rep-elem */
+       struct rep_int  *rp_st1;        /* SET OF INTEGER */
+       struct rep_elem *rp_st2;        /* SET OF Rep-elem */
+
+       int     rp_choice;
+#define RP_INT         1       /* INTEGER */
+#define RP_BOOL                2       /* BOOLEAN */
+#define RP_OSTRING     3       /* OCTET STRING */
+       int     rp_int;         /* integer or boolean */
+       char    rp_bool;        /* integer or boolean */
+       char    *rp_ostring;
+};
+
+#define CD_INT         0
+#define CD_C           1
+#define CD_D           2
+#define NCD_OPT                3
+
+struct codedata {
+       PE      cd_a;
+       PE      cd_b;
+       PE      cd_c;
+       PE      cd_d;
+       integer cd_int;
+       integer cd_int1;
+       integer cd_int2;
+       char    *cd_string;
+       char    *cd_string1;
+       char    *cd_string2;
+       struct codedata *cd_left;
+       struct codedata *cd_right;
+       char    cd_opt_set[NBITS2NCHARS(NCD_OPT)];
+       char    cd_bool;
+       double  cd_real;
+       OID     cd_oid;
+       OID     cd_oid1;
+       OID     cd_oid2;
+       PE      cd_bit;
+};
+
diff --git a/usr/src/contrib/isode/pepsy/py_advise.c b/usr/src/contrib/isode/pepsy/py_advise.c
new file mode 100644 (file)
index 0000000..d73d093
--- /dev/null
@@ -0,0 +1,65 @@
+/* py_advise.c - standard "advise" routine for pepsy/pepy */
+
+#ifndef        lint
+static char *rcsid = "$Header: /f/osi/pepsy/RCS/py_advise.c,v 7.2 91/02/22 09:50:02 mrose Interim $";
+#endif
+
+/* 
+ * $Header: /f/osi/pepsy/RCS/py_advise.c,v 7.2 91/02/22 09:50:02 mrose Interim $
+ *
+ *
+ * $Log:       py_advise.c,v $
+ * Revision 7.2  91/02/22  09:50:02  mrose
+ * Interim 6.8
+ * 
+ * Revision 7.1  90/07/09  14:53:19  mrose
+ * sync
+ * 
+ * Revision 7.0  89/11/23  22:12:05  mrose
+ * Release 6.0
+ * 
+ */
+
+/*
+ *                               NOTICE
+ *
+ *    Acquisition, use, and distribution of this module and related
+ *    materials are subject to the restrictions of a license agreement.
+ *    Consult the Preface in the User's Manual for the full terms of
+ *    this agreement.
+ *
+ */
+
+
+/* LINTLIBRARY */
+
+#include <stdio.h>
+#include <varargs.h>
+
+/* \f */
+
+#ifndef        lint
+char   PY_pepy[BUFSIZ];
+
+
+void   PY_advise (va_alist)
+va_dcl
+{
+    va_list    ap;
+
+    va_start (ap);
+
+    asprintf (PY_pepy, ap);
+
+    va_end (ap);
+}
+#else
+/* VARARGS */
+
+void   PY_advise (what, fmt)
+char   *what,
+       *fmt;
+{
+    PY_advise (what, fmt);
+}
+#endif
diff --git a/usr/src/contrib/isode/pepsy/sym.h b/usr/src/contrib/isode/pepsy/sym.h
new file mode 100644 (file)
index 0000000..7d18703
--- /dev/null
@@ -0,0 +1,39 @@
+/* sym.h */
+
+/* 
+ * $Header: /f/osi/pepsy/RCS/sym.h,v 7.1 91/02/22 09:50:03 mrose Interim $
+ *
+ *
+ * $Log:       sym.h,v $
+ * Revision 7.1  91/02/22  09:50:03  mrose
+ * Interim 6.8
+ * 
+ * Revision 7.0  90/07/01  19:54:45  mrose
+ * *** empty log message ***
+ * 
+ */
+
+/*
+ *                               NOTICE
+ *
+ *    Acquisition, use, and distribution of this module and related
+ *    materials are subject to the restrictions of a license agreement.
+ *    Consult the Preface in the User's Manual for the full terms of
+ *    this agreement.
+ *
+ */
+
+
+typedef struct symlist {
+    char   *sy_encpref;
+    char   *sy_decpref;
+    char   *sy_prfpref;
+    char   *sy_module;
+    char   *sy_name;
+
+    YP     sy_type;
+
+    struct symlist *sy_next;
+}              symlist, *SY;
+#define        NULLSY  ((SY) 0)
+
diff --git a/usr/src/contrib/isode/pepsy/t2.py b/usr/src/contrib/isode/pepsy/t2.py
new file mode 100644 (file)
index 0000000..471ed44
--- /dev/null
@@ -0,0 +1,43 @@
+
+T2 DEFINITIONS ::=
+
+
+BEGIN
+
+-- Embedded Sequences test
+
+
+SECTIONS enc dec prnt
+
+Info ::= SEQUENCE {
+       a1 [0] IMPLICIT INTEGER,
+       a2 [1] IMPLICIT INTEGER,
+       a3 [2] IMPLICIT INTEGER,
+       a4 MPDU 
+       }
+
+MPDU ::=
+       SEQUENCE {
+           a-seq SEQUENCE {
+               fred [0] IMPLICIT INTEGER
+
+           }
+       }
+
+-- Simple type optimisations of POSY/PEPY
+
+ Bstring ::= [APPLICATION 8] BIT STRING
+
+ Ostring ::= [31] IMPLICIT OCTET STRING
+
+ Obj ::= [101] IMPLICIT MPDU
+
+ Sset ::= SET
+
+ Sseq ::= SEQUENCE
+
+ Sany ::= ANY
+
+ Soid ::= OBJECT IDENTIFIER
+
+END
diff --git a/usr/src/contrib/isode/pepsy/tt.py b/usr/src/contrib/isode/pepsy/tt.py
new file mode 100644 (file)
index 0000000..90e77b2
--- /dev/null
@@ -0,0 +1,55 @@
+TT DEFINITIONS ::=
+
+%{
+int foo;
+%}
+
+BEGIN
+
+EntryInformationSelection [[P struct entryinfoselection *]]
+       ::=
+       SET
+       {
+       attributeTypes
+               CHOICE [[ T struct entryinfoselection * $ *]]
+               <D< (*parm)->eis_allattributes>>
+               <E< parm->eis_allattributes ? 1 : 2>>
+               {
+               allAttributes
+                       [0] NULL,
+               select
+                       [1] SET OF [[ T struct attrcomp * $ eis_select ]] <<attr_link>>
+                               AttributeType [[p attr_type]]
+               }
+               %D{
+                       if ((*parm)->eis_allattributes == 1)
+                          (*parm)->eis_allattributes = TRUE;
+                       else
+                          (*parm)->eis_allattributes = FALSE;
+               %}
+                   -- DEFAULT allAttributes NULL,
+                   OPTIONAL <E<parm->eis_allattributes != FALSE>><D<0>>,
+       infoTypes
+               [2] INTEGER [[i eis_infotypes]]
+               {
+               attributeTypesOnly(0) ,
+               attributeTypesAndValues(1)
+               }
+                   DEFAULT attributeTypesAndValues
+       }
+
+
+TestChoice ::= CHOICE <E< 1 >> <D< foo >> {
+       one OCTET STRING,
+       two SEQUENCE {
+               one2 IA5String OPTIONAL <E< 1 >> <D< 0 >>,
+               two2 CHOICE {
+                       one3 NULL,
+                       two3 INTEGER
+               } OPTIONAL <E<1>> <D<foo = 1>>
+       },
+       three INTEGER {eine(1), zwei(2), drie(3) },
+       four BIT STRING { un(1), deux(2), trois(3), quatre(4) }
+}
+END
+