1 /* $Id: cg_pattern.h,v 1.5 1994/06/24 10:08:01 ceriel Exp $ */
3 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 * See the copyright notice in the ACK home directory, in the file "Copyright".
6 /* offsets of interesting fields in EM-pattern */
12 #define ILLHASH 0177777
14 /* Escapes in printstrings */
17 #define PR_TOKFLD '\002'
18 #define PR_EMINT '\003'
19 #define PR_EMSTR '\004'
20 #define PR_ALLREG '\005'
21 #define PR_SUBREG '\006'
23 * In case this list gets longer remember to keep out printable nonprintables
24 * like \t \n \r and the like.
27 /* Commands for codegenerator, in low order 5 bits of byte */
34 #define DO_DEALLOCATE 5
35 #define DO_REALLOCATE 6
41 #define DO_TOKREPLACE 12
42 #define DO_EMREPLACE 13
49 typedef struct instance {
56 int in_info[TOKENSIZE+1];
60 int c_size; /* index in enode-table */
61 int c_time; /* dito */
65 int m_set1; /* number of tokenexpr in move: from */
66 int m_expr1; /* optional expression */
67 int m_set2; /* number of tokenexpr in move: to */
68 int m_expr2; /* optional expression */
69 int m_cindex; /* code index to really do it */
70 cost_t m_cost; /* associated cost */
75 short set_val[SETSIZE];
83 typedef struct exprnode node_t;
84 typedef struct exprnode *node_p;
86 typedef struct { /* to stack coercions */
87 int c1_texpno; /* token expression number */
88 int c1_expr; /* boolean expression */
89 int c1_prop; /* property of register needed */
90 int c1_codep; /* code index */
91 cost_t c1_cost; /* cost involved */
95 typedef struct { /* splitting coercions */
96 int c2_texpno; /* token expression number */
97 int c2_nsplit; /* split factor */
98 int c2_repl[MAXSPLIT]; /* replacement instances */
99 int c2_codep; /* code index */
101 #endif /* MAXSPLIT */
103 typedef struct { /* one to one coercions */
104 int c3_texpno; /* token expression number */
105 int c3_prop; /* property of register needed */
106 int c3_repl; /* replacement instance */
107 int c3_codep; /* code index */
111 * contents of .ex_operator
114 #define EX_TOKFIELD 0
118 #define EX_SAMESIGN 4
146 #define EX_DEFINED 32
148 #define EX_TOSTRING 34
158 #define getint(a,b) \
159 if ((a=((*(b)++)&BMASK)) >= 128) {\
160 a = ((a-128)<<BSHIFT) | (*(b)++&BMASK); \