2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
5 /* $Id: cgg_cg.h,v 1.11 1994/06/24 10:08:04 ceriel Exp $ */
7 /* offsets of interesting fields in EM-pattern */
13 #define ILLHASH 0177777
16 /* Commands for codegenerator, in low order 5 bits of byte */
23 #define DO_DEALLOCATE 5
24 #define DO_REALLOCATE 6
28 #define DO_TOKREPLACE 12
29 #define DO_EMREPLACE 13
44 #define MAXATT TOKENSIZE
47 typedef struct instance {
56 short in_info[MAXATT+1];
61 short set_val[SETSIZE];
65 short m_set1; /* number of tokenexpr in move: from */
66 short m_expr1; /* optional expression */
67 short m_set2; /* number of tokenexpr in move: to */
68 short m_expr2; /* optional expression */
69 short m_cindex; /* code index to really do it */
73 short t_set; /* number of tokenexpr in test */
74 short t_expr; /* optional expression */
75 short t_cindex; /* code index to really do it */
83 typedef struct exprnode node_t;
84 typedef struct exprnode *node_p;
87 * contents of .ex_operator
121 #define EX_DEFINED 32
123 #define EX_TOSTRING 34
134 #define EX_TOPELTSIZE 45
135 #define EX_FALLTHROUGH 46
138 typedef struct { /* to stack coercions */
139 short c1_texpno; /* token expression number */
140 short c1_expr; /* boolean expression */
141 short c1_prop; /* property of register needed */
142 short c1_codep; /* code index */
146 typedef struct { /* splitting coercions */
147 short c2_texpno; /* token expression number */
148 short c2_expr; /* optional boolean expression */
149 short c2_nsplit; /* split factor */
150 short c2_repl[MAXSPLIT];/* replacement instances */
151 short c2_codep; /* code index */
153 #endif /* MAXSPLIT */
155 typedef struct { /* one to one coercions */
156 short c3_texpno; /* token expression number */
157 short c3_expr; /* boolean expression */
158 short c3_prop; /* property of register needed */
159 short c3_repl; /* replacement instance */
160 short c3_codep; /* code index */
164 #define getint(a,b) \
165 if ((a=((*(b)++)&BMASK)) >= 128) {\
166 a = ((a-128)<<BSHIFT) | (*(b)++&BMASK); \