1 /*****************************************************************************
2   FILE           : $Source: /projects/higgs1/SNNS/CVS/SNNS/tools/sources/symtab.h,v $
3   SHORTNAME      : symtab
4   SNNS VERSION   : 4.2
5 
6   PURPOSE        : Symbol table (ST) for SNNS batch interpreter
7   NOTES          :
8 
9   AUTHOR         : Jens Wieland
10   DATE           :
11 
12   CHANGED BY     :
13   RCS VERSION    : $Revision: 1.5 $
14   LAST CHANGE    : $Date: 1998/02/25 15:35:00 $
15 
16     Copyright (c) 1990-1995  SNNS Group, IPVR, Univ. Stuttgart, FRG
17     Copyright (c) 1996-1998  SNNS Group, WSI, Univ. Tuebingen, FRG
18 
19 ******************************************************************************/
20 typedef int Int_type;       /* God made the integers ... */
21 typedef enum { UNKNOWN, INT, REAL, BOOL, FCT, STRING } Data_type;
22 #undef FALSE
23 #undef TRUE
24 typedef enum { FALSE = 0, TRUE } Bool_type;
25 #define FALSE 0
26 #define TRUE 1
27 typedef double Real_type;
28 typedef char *String_type;  /* ... all else is the work of man */
29 
30 typedef int St_ptr_type;    /* ST index; points to ST entries */
31 
32 #define ST_NULL -1          /* ST empty value */
33 
34 /*****************************************************************************
35   the argument pointer list:
36   linked list of ST pointers which point to
37   the arguments for a function call in a user program:
38 ******************************************************************************/
39 struct arglist_type {
40                       St_ptr_type arg_ptr;        /* points to ST entry */
41 		      struct arglist_type *next;  /* link field */
42 		    };
43 typedef struct arglist_type arglist_type;
44 
45 #define ARG_NULL (arglist_type *) 0
46 
47 
48 /* function type for jacket function: */
49 typedef void (*Jacket_fct_ptr)(arglist_type *);
50 
51 /* type of value of a ST member: */
52 typedef union { Int_type int_val;
53                 Bool_type bool_val;
54                 Real_type real_val;
55 		String_type string_val;
56 		Jacket_fct_ptr fct_val;
57               } Val_type;
58 
59 
60 
61 extern void st_init(void);
62 
63 extern St_ptr_type st_insert(const char *name);
64 extern St_ptr_type st_lookup(const char *name);
65 
66 extern void st_get_val_type(St_ptr_type pos, Data_type *type, Val_type *val);
67 extern void st_set_val_type(St_ptr_type pos, Data_type type, Val_type val);
68 
69 extern void st_set_ro(St_ptr_type pos);
70 extern Bool_type st_get_ro(St_ptr_type pos);
71 
72 extern char *newtmp(void);
73