Annotation of OpenXM/src/kan96xx/Kan/stackm.h, Revision 1.1.1.1
1.1 maekawa 1: #define LOAD_SM1_PATH "/usr/local/lib/sm1/"
2: /* Do not forget to put / at the tail.
3: "/usr/local/lib/sm1" does not work.
4: */
5:
6:
7: /******************* stackm.h ******************************/
8: #include <setjmp.h>
9:
10:
11:
12: /**** data types (class identifiers) ************/
13: /* Never change the following orders.
14: If you add a new class, add that class at the bottom and give the
15: max number. */
16: #define Snull 0
17: #define Sinteger 1 /* integer */
18: #define Sstring 2 /* pointer to a string */
19: #define SexecutableArray 3 /* executable array */
20: #define Soperator 4 /* operators defined in the system dic */
21: #define Sdollar 5 /* pointer to a string obtained from $...$ */
22: #define Sarray 6 /* lc.ival is the size of array,
23: (rc.op)[0], ..., (rc.op)[k] is the array
24: of object */
25: #define SleftBraceTag 7 /* [ */
26: #define SrightBraceTag 8 /* ] */
27: #define Spoly 9
28: #define SarrayOfPOLY 10
29: #define SmatrixOfPOLY 11
30: #define Slist 12 /* list of object */
31: #define Sfile 13
32: #define Sring 14
33: #define SuniversalNumber 15
34: #define SrationalFunction 16
35: #define Sclass 17 /* class, for extension */
36: #define Sdouble 18
37:
38: #define TYPES 19 /* number of data types. */
39: /* NOTE! If you change the above, you need to change mklookup.c too. */
40: /* Change also dr.sm1 : datatype constants. */
41:
42: #define CMO 1024 /* cf. plugin cmo.h. Object tag used in cmo. */
43: /* CMO --- CMO+1024*3
44: CMO + LARGEID ( cf.cmo.h ) --- CMO + LARGEID+256
45: CMO + PRIVATEID ( cf.cmo.h ) --- CMO + PRIVATEID+256
46: are reserved area.
47: */
48:
49: typedef struct object * objectp;
50: /*********** fundamental data types ****************/
51: union cell {
52: int ival;
53: char *str;
54: struct object *op;
55: POLY poly;
56: struct arrayOfPOLY *arrayp;
57: struct matrixOfPOLY *matrixp;
58: struct tokens *tokenArray;
59: FILE *file;
60: struct ring *ringp;
61: struct coeff *universalNumber;
62: void *voidp;
63: double *dbl;
64: };
65:
66: struct object{
67: int tag; /* class identifier */
68: union cell lc; /* left cell */
69: union cell rc; /* right cell */
70: };
71:
72: struct dictionary {
73: char *key;
74: int h0; /* Value of hash functions */
75: int h1;
76: struct object obj;
77: int attr;
78: };
79:
80: struct operandStack {
81: struct object *ostack;
82: int sp;
83: int size;
84: };
85:
86: struct context {
87: struct dictionary *userDictionary;
88: struct context *super;
89: char *contextName;
90: struct operandStack *mystack; /* It is not used for now. */
91: };
92:
93: /* for the scanner */
94: typedef enum {INIT,GET,PUT,OPEN} actionType;
95:
96: struct tokens{
97: char *token;
98: int kind;
99: struct object object;
100: };
101:
102: /* used in kind of tokens */
103: #define ID 2
104: #define DOLLAR 3 /* strings enclosed by dollar sign */
105: #define EXECUTABLE_STRING 4 /* strings enclosed by {} */
106: #define EXECUTABLE_ARRAY 8
107:
108:
109:
110: /********** macros to use Sarray **********************/
111: /* put to Object Array */
112: #define putoa(ob,i,cc) {\
113: if ((ob).tag != Sarray) {fprintf(stderr,"Warning: PUTOA is for an array of objects\n");} else \
114: {if ((0 <= (i)) && ((i) < (ob).lc.ival)) {\
115: (ob.rc.op)[i] = cc;\
116: }else{\
117: fprintf(stderr,"Warning: PUTOA, the size is %d.\n",(ob).lc.ival);\
118: }}}
119:
120: #define getoa(ob,i) ((ob.rc.op)[i])
121:
122: #define getoaSize(ob) ((ob).lc.ival)
123:
124: #define isObjectArray(ob) ((ob).tag == Sarray)
125:
126: #define isDollar(ob) ((ob).tag == Sdollar)
127:
128: /******** macros for lists ************/
129: #define isNullList(list) ((struct object *)NULL == list)
130: #define NULLLIST (struct object *)NULL
131:
132: /* for dictionary */
133: #define SET_ATTR_FOR_ALL_WORDS 0x10
134: #define PROTECT 0x1
135: #define ABSOLUTE_PROTECT 0x2
136:
137: typedef enum {CCPUSH,CCPOP,CCRESTORE} actionOfContextControl;
138:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>