xref: /titanic_41/usr/src/cmd/geniconvtbl/itm_comp.y (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate %{
2*7c478bd9Sstevel@tonic-gate /*
3*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
4*7c478bd9Sstevel@tonic-gate  *
5*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
6*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
7*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
8*7c478bd9Sstevel@tonic-gate  * with the License.
9*7c478bd9Sstevel@tonic-gate  *
10*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
12*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
13*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
14*7c478bd9Sstevel@tonic-gate  *
15*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
16*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
18*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
19*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
20*7c478bd9Sstevel@tonic-gate  *
21*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
22*7c478bd9Sstevel@tonic-gate  *
23*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1999 by Sun Microsystems, Inc.
24*7c478bd9Sstevel@tonic-gate  * All rights reserved.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
28*7c478bd9Sstevel@tonic-gate 
29*7c478bd9Sstevel@tonic-gate #include <stdio.h>
30*7c478bd9Sstevel@tonic-gate #include <stdlib.h>
31*7c478bd9Sstevel@tonic-gate #include <ctype.h>
32*7c478bd9Sstevel@tonic-gate #include <libintl.h>
33*7c478bd9Sstevel@tonic-gate #include <errno.h>
34*7c478bd9Sstevel@tonic-gate 
35*7c478bd9Sstevel@tonic-gate #include "iconv_tm.h"
36*7c478bd9Sstevel@tonic-gate #include "itmcomp.h"
37*7c478bd9Sstevel@tonic-gate #include "itm_util.h"
38*7c478bd9Sstevel@tonic-gate 
39*7c478bd9Sstevel@tonic-gate %}
40*7c478bd9Sstevel@tonic-gate 
41*7c478bd9Sstevel@tonic-gate %start itm_def
42*7c478bd9Sstevel@tonic-gate 
43*7c478bd9Sstevel@tonic-gate %union		yystacktype
44*7c478bd9Sstevel@tonic-gate {
45*7c478bd9Sstevel@tonic-gate 	int		intval;
46*7c478bd9Sstevel@tonic-gate 
47*7c478bd9Sstevel@tonic-gate 	itm_num_t	num;
48*7c478bd9Sstevel@tonic-gate 	itm_data_t	*name;
49*7c478bd9Sstevel@tonic-gate 	itm_data_t	*data;
50*7c478bd9Sstevel@tonic-gate 
51*7c478bd9Sstevel@tonic-gate 	itm_tbl_hdr_t	*tbl_hdr;
52*7c478bd9Sstevel@tonic-gate 	itm_direc_t	*direc_unit;
53*7c478bd9Sstevel@tonic-gate 	itm_expr_t	*expr;
54*7c478bd9Sstevel@tonic-gate 
55*7c478bd9Sstevel@tonic-gate 	itmc_action_t	action;
56*7c478bd9Sstevel@tonic-gate 	itmc_obj_t	*obj;
57*7c478bd9Sstevel@tonic-gate 	itmc_map_t	*map_list;
58*7c478bd9Sstevel@tonic-gate 	itmc_ref_t	*itmc_ref;
59*7c478bd9Sstevel@tonic-gate 	itmc_map_attr_t	*map_attr;
60*7c478bd9Sstevel@tonic-gate }
61*7c478bd9Sstevel@tonic-gate 
62*7c478bd9Sstevel@tonic-gate %type <intval>		itm_def
63*7c478bd9Sstevel@tonic-gate %type <obj>		def_element_list
64*7c478bd9Sstevel@tonic-gate %type <tbl_hdr>		def_element
65*7c478bd9Sstevel@tonic-gate 
66*7c478bd9Sstevel@tonic-gate %type <tbl_hdr>		direction
67*7c478bd9Sstevel@tonic-gate %type <obj>		direction_unit_list
68*7c478bd9Sstevel@tonic-gate %type <obj>		direction_unit
69*7c478bd9Sstevel@tonic-gate 
70*7c478bd9Sstevel@tonic-gate %type <action>		action
71*7c478bd9Sstevel@tonic-gate 
72*7c478bd9Sstevel@tonic-gate %type <itmc_ref>	condition
73*7c478bd9Sstevel@tonic-gate %type <obj>		condition_list
74*7c478bd9Sstevel@tonic-gate %type <obj>		condition_expr
75*7c478bd9Sstevel@tonic-gate 
76*7c478bd9Sstevel@tonic-gate %type <obj>		range_list
77*7c478bd9Sstevel@tonic-gate %type <obj>		range_pair
78*7c478bd9Sstevel@tonic-gate 
79*7c478bd9Sstevel@tonic-gate %type <obj>		escseq_list
80*7c478bd9Sstevel@tonic-gate %type <obj>		escseq
81*7c478bd9Sstevel@tonic-gate 
82*7c478bd9Sstevel@tonic-gate %type <tbl_hdr>		map
83*7c478bd9Sstevel@tonic-gate %type <map_list>	map_list
84*7c478bd9Sstevel@tonic-gate %type <map_list>	map_pair
85*7c478bd9Sstevel@tonic-gate %type <map_attr>	map_attribute
86*7c478bd9Sstevel@tonic-gate %type <intval>		map_resultlen
87*7c478bd9Sstevel@tonic-gate %type <map_attr>	map_type
88*7c478bd9Sstevel@tonic-gate %type <name>		map_type_names
89*7c478bd9Sstevel@tonic-gate 
90*7c478bd9Sstevel@tonic-gate %type <tbl_hdr>		operation
91*7c478bd9Sstevel@tonic-gate %type <obj>		op_list
92*7c478bd9Sstevel@tonic-gate %type <obj>		op_unit
93*7c478bd9Sstevel@tonic-gate %type <obj>		op_if_else
94*7c478bd9Sstevel@tonic-gate 
95*7c478bd9Sstevel@tonic-gate %type <data>		name
96*7c478bd9Sstevel@tonic-gate 
97*7c478bd9Sstevel@tonic-gate %type <expr>		expr
98*7c478bd9Sstevel@tonic-gate %type <expr>		itm_in
99*7c478bd9Sstevel@tonic-gate 
100*7c478bd9Sstevel@tonic-gate %token	<name> ITMNAME
101*7c478bd9Sstevel@tonic-gate %token	<name> NAME
102*7c478bd9Sstevel@tonic-gate %token	<name> MAPTYPE_NAME
103*7c478bd9Sstevel@tonic-gate %token	<data> HEXADECIMAL
104*7c478bd9Sstevel@tonic-gate %token	<num>  DECIMAL
105*7c478bd9Sstevel@tonic-gate 
106*7c478bd9Sstevel@tonic-gate %token ITM_DEFAULT
107*7c478bd9Sstevel@tonic-gate %token ITM_IDENTICAL
108*7c478bd9Sstevel@tonic-gate 
109*7c478bd9Sstevel@tonic-gate %token BETWEEN
110*7c478bd9Sstevel@tonic-gate %token BREAK
111*7c478bd9Sstevel@tonic-gate %token CONDITION
112*7c478bd9Sstevel@tonic-gate %token DIRECTION
113*7c478bd9Sstevel@tonic-gate %token DISCARD
114*7c478bd9Sstevel@tonic-gate %token ERROR
115*7c478bd9Sstevel@tonic-gate %token ITM_ELSE
116*7c478bd9Sstevel@tonic-gate %token ITM_INIT
117*7c478bd9Sstevel@tonic-gate %token ITM_FALSE
118*7c478bd9Sstevel@tonic-gate %token ITM_IF
119*7c478bd9Sstevel@tonic-gate %token ITM_IN
120*7c478bd9Sstevel@tonic-gate %token ITM_INSIZE
121*7c478bd9Sstevel@tonic-gate %token NOP
122*7c478bd9Sstevel@tonic-gate %token OPERATION
123*7c478bd9Sstevel@tonic-gate %token ITM_OUT
124*7c478bd9Sstevel@tonic-gate %token ITM_OUTSIZE
125*7c478bd9Sstevel@tonic-gate %token PRINTCHR
126*7c478bd9Sstevel@tonic-gate %token PRINTHD
127*7c478bd9Sstevel@tonic-gate %token PRINTINT
128*7c478bd9Sstevel@tonic-gate %token MAP
129*7c478bd9Sstevel@tonic-gate %token RESET
130*7c478bd9Sstevel@tonic-gate %token RETURN
131*7c478bd9Sstevel@tonic-gate %token ITM_TRUE
132*7c478bd9Sstevel@tonic-gate %token ESCAPESEQ
133*7c478bd9Sstevel@tonic-gate %token MAPTYPE
134*7c478bd9Sstevel@tonic-gate %token RESULTLEN
135*7c478bd9Sstevel@tonic-gate 
136*7c478bd9Sstevel@tonic-gate 
137*7c478bd9Sstevel@tonic-gate %token MAPTYPE_AUTO
138*7c478bd9Sstevel@tonic-gate %token MAPTYPE_INDEX
139*7c478bd9Sstevel@tonic-gate %token MAPTYPE_DENSE
140*7c478bd9Sstevel@tonic-gate %token MAPTYPE_HASH
141*7c478bd9Sstevel@tonic-gate %token MAPTYPE_BINARY
142*7c478bd9Sstevel@tonic-gate 
143*7c478bd9Sstevel@tonic-gate %token ELLIPSES
144*7c478bd9Sstevel@tonic-gate %token CBO CBC
145*7c478bd9Sstevel@tonic-gate %token SBO SBC
146*7c478bd9Sstevel@tonic-gate %token PO PC
147*7c478bd9Sstevel@tonic-gate %token SC
148*7c478bd9Sstevel@tonic-gate %token COMMA
149*7c478bd9Sstevel@tonic-gate %token COLON
150*7c478bd9Sstevel@tonic-gate 
151*7c478bd9Sstevel@tonic-gate %right ASSIGN
152*7c478bd9Sstevel@tonic-gate %left LOR
153*7c478bd9Sstevel@tonic-gate %left LAND
154*7c478bd9Sstevel@tonic-gate %left OR
155*7c478bd9Sstevel@tonic-gate %left XOR
156*7c478bd9Sstevel@tonic-gate %left AND
157*7c478bd9Sstevel@tonic-gate %left EQ NE
158*7c478bd9Sstevel@tonic-gate %left LT LE GT GE
159*7c478bd9Sstevel@tonic-gate %left SHL SHR
160*7c478bd9Sstevel@tonic-gate %left PLUS MINUS
161*7c478bd9Sstevel@tonic-gate %left MUL DIV MOD
162*7c478bd9Sstevel@tonic-gate %right NOT NEG UMINUS
163*7c478bd9Sstevel@tonic-gate 
164*7c478bd9Sstevel@tonic-gate %%
165*7c478bd9Sstevel@tonic-gate 
166*7c478bd9Sstevel@tonic-gate itm_def
167*7c478bd9Sstevel@tonic-gate 	: ITMNAME CBO def_element_list CBC
168*7c478bd9Sstevel@tonic-gate 	{
169*7c478bd9Sstevel@tonic-gate 		itm_def_process($1);
170*7c478bd9Sstevel@tonic-gate 	}
171*7c478bd9Sstevel@tonic-gate 	;
172*7c478bd9Sstevel@tonic-gate 
173*7c478bd9Sstevel@tonic-gate def_element_list
174*7c478bd9Sstevel@tonic-gate 	: def_element SC
175*7c478bd9Sstevel@tonic-gate 	{
176*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("def_element_list: def_element ;\n"));
177*7c478bd9Sstevel@tonic-gate 		$$ = NULL;
178*7c478bd9Sstevel@tonic-gate 	}
179*7c478bd9Sstevel@tonic-gate 	| def_element_list def_element SC
180*7c478bd9Sstevel@tonic-gate 	{
181*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y',
182*7c478bd9Sstevel@tonic-gate 			("def_element_list: def_element_list def_element ;\n"));
183*7c478bd9Sstevel@tonic-gate 		$$ = NULL;
184*7c478bd9Sstevel@tonic-gate 	}
185*7c478bd9Sstevel@tonic-gate 	;
186*7c478bd9Sstevel@tonic-gate 
187*7c478bd9Sstevel@tonic-gate def_element
188*7c478bd9Sstevel@tonic-gate 	: direction
189*7c478bd9Sstevel@tonic-gate 	{
190*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("def_element: direction\n"));
191*7c478bd9Sstevel@tonic-gate 		(void) obj_register(ITMC_OBJ_DIREC, (itm_data_t *)($1->name.itm_ptr),
192*7c478bd9Sstevel@tonic-gate 			$1, $1->size,
193*7c478bd9Sstevel@tonic-gate 			NULL, OBJ_REG_TAIL);
194*7c478bd9Sstevel@tonic-gate 		$$ = $1;
195*7c478bd9Sstevel@tonic-gate 	}
196*7c478bd9Sstevel@tonic-gate 	| condition
197*7c478bd9Sstevel@tonic-gate 	{
198*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("def_element: condition\n"));
199*7c478bd9Sstevel@tonic-gate 		$$ = (itm_tbl_hdr_t *)($1->referencee);
200*7c478bd9Sstevel@tonic-gate 	}
201*7c478bd9Sstevel@tonic-gate 	| map
202*7c478bd9Sstevel@tonic-gate 	{
203*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("def_element: map\n"));
204*7c478bd9Sstevel@tonic-gate 		if (NULL != $1) {
205*7c478bd9Sstevel@tonic-gate 			(void) obj_register(ITMC_OBJ_MAP,
206*7c478bd9Sstevel@tonic-gate 				(itm_data_t *)($1->name.itm_ptr),
207*7c478bd9Sstevel@tonic-gate 				$1, $1->size,
208*7c478bd9Sstevel@tonic-gate 				NULL, OBJ_REG_TAIL);
209*7c478bd9Sstevel@tonic-gate 	}
210*7c478bd9Sstevel@tonic-gate 		$$ = $1;
211*7c478bd9Sstevel@tonic-gate 	}
212*7c478bd9Sstevel@tonic-gate 	| operation
213*7c478bd9Sstevel@tonic-gate 	{
214*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("def_element: operation\n"));
215*7c478bd9Sstevel@tonic-gate 		(void) obj_register(ITMC_OBJ_OP, (itm_data_t *)($1->name.itm_ptr),
216*7c478bd9Sstevel@tonic-gate 			$1, $1->size,
217*7c478bd9Sstevel@tonic-gate 			NULL, OBJ_REG_TAIL);
218*7c478bd9Sstevel@tonic-gate 		$$ = $1;
219*7c478bd9Sstevel@tonic-gate 	}
220*7c478bd9Sstevel@tonic-gate 	;
221*7c478bd9Sstevel@tonic-gate 
222*7c478bd9Sstevel@tonic-gate direction
223*7c478bd9Sstevel@tonic-gate 	: DIRECTION name CBO direction_unit_list CBC
224*7c478bd9Sstevel@tonic-gate 	{
225*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("direction name (direction_unit_list)\n"));
226*7c478bd9Sstevel@tonic-gate 		$$ = obj_table(ITM_TBL_DIREC, $2,
227*7c478bd9Sstevel@tonic-gate 			$4, sizeof (itm_direc_t));
228*7c478bd9Sstevel@tonic-gate 	}
229*7c478bd9Sstevel@tonic-gate 	| DIRECTION CBO direction_unit_list CBC
230*7c478bd9Sstevel@tonic-gate 	{
231*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("direction name (direction_unit_list)\n"));
232*7c478bd9Sstevel@tonic-gate 		$$ = obj_table(ITM_TBL_DIREC, NULL,
233*7c478bd9Sstevel@tonic-gate 			$3, sizeof (itm_direc_t));
234*7c478bd9Sstevel@tonic-gate 	}
235*7c478bd9Sstevel@tonic-gate 	;
236*7c478bd9Sstevel@tonic-gate 
237*7c478bd9Sstevel@tonic-gate direction_unit_list
238*7c478bd9Sstevel@tonic-gate 	: direction_unit
239*7c478bd9Sstevel@tonic-gate 	{
240*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("direction_unit_list: direction_unit\n"));
241*7c478bd9Sstevel@tonic-gate 		$$ = obj_list_append(NULL, $1);
242*7c478bd9Sstevel@tonic-gate 	}
243*7c478bd9Sstevel@tonic-gate 	| direction_unit_list direction_unit
244*7c478bd9Sstevel@tonic-gate 	{
245*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("direction_unit_list: "
246*7c478bd9Sstevel@tonic-gate 			"direction_unit_list direction_unit\n"));
247*7c478bd9Sstevel@tonic-gate 		$$ = obj_list_append($1, $2);
248*7c478bd9Sstevel@tonic-gate 	}
249*7c478bd9Sstevel@tonic-gate 	;
250*7c478bd9Sstevel@tonic-gate 
251*7c478bd9Sstevel@tonic-gate direction_unit
252*7c478bd9Sstevel@tonic-gate 	: condition action SC
253*7c478bd9Sstevel@tonic-gate 	{
254*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("direction_unit: condition action ;\n"));
255*7c478bd9Sstevel@tonic-gate 		$$ = direction_unit($1, NULL, &($2), NULL);
256*7c478bd9Sstevel@tonic-gate 	}
257*7c478bd9Sstevel@tonic-gate 	| condition name SC
258*7c478bd9Sstevel@tonic-gate 	{
259*7c478bd9Sstevel@tonic-gate 		itm_direc_t	*direc;
260*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("direction_unit: condition NAME ;\n"));
261*7c478bd9Sstevel@tonic-gate 		$$ = direction_unit($1, NULL, NULL, $2);
262*7c478bd9Sstevel@tonic-gate 	}
263*7c478bd9Sstevel@tonic-gate 	| name action SC
264*7c478bd9Sstevel@tonic-gate 	{
265*7c478bd9Sstevel@tonic-gate 		itm_direc_t	*direc;
266*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("direction_unit: NAME action ;\n"));
267*7c478bd9Sstevel@tonic-gate 		$$ = direction_unit(NULL, $1, &($2), NULL);
268*7c478bd9Sstevel@tonic-gate 	}
269*7c478bd9Sstevel@tonic-gate 	| name name SC
270*7c478bd9Sstevel@tonic-gate 	{
271*7c478bd9Sstevel@tonic-gate 		itm_direc_t	*direc;
272*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("direction_unit: NAME NAME ;\n"));
273*7c478bd9Sstevel@tonic-gate 		$$ = direction_unit(NULL, $1, NULL, $2);
274*7c478bd9Sstevel@tonic-gate 	}
275*7c478bd9Sstevel@tonic-gate 	| ITM_TRUE action SC
276*7c478bd9Sstevel@tonic-gate 	{
277*7c478bd9Sstevel@tonic-gate 		itm_direc_t	*direc;
278*7c478bd9Sstevel@tonic-gate 		$$ = direction_unit(NULL, NULL, &($2), NULL);
279*7c478bd9Sstevel@tonic-gate 	}
280*7c478bd9Sstevel@tonic-gate 	| ITM_TRUE name SC
281*7c478bd9Sstevel@tonic-gate 	{
282*7c478bd9Sstevel@tonic-gate 		itm_direc_t	*direc;
283*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("direction_unit: TRUE NAME ;\n"));
284*7c478bd9Sstevel@tonic-gate 		$$ = direction_unit(NULL, NULL, NULL, $2);
285*7c478bd9Sstevel@tonic-gate 	}
286*7c478bd9Sstevel@tonic-gate 	;
287*7c478bd9Sstevel@tonic-gate 
288*7c478bd9Sstevel@tonic-gate action
289*7c478bd9Sstevel@tonic-gate 	: direction
290*7c478bd9Sstevel@tonic-gate 	{
291*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("action: direction\n"));
292*7c478bd9Sstevel@tonic-gate 		$$.type = ITMC_OBJ_DIREC;
293*7c478bd9Sstevel@tonic-gate 		$$.tbl_hdr = $1;
294*7c478bd9Sstevel@tonic-gate 	}
295*7c478bd9Sstevel@tonic-gate 	| map
296*7c478bd9Sstevel@tonic-gate 	{
297*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("action: map\n"));
298*7c478bd9Sstevel@tonic-gate 		$$.type = ITMC_OBJ_MAP;
299*7c478bd9Sstevel@tonic-gate 		$$.tbl_hdr = $1;
300*7c478bd9Sstevel@tonic-gate 	}
301*7c478bd9Sstevel@tonic-gate 	| operation
302*7c478bd9Sstevel@tonic-gate 	{
303*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("action: operation\n"));
304*7c478bd9Sstevel@tonic-gate 		$$.type = ITMC_OBJ_OP;
305*7c478bd9Sstevel@tonic-gate 		$$.tbl_hdr = $1;
306*7c478bd9Sstevel@tonic-gate 	}
307*7c478bd9Sstevel@tonic-gate 	;
308*7c478bd9Sstevel@tonic-gate 
309*7c478bd9Sstevel@tonic-gate condition
310*7c478bd9Sstevel@tonic-gate 	: CONDITION name CBO condition_list CBC
311*7c478bd9Sstevel@tonic-gate 	{
312*7c478bd9Sstevel@tonic-gate 		itm_tbl_hdr_t	*tbl_hdr;
313*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("condition\n"));
314*7c478bd9Sstevel@tonic-gate 		tbl_hdr = obj_table(ITM_TBL_COND, $2,
315*7c478bd9Sstevel@tonic-gate 				    $4, sizeof (itm_cond_t));
316*7c478bd9Sstevel@tonic-gate 		$$ = obj_register(ITMC_OBJ_COND, $2,
317*7c478bd9Sstevel@tonic-gate 				tbl_hdr, tbl_hdr->size,
318*7c478bd9Sstevel@tonic-gate 				NULL, OBJ_REG_TAIL);
319*7c478bd9Sstevel@tonic-gate 	}
320*7c478bd9Sstevel@tonic-gate 	| CONDITION CBO condition_list CBC
321*7c478bd9Sstevel@tonic-gate 	{
322*7c478bd9Sstevel@tonic-gate 		itm_tbl_hdr_t	*tbl_hdr;
323*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("condition\n"));
324*7c478bd9Sstevel@tonic-gate 		tbl_hdr = obj_table(ITM_TBL_COND, NULL,
325*7c478bd9Sstevel@tonic-gate 				    $3, sizeof (itm_cond_t));
326*7c478bd9Sstevel@tonic-gate 		$$ = obj_register(ITMC_OBJ_COND, NULL,
327*7c478bd9Sstevel@tonic-gate 				tbl_hdr, tbl_hdr->size,
328*7c478bd9Sstevel@tonic-gate 				NULL, OBJ_REG_TAIL);
329*7c478bd9Sstevel@tonic-gate 	}
330*7c478bd9Sstevel@tonic-gate 	;
331*7c478bd9Sstevel@tonic-gate 
332*7c478bd9Sstevel@tonic-gate condition_list
333*7c478bd9Sstevel@tonic-gate 	: condition_expr SC
334*7c478bd9Sstevel@tonic-gate 	{
335*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("condition_list: condition_expr;\n"));
336*7c478bd9Sstevel@tonic-gate 		$$ = obj_list_append(NULL, $1);
337*7c478bd9Sstevel@tonic-gate 	}
338*7c478bd9Sstevel@tonic-gate 	| condition_list condition_expr SC
339*7c478bd9Sstevel@tonic-gate 	{
340*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("condition_list: "
341*7c478bd9Sstevel@tonic-gate 			"condition_list condition_expr;\n"));
342*7c478bd9Sstevel@tonic-gate 		$$ = obj_list_append($1, $2);
343*7c478bd9Sstevel@tonic-gate 	}
344*7c478bd9Sstevel@tonic-gate 	;
345*7c478bd9Sstevel@tonic-gate 
346*7c478bd9Sstevel@tonic-gate condition_expr
347*7c478bd9Sstevel@tonic-gate 	: BETWEEN range_list
348*7c478bd9Sstevel@tonic-gate 	{
349*7c478bd9Sstevel@tonic-gate 		itm_tbl_hdr_t	*range;
350*7c478bd9Sstevel@tonic-gate 		itm_cond_t	*cond;
351*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("condition_expr: between\n"));
352*7c478bd9Sstevel@tonic-gate 		range = range_table(NULL, $2);
353*7c478bd9Sstevel@tonic-gate 		if (range == NULL) {
354*7c478bd9Sstevel@tonic-gate 			$$ = NULL;
355*7c478bd9Sstevel@tonic-gate 		} else {
356*7c478bd9Sstevel@tonic-gate 			$$ = malloc_vital(sizeof (itmc_obj_t));
357*7c478bd9Sstevel@tonic-gate 			$$->type = ITMC_OBJ_RANGE;
358*7c478bd9Sstevel@tonic-gate 			$$->name = NULL;
359*7c478bd9Sstevel@tonic-gate 			cond = malloc_vital(sizeof (itm_cond_t));
360*7c478bd9Sstevel@tonic-gate 			$$->obj = cond;
361*7c478bd9Sstevel@tonic-gate 			cond->type = ITM_COND_BETWEEN;
362*7c478bd9Sstevel@tonic-gate 			cond->operand.place.itm_ptr = (itm_place2_t)range;
363*7c478bd9Sstevel@tonic-gate 			$$->ref[0] = obj_register(ITMC_OBJ_RANGE, NULL,
364*7c478bd9Sstevel@tonic-gate 					range, range->size,
365*7c478bd9Sstevel@tonic-gate 					&(cond->operand.place),
366*7c478bd9Sstevel@tonic-gate 					OBJ_REG_TAIL);
367*7c478bd9Sstevel@tonic-gate 			$$->ref[1] = NULL;
368*7c478bd9Sstevel@tonic-gate 			$$->ref[2] = NULL;
369*7c478bd9Sstevel@tonic-gate 			$$->next = $$->last = NULL;
370*7c478bd9Sstevel@tonic-gate 		}
371*7c478bd9Sstevel@tonic-gate 	}
372*7c478bd9Sstevel@tonic-gate 	| expr
373*7c478bd9Sstevel@tonic-gate 	{
374*7c478bd9Sstevel@tonic-gate 		itm_cond_t	*cond;
375*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("condition_expr: expr\n"));
376*7c478bd9Sstevel@tonic-gate 		$$ = malloc_vital(sizeof (itmc_obj_t));
377*7c478bd9Sstevel@tonic-gate 		$$->type = ITMC_OBJ_EXPR;
378*7c478bd9Sstevel@tonic-gate 		$$->name = NULL;
379*7c478bd9Sstevel@tonic-gate 		cond = malloc_vital(sizeof (itm_cond_t));
380*7c478bd9Sstevel@tonic-gate 		$$->obj = cond;
381*7c478bd9Sstevel@tonic-gate 		cond->type = ITM_COND_EXPR;
382*7c478bd9Sstevel@tonic-gate 		cond->operand.place.itm_ptr = (itm_place2_t)($1);
383*7c478bd9Sstevel@tonic-gate 		$$->ref[0] = obj_register(ITMC_OBJ_EXPR, NULL,
384*7c478bd9Sstevel@tonic-gate 					$1, sizeof (itm_expr_t),
385*7c478bd9Sstevel@tonic-gate 					&(cond->operand.place),
386*7c478bd9Sstevel@tonic-gate 					OBJ_REG_TAIL);
387*7c478bd9Sstevel@tonic-gate 		$$->ref[1] = NULL;
388*7c478bd9Sstevel@tonic-gate 		$$->ref[2] = NULL;
389*7c478bd9Sstevel@tonic-gate 		$$->next = $$->last = NULL;
390*7c478bd9Sstevel@tonic-gate 	}
391*7c478bd9Sstevel@tonic-gate 	| ESCAPESEQ escseq_list
392*7c478bd9Sstevel@tonic-gate 	{
393*7c478bd9Sstevel@tonic-gate 		itm_tbl_hdr_t	*escseq;
394*7c478bd9Sstevel@tonic-gate 		itm_cond_t	*cond;
395*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("condition_expr:  escseq {escseq_list;}\n"));
396*7c478bd9Sstevel@tonic-gate 		escseq = escseq_table(NULL, $2);
397*7c478bd9Sstevel@tonic-gate 		if (escseq == NULL) {
398*7c478bd9Sstevel@tonic-gate 			$$ = NULL;
399*7c478bd9Sstevel@tonic-gate 		} else {
400*7c478bd9Sstevel@tonic-gate 			$$ = malloc_vital(sizeof (itmc_obj_t));
401*7c478bd9Sstevel@tonic-gate 			$$->type = ITMC_OBJ_ESCAPESEQ;
402*7c478bd9Sstevel@tonic-gate 			$$->name = NULL;
403*7c478bd9Sstevel@tonic-gate 			cond = malloc_vital(sizeof (itm_cond_t));
404*7c478bd9Sstevel@tonic-gate 			$$->obj = cond;
405*7c478bd9Sstevel@tonic-gate 			cond->type = ITM_COND_ESCAPESEQ;
406*7c478bd9Sstevel@tonic-gate 			cond->operand.place.itm_ptr = (itm_place2_t)escseq;
407*7c478bd9Sstevel@tonic-gate 			$$->ref[0] = obj_register(ITMC_OBJ_ESCAPESEQ, NULL,
408*7c478bd9Sstevel@tonic-gate 					escseq, escseq->size,
409*7c478bd9Sstevel@tonic-gate 					&(cond->operand.place),
410*7c478bd9Sstevel@tonic-gate 					OBJ_REG_TAIL);
411*7c478bd9Sstevel@tonic-gate 			$$->ref[1] = NULL;
412*7c478bd9Sstevel@tonic-gate 			$$->ref[2] = NULL;
413*7c478bd9Sstevel@tonic-gate 			$$->next = $$->last = NULL;
414*7c478bd9Sstevel@tonic-gate 		}
415*7c478bd9Sstevel@tonic-gate 	}
416*7c478bd9Sstevel@tonic-gate 	;
417*7c478bd9Sstevel@tonic-gate 
418*7c478bd9Sstevel@tonic-gate range_list
419*7c478bd9Sstevel@tonic-gate 	: range_pair
420*7c478bd9Sstevel@tonic-gate 	{
421*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("range_list: range_pair\n"));
422*7c478bd9Sstevel@tonic-gate 		$$ = obj_list_append(NULL, $1);
423*7c478bd9Sstevel@tonic-gate 	}
424*7c478bd9Sstevel@tonic-gate 	| range_list COMMA range_pair
425*7c478bd9Sstevel@tonic-gate 	{
426*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("range_list: range_list, range_pair\n"));
427*7c478bd9Sstevel@tonic-gate 		$$ = obj_list_append($1, $3);
428*7c478bd9Sstevel@tonic-gate 	}
429*7c478bd9Sstevel@tonic-gate 	;
430*7c478bd9Sstevel@tonic-gate 
431*7c478bd9Sstevel@tonic-gate range_pair
432*7c478bd9Sstevel@tonic-gate 	: HEXADECIMAL ELLIPSES HEXADECIMAL
433*7c478bd9Sstevel@tonic-gate 	{
434*7c478bd9Sstevel@tonic-gate 		itmc_data_pair_t	*range;
435*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("range_pair: HEXADECIMAL...HEXADECIMAL\n"));
436*7c478bd9Sstevel@tonic-gate 		$$ = malloc_vital(sizeof (itmc_obj_t));
437*7c478bd9Sstevel@tonic-gate 		$$->type = ITMC_OBJ_RANGE;
438*7c478bd9Sstevel@tonic-gate 		$$->name = NULL;
439*7c478bd9Sstevel@tonic-gate 		range = malloc_vital(sizeof (itmc_data_pair_t));
440*7c478bd9Sstevel@tonic-gate 		$$->obj = range;
441*7c478bd9Sstevel@tonic-gate 		if (data_compare($1, $3) < 0) {
442*7c478bd9Sstevel@tonic-gate 			range->data0 = *($1);
443*7c478bd9Sstevel@tonic-gate 			range->data1 = *($3);
444*7c478bd9Sstevel@tonic-gate 		} else {
445*7c478bd9Sstevel@tonic-gate 			range->data0 = *($3);
446*7c478bd9Sstevel@tonic-gate 			range->data1 = *($1);
447*7c478bd9Sstevel@tonic-gate 		}
448*7c478bd9Sstevel@tonic-gate 	}
449*7c478bd9Sstevel@tonic-gate 	;
450*7c478bd9Sstevel@tonic-gate escseq_list
451*7c478bd9Sstevel@tonic-gate 	: escseq
452*7c478bd9Sstevel@tonic-gate 	{
453*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("escseq_list: escseq\n"));
454*7c478bd9Sstevel@tonic-gate 		$$ = obj_list_append(NULL, $1);
455*7c478bd9Sstevel@tonic-gate 	}
456*7c478bd9Sstevel@tonic-gate 	| escseq_list COMMA escseq
457*7c478bd9Sstevel@tonic-gate 	{
458*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("escseq_list: escseq_list; escseq\n"));
459*7c478bd9Sstevel@tonic-gate 		$$ = obj_list_append($1, $3);
460*7c478bd9Sstevel@tonic-gate 	}
461*7c478bd9Sstevel@tonic-gate 	;
462*7c478bd9Sstevel@tonic-gate 
463*7c478bd9Sstevel@tonic-gate escseq
464*7c478bd9Sstevel@tonic-gate 	: HEXADECIMAL
465*7c478bd9Sstevel@tonic-gate 	{
466*7c478bd9Sstevel@tonic-gate 		itm_data_t	*escseq;
467*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("escseq: HEXADECIMAL\n"));
468*7c478bd9Sstevel@tonic-gate 		$$ = malloc_vital(sizeof (itmc_obj_t));
469*7c478bd9Sstevel@tonic-gate 		$$->type = ITMC_OBJ_ESCAPESEQ;
470*7c478bd9Sstevel@tonic-gate 		$$->name = NULL;
471*7c478bd9Sstevel@tonic-gate 		escseq = malloc_vital(sizeof (itm_data_t));
472*7c478bd9Sstevel@tonic-gate 		$$->obj = escseq;
473*7c478bd9Sstevel@tonic-gate 		*escseq = *($1);
474*7c478bd9Sstevel@tonic-gate 	}
475*7c478bd9Sstevel@tonic-gate 	;
476*7c478bd9Sstevel@tonic-gate 
477*7c478bd9Sstevel@tonic-gate map	: MAP name CBO map_list CBC
478*7c478bd9Sstevel@tonic-gate 	{
479*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map: map name {map_list}\n"));
480*7c478bd9Sstevel@tonic-gate 		$$ = map_table($2, $4, NULL);
481*7c478bd9Sstevel@tonic-gate 	}
482*7c478bd9Sstevel@tonic-gate 	| MAP CBO map_list CBC
483*7c478bd9Sstevel@tonic-gate 	{
484*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map: map {map_list}\n"));
485*7c478bd9Sstevel@tonic-gate 		$$ = map_table(NULL, $3, NULL);
486*7c478bd9Sstevel@tonic-gate 	}
487*7c478bd9Sstevel@tonic-gate 	| MAP name map_attribute CBO map_list CBC
488*7c478bd9Sstevel@tonic-gate 	{
489*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map: map name attribute {map_list}\n"));
490*7c478bd9Sstevel@tonic-gate 		$$ = map_table($2, $5, $3);
491*7c478bd9Sstevel@tonic-gate 	}
492*7c478bd9Sstevel@tonic-gate 	| MAP map_attribute CBO map_list CBC
493*7c478bd9Sstevel@tonic-gate 	{
494*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map: map attribute {map_list}\n"));
495*7c478bd9Sstevel@tonic-gate 		$$ = map_table(NULL, $4, $2);
496*7c478bd9Sstevel@tonic-gate 	}
497*7c478bd9Sstevel@tonic-gate 	;
498*7c478bd9Sstevel@tonic-gate 
499*7c478bd9Sstevel@tonic-gate map_attribute
500*7c478bd9Sstevel@tonic-gate 	:map_type COMMA map_resultlen
501*7c478bd9Sstevel@tonic-gate 	{
502*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map_attribute: map_type map_resultlen\n"));
503*7c478bd9Sstevel@tonic-gate 		$$ = $1;
504*7c478bd9Sstevel@tonic-gate 		$$->resultlen = $3;
505*7c478bd9Sstevel@tonic-gate 	}
506*7c478bd9Sstevel@tonic-gate 	|map_type
507*7c478bd9Sstevel@tonic-gate 	{
508*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map_attribute: map_type\n"));
509*7c478bd9Sstevel@tonic-gate 		$$ = $1;
510*7c478bd9Sstevel@tonic-gate 		$$->resultlen = 0;
511*7c478bd9Sstevel@tonic-gate 	}
512*7c478bd9Sstevel@tonic-gate 	|map_resultlen COMMA map_type
513*7c478bd9Sstevel@tonic-gate 	{
514*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map_attribute: map_resultlen map_type\n"));
515*7c478bd9Sstevel@tonic-gate 		$$ = $3;
516*7c478bd9Sstevel@tonic-gate 		$$->resultlen = $1;
517*7c478bd9Sstevel@tonic-gate 	}
518*7c478bd9Sstevel@tonic-gate 	|map_resultlen
519*7c478bd9Sstevel@tonic-gate 	{
520*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map_attribute: map_resultlen\n"));
521*7c478bd9Sstevel@tonic-gate 		$$ = malloc_vital(sizeof (itmc_map_attr_t));
522*7c478bd9Sstevel@tonic-gate 		$$->resultlen = $1;
523*7c478bd9Sstevel@tonic-gate 		$$->type = NULL;
524*7c478bd9Sstevel@tonic-gate 		$$->hash_factor = 0;
525*7c478bd9Sstevel@tonic-gate 	}
526*7c478bd9Sstevel@tonic-gate 	;
527*7c478bd9Sstevel@tonic-gate 
528*7c478bd9Sstevel@tonic-gate map_type
529*7c478bd9Sstevel@tonic-gate 	: MAPTYPE ASSIGN map_type_names COLON DECIMAL
530*7c478bd9Sstevel@tonic-gate 	{
531*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map_type: maptype=type:factor(%d)\n",
532*7c478bd9Sstevel@tonic-gate 			$5));
533*7c478bd9Sstevel@tonic-gate 		$$ = malloc_vital(sizeof (itmc_map_attr_t));
534*7c478bd9Sstevel@tonic-gate 		$$->type = $3;
535*7c478bd9Sstevel@tonic-gate 		$$->hash_factor = $5;
536*7c478bd9Sstevel@tonic-gate 	}
537*7c478bd9Sstevel@tonic-gate 	| MAPTYPE ASSIGN map_type_names
538*7c478bd9Sstevel@tonic-gate 	{
539*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map_type: maptype=type\n"));
540*7c478bd9Sstevel@tonic-gate 		$$ = malloc_vital(sizeof (itmc_map_attr_t));
541*7c478bd9Sstevel@tonic-gate 		$$->type  = $3;
542*7c478bd9Sstevel@tonic-gate 		$$->hash_factor = 0;
543*7c478bd9Sstevel@tonic-gate 	}
544*7c478bd9Sstevel@tonic-gate 	;
545*7c478bd9Sstevel@tonic-gate 
546*7c478bd9Sstevel@tonic-gate map_type_names
547*7c478bd9Sstevel@tonic-gate 	: MAPTYPE_NAME
548*7c478bd9Sstevel@tonic-gate 	{
549*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map_type_names: size=%*s\n",
550*7c478bd9Sstevel@tonic-gate 				yylval.data->size, NSPTR(yylval.data)));
551*7c478bd9Sstevel@tonic-gate 		$$ = yylval.data;
552*7c478bd9Sstevel@tonic-gate 	}
553*7c478bd9Sstevel@tonic-gate 	;
554*7c478bd9Sstevel@tonic-gate 
555*7c478bd9Sstevel@tonic-gate 
556*7c478bd9Sstevel@tonic-gate map_resultlen
557*7c478bd9Sstevel@tonic-gate 	: RESULTLEN ASSIGN DECIMAL
558*7c478bd9Sstevel@tonic-gate 	{
559*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map_resultlen(%d)\n", $3));
560*7c478bd9Sstevel@tonic-gate 		$$ = $3;
561*7c478bd9Sstevel@tonic-gate 	}
562*7c478bd9Sstevel@tonic-gate 	;
563*7c478bd9Sstevel@tonic-gate 
564*7c478bd9Sstevel@tonic-gate map_list
565*7c478bd9Sstevel@tonic-gate 	: map_pair
566*7c478bd9Sstevel@tonic-gate 	{
567*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map_list: map_pair\n"));
568*7c478bd9Sstevel@tonic-gate 		$$ = map_list_append(NULL, $1);
569*7c478bd9Sstevel@tonic-gate 	}
570*7c478bd9Sstevel@tonic-gate 	| map_list map_pair
571*7c478bd9Sstevel@tonic-gate 	{
572*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map_list: map_list map_pair\n"));
573*7c478bd9Sstevel@tonic-gate 		$$ = map_list_append($1, $2);
574*7c478bd9Sstevel@tonic-gate 	}
575*7c478bd9Sstevel@tonic-gate 	;
576*7c478bd9Sstevel@tonic-gate 
577*7c478bd9Sstevel@tonic-gate map_pair
578*7c478bd9Sstevel@tonic-gate 	: HEXADECIMAL HEXADECIMAL
579*7c478bd9Sstevel@tonic-gate 	{
580*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map_pair: HEXADECIMAL HEXADECIMAL\n"));
581*7c478bd9Sstevel@tonic-gate 		$$ = malloc_vital(sizeof (itmc_map_t));
582*7c478bd9Sstevel@tonic-gate 		$$->data_pair.data0 = *($1);
583*7c478bd9Sstevel@tonic-gate 		free($1);
584*7c478bd9Sstevel@tonic-gate 		$$->data_pair.data1 = *($2);
585*7c478bd9Sstevel@tonic-gate 		free($2);
586*7c478bd9Sstevel@tonic-gate 	}
587*7c478bd9Sstevel@tonic-gate 	| HEXADECIMAL ELLIPSES HEXADECIMAL HEXADECIMAL
588*7c478bd9Sstevel@tonic-gate 	{
589*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map_pair: "
590*7c478bd9Sstevel@tonic-gate 			"HEXADECIMAL ELLIPSES HEXADECIMAL\n"));
591*7c478bd9Sstevel@tonic-gate 		$$ = malloc_vital(sizeof (itmc_map_t));
592*7c478bd9Sstevel@tonic-gate 		$$->data_pair.data0 = *($1);
593*7c478bd9Sstevel@tonic-gate 		$$->data_pair.range = *($3);
594*7c478bd9Sstevel@tonic-gate 		free($1);
595*7c478bd9Sstevel@tonic-gate 		free($3);
596*7c478bd9Sstevel@tonic-gate 		$$->data_pair.data1 = *($4);
597*7c478bd9Sstevel@tonic-gate 		free($4);
598*7c478bd9Sstevel@tonic-gate 	}
599*7c478bd9Sstevel@tonic-gate 	| ITM_DEFAULT  HEXADECIMAL
600*7c478bd9Sstevel@tonic-gate 	{
601*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map_pair: default HEXADECIMAL\n"));
602*7c478bd9Sstevel@tonic-gate 		$$ = malloc_vital(sizeof (itmc_map_t));
603*7c478bd9Sstevel@tonic-gate 		$$->data_pair.data0.size = 0;
604*7c478bd9Sstevel@tonic-gate 		$$->data_pair.data1 = *($2);
605*7c478bd9Sstevel@tonic-gate 		free($2);
606*7c478bd9Sstevel@tonic-gate 	}
607*7c478bd9Sstevel@tonic-gate 	| ITM_DEFAULT  ITM_IDENTICAL
608*7c478bd9Sstevel@tonic-gate 	{
609*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map_pair: default default\n"));
610*7c478bd9Sstevel@tonic-gate 		$$ = malloc_vital(sizeof (itmc_map_t));
611*7c478bd9Sstevel@tonic-gate 		$$->data_pair.data0.size = 0;
612*7c478bd9Sstevel@tonic-gate 		$$->data_pair.data1.size = 0;
613*7c478bd9Sstevel@tonic-gate 	}
614*7c478bd9Sstevel@tonic-gate 	| HEXADECIMAL ERROR /* NO RANGE */
615*7c478bd9Sstevel@tonic-gate 	{
616*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map_pair: hexadecimal error\n"));
617*7c478bd9Sstevel@tonic-gate 		$$ = malloc_vital(sizeof (itmc_map_t));
618*7c478bd9Sstevel@tonic-gate 		$$->data_pair.data0 = *($1);
619*7c478bd9Sstevel@tonic-gate 		free($1);
620*7c478bd9Sstevel@tonic-gate 		$$->data_pair.data1.size = 0;
621*7c478bd9Sstevel@tonic-gate 	}
622*7c478bd9Sstevel@tonic-gate 	;
623*7c478bd9Sstevel@tonic-gate 
624*7c478bd9Sstevel@tonic-gate operation
625*7c478bd9Sstevel@tonic-gate 	: OPERATION name CBO op_list CBC
626*7c478bd9Sstevel@tonic-gate 	{
627*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("operation: operation name {op_list}\n"));
628*7c478bd9Sstevel@tonic-gate 		$$ = obj_table(ITM_TBL_OP, $2,
629*7c478bd9Sstevel@tonic-gate 			$4, sizeof (itm_op_t));
630*7c478bd9Sstevel@tonic-gate 	}
631*7c478bd9Sstevel@tonic-gate 	| OPERATION CBO op_list CBC
632*7c478bd9Sstevel@tonic-gate 	{
633*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("operation: operation {op_list}\n"));
634*7c478bd9Sstevel@tonic-gate 		$$ = obj_table(ITM_TBL_OP, NULL,
635*7c478bd9Sstevel@tonic-gate 				$3, sizeof (itm_op_t));
636*7c478bd9Sstevel@tonic-gate 	}
637*7c478bd9Sstevel@tonic-gate 	| OPERATION ITM_INIT CBO op_list CBC
638*7c478bd9Sstevel@tonic-gate 	{
639*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("operation: operation init {op_list}\n"));
640*7c478bd9Sstevel@tonic-gate 		$$ = obj_table(ITM_TBL_OP_INIT, NULL,
641*7c478bd9Sstevel@tonic-gate 			$4, sizeof (itm_op_t));
642*7c478bd9Sstevel@tonic-gate 	}
643*7c478bd9Sstevel@tonic-gate 	| OPERATION RESET CBO op_list CBC
644*7c478bd9Sstevel@tonic-gate 	{
645*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("operation: operation reset {op_list}\n"));
646*7c478bd9Sstevel@tonic-gate 		$$ = obj_table(ITM_TBL_OP_RESET, NULL,
647*7c478bd9Sstevel@tonic-gate 			$4, sizeof (itm_op_t));
648*7c478bd9Sstevel@tonic-gate 	}
649*7c478bd9Sstevel@tonic-gate 	;
650*7c478bd9Sstevel@tonic-gate 
651*7c478bd9Sstevel@tonic-gate op_list	: op_unit
652*7c478bd9Sstevel@tonic-gate 	{
653*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("op_list: op_unit\n"));
654*7c478bd9Sstevel@tonic-gate 		$$ = obj_list_append(NULL, $1);
655*7c478bd9Sstevel@tonic-gate 	}
656*7c478bd9Sstevel@tonic-gate 	| op_list op_unit
657*7c478bd9Sstevel@tonic-gate 	{
658*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("op_list: op_list op_unit\n"));
659*7c478bd9Sstevel@tonic-gate 		$$ = obj_list_append($1, $2);
660*7c478bd9Sstevel@tonic-gate 	}
661*7c478bd9Sstevel@tonic-gate 	;
662*7c478bd9Sstevel@tonic-gate 
663*7c478bd9Sstevel@tonic-gate op_unit	: /* */ SC
664*7c478bd9Sstevel@tonic-gate 	{
665*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("op_unit: /	*null */;\n"));
666*7c478bd9Sstevel@tonic-gate 		$$ = NULL;
667*7c478bd9Sstevel@tonic-gate 	}
668*7c478bd9Sstevel@tonic-gate 	| expr SC
669*7c478bd9Sstevel@tonic-gate 	{
670*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("op_unit: expr;\n"));
671*7c478bd9Sstevel@tonic-gate 		$$ = op_unary(ITM_OP_EXPR, $1, sizeof (itm_expr_t));
672*7c478bd9Sstevel@tonic-gate 	}
673*7c478bd9Sstevel@tonic-gate 	| ERROR SC
674*7c478bd9Sstevel@tonic-gate 	{
675*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: error;\n"));
676*7c478bd9Sstevel@tonic-gate 		$$ = op_self_num(ITM_OP_ERROR_D, EINVAL);
677*7c478bd9Sstevel@tonic-gate 	}
678*7c478bd9Sstevel@tonic-gate 	| ERROR expr SC
679*7c478bd9Sstevel@tonic-gate 	{
680*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: error;\n"));
681*7c478bd9Sstevel@tonic-gate 		if (ITM_EXPR_INT == $2->type) {
682*7c478bd9Sstevel@tonic-gate 			$$ = op_self_num(ITM_OP_ERROR_D, $2->data.itm_exnum);
683*7c478bd9Sstevel@tonic-gate 		} else {
684*7c478bd9Sstevel@tonic-gate 			$$ = op_unary(ITM_OP_ERROR, $2, sizeof (itm_expr_t));
685*7c478bd9Sstevel@tonic-gate 		}
686*7c478bd9Sstevel@tonic-gate 	}
687*7c478bd9Sstevel@tonic-gate 	| DISCARD SC
688*7c478bd9Sstevel@tonic-gate 	{
689*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("discard expr;\n"));
690*7c478bd9Sstevel@tonic-gate 		$$ = op_self_num(ITM_OP_DISCARD_D, 1);
691*7c478bd9Sstevel@tonic-gate 	}
692*7c478bd9Sstevel@tonic-gate 	| DISCARD expr SC
693*7c478bd9Sstevel@tonic-gate 	{
694*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("discard expr;\n"));
695*7c478bd9Sstevel@tonic-gate 		if (ITM_EXPR_INT == $2->type) {
696*7c478bd9Sstevel@tonic-gate 			$$ = op_self_num(ITM_OP_DISCARD_D, $2->data.itm_exnum);
697*7c478bd9Sstevel@tonic-gate 		} else {
698*7c478bd9Sstevel@tonic-gate 			$$ = op_unary(ITM_OP_DISCARD, $2, sizeof (itm_expr_t));
699*7c478bd9Sstevel@tonic-gate 		}
700*7c478bd9Sstevel@tonic-gate 	}
701*7c478bd9Sstevel@tonic-gate 	| ITM_OUT ASSIGN expr SC
702*7c478bd9Sstevel@tonic-gate 	{
703*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("out = expr;\n"));
704*7c478bd9Sstevel@tonic-gate 		switch ($3->type) {
705*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
706*7c478bd9Sstevel@tonic-gate 			$$ = op_unary(ITM_OP_OUT_D, $3, sizeof (itm_expr_t));
707*7c478bd9Sstevel@tonic-gate 			break;
708*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_SEQ:
709*7c478bd9Sstevel@tonic-gate 			$$ = op_unary(ITM_OP_OUT_S, $3, sizeof (itm_expr_t));
710*7c478bd9Sstevel@tonic-gate 			break;
711*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
712*7c478bd9Sstevel@tonic-gate 			$$ = op_unary(ITM_OP_OUT_R, $3, sizeof (itm_expr_t));
713*7c478bd9Sstevel@tonic-gate 			break;
714*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
715*7c478bd9Sstevel@tonic-gate 			$$ = op_unary(ITM_OP_OUT_INVD, $3, sizeof (itm_expr_t));
716*7c478bd9Sstevel@tonic-gate 			break;
717*7c478bd9Sstevel@tonic-gate 		default:
718*7c478bd9Sstevel@tonic-gate 			$$ = op_unary(ITM_OP_OUT, $3, sizeof (itm_expr_t));
719*7c478bd9Sstevel@tonic-gate 			break;
720*7c478bd9Sstevel@tonic-gate 		}
721*7c478bd9Sstevel@tonic-gate 	}
722*7c478bd9Sstevel@tonic-gate 	| DIRECTION name SC
723*7c478bd9Sstevel@tonic-gate 	{
724*7c478bd9Sstevel@tonic-gate 		itm_op_t	*op;
725*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("direction NAME;\n"));
726*7c478bd9Sstevel@tonic-gate 		$$ = op_unit(ITM_OP_DIRECTION, NULL, 0, NULL, 0, NULL, 0);
727*7c478bd9Sstevel@tonic-gate 		op = (itm_op_t *)($$->obj);
728*7c478bd9Sstevel@tonic-gate 		op->data.operand[0].itm_ptr = (itm_place2_t)($2);
729*7c478bd9Sstevel@tonic-gate 		$$->ref[0] = obj_register(ITMC_OBJ_DIREC, $2,
730*7c478bd9Sstevel@tonic-gate 					NULL, 0,
731*7c478bd9Sstevel@tonic-gate 					&(op->data.operand[0]), OBJ_REG_TAIL);
732*7c478bd9Sstevel@tonic-gate 	}
733*7c478bd9Sstevel@tonic-gate 	| OPERATION name SC
734*7c478bd9Sstevel@tonic-gate 	{
735*7c478bd9Sstevel@tonic-gate 		itm_op_t	*op;
736*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("operation NAME;\n"));
737*7c478bd9Sstevel@tonic-gate 		$$ = op_unit(ITM_OP_OPERATION, NULL, 0, NULL, 0, NULL, 0);
738*7c478bd9Sstevel@tonic-gate 		op = (itm_op_t *)($$->obj);
739*7c478bd9Sstevel@tonic-gate 		op->data.operand[0].itm_ptr = (itm_place2_t)($2);
740*7c478bd9Sstevel@tonic-gate 		$$->ref[0] = obj_register(ITMC_OBJ_OP, $2,
741*7c478bd9Sstevel@tonic-gate 					NULL, 0,
742*7c478bd9Sstevel@tonic-gate 					&(op->data.operand[0]), OBJ_REG_TAIL);
743*7c478bd9Sstevel@tonic-gate 	}
744*7c478bd9Sstevel@tonic-gate 	| OPERATION ITM_INIT SC
745*7c478bd9Sstevel@tonic-gate 	{
746*7c478bd9Sstevel@tonic-gate 		itm_op_t	*op;
747*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("operation init;\n"));
748*7c478bd9Sstevel@tonic-gate 		$$ = op_self(ITM_OP_INIT);
749*7c478bd9Sstevel@tonic-gate 	}
750*7c478bd9Sstevel@tonic-gate 	| OPERATION RESET SC
751*7c478bd9Sstevel@tonic-gate 	{
752*7c478bd9Sstevel@tonic-gate 		itm_op_t	*op;
753*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("operation reset;\n"));
754*7c478bd9Sstevel@tonic-gate 		$$ = op_self(ITM_OP_RESET);
755*7c478bd9Sstevel@tonic-gate 	}
756*7c478bd9Sstevel@tonic-gate 	| MAP name SC
757*7c478bd9Sstevel@tonic-gate 	{
758*7c478bd9Sstevel@tonic-gate 		itm_op_t	*op;
759*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map NAME;\n"));
760*7c478bd9Sstevel@tonic-gate 		$$ = op_unit(ITM_OP_MAP, NULL, 0, NULL, 0, NULL, 0);
761*7c478bd9Sstevel@tonic-gate 		op = (itm_op_t *)($$->obj);
762*7c478bd9Sstevel@tonic-gate 		op->data.operand[0].itm_ptr = (itm_place2_t)($2);
763*7c478bd9Sstevel@tonic-gate 		$$->ref[0] = obj_register(ITMC_OBJ_MAP, $2,
764*7c478bd9Sstevel@tonic-gate 					NULL, 0,
765*7c478bd9Sstevel@tonic-gate 					&(op->data.operand[0]), OBJ_REG_TAIL);
766*7c478bd9Sstevel@tonic-gate 	}
767*7c478bd9Sstevel@tonic-gate 	| MAP name expr SC
768*7c478bd9Sstevel@tonic-gate 	{
769*7c478bd9Sstevel@tonic-gate 		itm_op_t	*op;
770*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("map NAME expr;\n"));
771*7c478bd9Sstevel@tonic-gate 		$$ = op_unit(ITM_OP_MAP, NULL, 0, $3,
772*7c478bd9Sstevel@tonic-gate 			sizeof (itm_expr_t), NULL, 0);
773*7c478bd9Sstevel@tonic-gate 		op = (itm_op_t *)($$->obj);
774*7c478bd9Sstevel@tonic-gate 		op->data.operand[0].itm_ptr = (itm_place2_t)($2);
775*7c478bd9Sstevel@tonic-gate 		$$->ref[0] = obj_register(ITMC_OBJ_MAP, $2,
776*7c478bd9Sstevel@tonic-gate 					NULL, 0,
777*7c478bd9Sstevel@tonic-gate 					&(op->data.operand[0]), OBJ_REG_TAIL);
778*7c478bd9Sstevel@tonic-gate 	}
779*7c478bd9Sstevel@tonic-gate 	| op_if_else
780*7c478bd9Sstevel@tonic-gate 	{
781*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("op_unit: op_if_else\n"));
782*7c478bd9Sstevel@tonic-gate 		$$ = $1;
783*7c478bd9Sstevel@tonic-gate 	}
784*7c478bd9Sstevel@tonic-gate 	| BREAK SC
785*7c478bd9Sstevel@tonic-gate 	{
786*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("break;\n"));
787*7c478bd9Sstevel@tonic-gate 		$$ = op_self(ITM_OP_BREAK);
788*7c478bd9Sstevel@tonic-gate 	}
789*7c478bd9Sstevel@tonic-gate 	| RETURN SC
790*7c478bd9Sstevel@tonic-gate 	{
791*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("return;\n"));
792*7c478bd9Sstevel@tonic-gate 		$$ = op_self(ITM_OP_RETURN);
793*7c478bd9Sstevel@tonic-gate 	}
794*7c478bd9Sstevel@tonic-gate 	| PRINTCHR expr SC
795*7c478bd9Sstevel@tonic-gate 	{
796*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("printchr expr;\n"));
797*7c478bd9Sstevel@tonic-gate 		$$ = op_unary(ITM_OP_PRINTCHR, $2, sizeof (itm_expr_t));
798*7c478bd9Sstevel@tonic-gate 	}
799*7c478bd9Sstevel@tonic-gate 	| PRINTHD expr SC
800*7c478bd9Sstevel@tonic-gate 	{
801*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("printchr expr;\n"));
802*7c478bd9Sstevel@tonic-gate 		$$ = op_unary(ITM_OP_PRINTHD, $2, sizeof (itm_expr_t));
803*7c478bd9Sstevel@tonic-gate 	}
804*7c478bd9Sstevel@tonic-gate 	| PRINTINT expr SC
805*7c478bd9Sstevel@tonic-gate 	{
806*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("printint expr;\n"));
807*7c478bd9Sstevel@tonic-gate 		$$ = op_unary(ITM_OP_PRINTINT, $2, sizeof (itm_expr_t));
808*7c478bd9Sstevel@tonic-gate 	}
809*7c478bd9Sstevel@tonic-gate 	;
810*7c478bd9Sstevel@tonic-gate 
811*7c478bd9Sstevel@tonic-gate op_if_else
812*7c478bd9Sstevel@tonic-gate 	: ITM_IF PO expr PC CBO op_list CBC
813*7c478bd9Sstevel@tonic-gate 	{
814*7c478bd9Sstevel@tonic-gate 		itm_tbl_hdr_t	*tbl_hdr;
815*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("op_if_else: if (expr) {op_list}\n"));
816*7c478bd9Sstevel@tonic-gate 		tbl_hdr = obj_table(ITM_TBL_OP, NULL,
817*7c478bd9Sstevel@tonic-gate 				    $6, sizeof (itm_op_t));
818*7c478bd9Sstevel@tonic-gate 		$$ = op_unit(ITM_OP_IF,
819*7c478bd9Sstevel@tonic-gate 				$3, sizeof (itm_expr_t),
820*7c478bd9Sstevel@tonic-gate 				tbl_hdr, tbl_hdr->size,
821*7c478bd9Sstevel@tonic-gate 				NULL, 0);
822*7c478bd9Sstevel@tonic-gate 	}
823*7c478bd9Sstevel@tonic-gate 	| ITM_IF PO expr PC CBO op_list CBC ITM_ELSE op_if_else
824*7c478bd9Sstevel@tonic-gate 	{
825*7c478bd9Sstevel@tonic-gate 		itm_tbl_hdr_t	*tbl_hdr1;
826*7c478bd9Sstevel@tonic-gate 		itm_tbl_hdr_t	*tbl_hdr2;
827*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("op_if_else: "
828*7c478bd9Sstevel@tonic-gate 			"if (expr) {op_list} else op_if_else\n"));
829*7c478bd9Sstevel@tonic-gate 		tbl_hdr1 = obj_table(ITM_TBL_OP, NULL,
830*7c478bd9Sstevel@tonic-gate 				    $6, sizeof (itm_op_t));
831*7c478bd9Sstevel@tonic-gate 		tbl_hdr2 = obj_table(ITM_TBL_OP, NULL,
832*7c478bd9Sstevel@tonic-gate 				    $9, sizeof (itm_op_t));
833*7c478bd9Sstevel@tonic-gate 		$$ = op_unit(ITM_OP_IF_ELSE,
834*7c478bd9Sstevel@tonic-gate 				$3, sizeof (itm_expr_t),
835*7c478bd9Sstevel@tonic-gate 				tbl_hdr1, tbl_hdr1->size,
836*7c478bd9Sstevel@tonic-gate 				tbl_hdr2, tbl_hdr2->size);
837*7c478bd9Sstevel@tonic-gate 	}
838*7c478bd9Sstevel@tonic-gate 	| ITM_IF PO expr PC CBO op_list CBC ITM_ELSE CBO op_list CBC
839*7c478bd9Sstevel@tonic-gate 	{
840*7c478bd9Sstevel@tonic-gate 		itm_tbl_hdr_t	*tbl_hdr1;
841*7c478bd9Sstevel@tonic-gate 		itm_tbl_hdr_t	*tbl_hdr2;
842*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("op_if_else: "
843*7c478bd9Sstevel@tonic-gate 			"if (expr) {op_list} else {op_list}\n"));
844*7c478bd9Sstevel@tonic-gate 		tbl_hdr1 = obj_table(ITM_TBL_OP, NULL,
845*7c478bd9Sstevel@tonic-gate 				    $6, sizeof (itm_op_t));
846*7c478bd9Sstevel@tonic-gate 		tbl_hdr2 = obj_table(ITM_TBL_OP, NULL,
847*7c478bd9Sstevel@tonic-gate 				    $10, sizeof (itm_op_t));
848*7c478bd9Sstevel@tonic-gate 		$$ = op_unit(ITM_OP_IF_ELSE,
849*7c478bd9Sstevel@tonic-gate 				$3, sizeof (itm_expr_t),
850*7c478bd9Sstevel@tonic-gate 				tbl_hdr1, tbl_hdr1->size,
851*7c478bd9Sstevel@tonic-gate 				tbl_hdr2, tbl_hdr2->size);
852*7c478bd9Sstevel@tonic-gate 	}
853*7c478bd9Sstevel@tonic-gate 	;
854*7c478bd9Sstevel@tonic-gate 
855*7c478bd9Sstevel@tonic-gate name	: NAME
856*7c478bd9Sstevel@tonic-gate 	{
857*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("name: size=%*s\n",
858*7c478bd9Sstevel@tonic-gate 				yylval.data->size, NSPTR(yylval.data)));
859*7c478bd9Sstevel@tonic-gate 		$$ = yylval.data;
860*7c478bd9Sstevel@tonic-gate 	}
861*7c478bd9Sstevel@tonic-gate 	;
862*7c478bd9Sstevel@tonic-gate 
863*7c478bd9Sstevel@tonic-gate itm_in	: ITM_IN
864*7c478bd9Sstevel@tonic-gate 	{
865*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("in\n"));
866*7c478bd9Sstevel@tonic-gate 		$$ = expr_self(ITM_EXPR_IN, NULL);
867*7c478bd9Sstevel@tonic-gate 	}
868*7c478bd9Sstevel@tonic-gate 	;
869*7c478bd9Sstevel@tonic-gate 
870*7c478bd9Sstevel@tonic-gate expr	: PO expr PC
871*7c478bd9Sstevel@tonic-gate 	{
872*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: (expr)\n"));
873*7c478bd9Sstevel@tonic-gate 		$$ = $2;
874*7c478bd9Sstevel@tonic-gate 	}
875*7c478bd9Sstevel@tonic-gate 	| name
876*7c478bd9Sstevel@tonic-gate 	{
877*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: NAME\n"));
878*7c478bd9Sstevel@tonic-gate 		$$ = expr_self(ITM_EXPR_NAME, $1);
879*7c478bd9Sstevel@tonic-gate 	}
880*7c478bd9Sstevel@tonic-gate 	| HEXADECIMAL
881*7c478bd9Sstevel@tonic-gate 	{
882*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: HEXADECIMAL\n"));
883*7c478bd9Sstevel@tonic-gate 		$$ = expr_self(ITM_EXPR_SEQ, yylval.data);
884*7c478bd9Sstevel@tonic-gate 	}
885*7c478bd9Sstevel@tonic-gate 	| DECIMAL
886*7c478bd9Sstevel@tonic-gate 	{
887*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: DECIMAL\n"));
888*7c478bd9Sstevel@tonic-gate 		$$ = expr_self_num(ITM_EXPR_INT, yylval.num);
889*7c478bd9Sstevel@tonic-gate 	}
890*7c478bd9Sstevel@tonic-gate 	| itm_in SBO expr SBC
891*7c478bd9Sstevel@tonic-gate 	{
892*7c478bd9Sstevel@tonic-gate 		if (ITM_EXPR_INT == $3->type) {
893*7c478bd9Sstevel@tonic-gate 			TRACE_MESSAGE('y', ("expr: in[%ld]\n",
894*7c478bd9Sstevel@tonic-gate 				$3->data.itm_exnum));
895*7c478bd9Sstevel@tonic-gate 			$$ = expr_self_num(ITM_EXPR_IN_VECTOR_D,
896*7c478bd9Sstevel@tonic-gate 				$3->data.itm_exnum);
897*7c478bd9Sstevel@tonic-gate 		} else {
898*7c478bd9Sstevel@tonic-gate 			TRACE_MESSAGE('y', ("expr: in[expr]\n"));
899*7c478bd9Sstevel@tonic-gate 			$$ = expr_unary(ITM_EXPR_IN_VECTOR, $3);
900*7c478bd9Sstevel@tonic-gate 		}
901*7c478bd9Sstevel@tonic-gate 	}
902*7c478bd9Sstevel@tonic-gate 	| ITM_OUTSIZE
903*7c478bd9Sstevel@tonic-gate 	{
904*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: outsize\n"));
905*7c478bd9Sstevel@tonic-gate 		$$ = expr_self_num(ITM_EXPR_OUT, 0);
906*7c478bd9Sstevel@tonic-gate 	}
907*7c478bd9Sstevel@tonic-gate 	| ITM_INSIZE
908*7c478bd9Sstevel@tonic-gate 	{
909*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: inputsize\n"));
910*7c478bd9Sstevel@tonic-gate 		$$ = expr_self_num(ITM_EXPR_IN_VECTOR_D, (size_t)-1);
911*7c478bd9Sstevel@tonic-gate 	}
912*7c478bd9Sstevel@tonic-gate 	| ITM_TRUE
913*7c478bd9Sstevel@tonic-gate 	{
914*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: true\n"));
915*7c478bd9Sstevel@tonic-gate 		$$ = expr_self_num(ITM_EXPR_TRUE, 1);
916*7c478bd9Sstevel@tonic-gate 	}
917*7c478bd9Sstevel@tonic-gate 	| ITM_FALSE
918*7c478bd9Sstevel@tonic-gate 	{
919*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: false\n"));
920*7c478bd9Sstevel@tonic-gate 		$$ = expr_self_num(ITM_EXPR_FALSE, 0);
921*7c478bd9Sstevel@tonic-gate 	}
922*7c478bd9Sstevel@tonic-gate 	| itm_in EQ expr
923*7c478bd9Sstevel@tonic-gate 	{
924*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: in == expr\n"));
925*7c478bd9Sstevel@tonic-gate 		$$ = expr_unary(ITM_EXPR_IN_EQ, $3);
926*7c478bd9Sstevel@tonic-gate 	}
927*7c478bd9Sstevel@tonic-gate 	| expr EQ itm_in
928*7c478bd9Sstevel@tonic-gate 	{
929*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr == in\n"));
930*7c478bd9Sstevel@tonic-gate 		$$ = expr_unary(ITM_EXPR_IN_EQ, $1);
931*7c478bd9Sstevel@tonic-gate 	}
932*7c478bd9Sstevel@tonic-gate 	| NOT expr
933*7c478bd9Sstevel@tonic-gate 	{
934*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: ! expr\n"));
935*7c478bd9Sstevel@tonic-gate 
936*7c478bd9Sstevel@tonic-gate 		if (ITM_EXPR_INT == $2->type) {
937*7c478bd9Sstevel@tonic-gate 			$$ = expr_self_num(ITM_EXPR_INT, !($2->data.itm_exnum));
938*7c478bd9Sstevel@tonic-gate 		} else {
939*7c478bd9Sstevel@tonic-gate 			$$ = expr_unary(ITM_EXPR_NOT, $2);
940*7c478bd9Sstevel@tonic-gate 		}
941*7c478bd9Sstevel@tonic-gate 	}
942*7c478bd9Sstevel@tonic-gate 	| NEG expr
943*7c478bd9Sstevel@tonic-gate 	{
944*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: ~ expr\n"));
945*7c478bd9Sstevel@tonic-gate 		if (ITM_EXPR_INT == $2->type) {
946*7c478bd9Sstevel@tonic-gate 			$$ = expr_self_num(ITM_EXPR_INT, ~($2->data.itm_exnum));
947*7c478bd9Sstevel@tonic-gate 		} else {
948*7c478bd9Sstevel@tonic-gate 			$$ = expr_unary(ITM_EXPR_NEG, $2);
949*7c478bd9Sstevel@tonic-gate 		}
950*7c478bd9Sstevel@tonic-gate 	}
951*7c478bd9Sstevel@tonic-gate 	| MINUS expr %prec MUL
952*7c478bd9Sstevel@tonic-gate 	{
953*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: - expr\n"));
954*7c478bd9Sstevel@tonic-gate 		if (ITM_EXPR_INT == $2->type) {
955*7c478bd9Sstevel@tonic-gate 			$$ = expr_self_num(ITM_EXPR_INT,
956*7c478bd9Sstevel@tonic-gate 				(-1) * ($2->data.itm_exnum));
957*7c478bd9Sstevel@tonic-gate 		} else {
958*7c478bd9Sstevel@tonic-gate 			$$ = expr_unary(ITM_EXPR_UMINUS, $2);
959*7c478bd9Sstevel@tonic-gate 		}
960*7c478bd9Sstevel@tonic-gate 	}
961*7c478bd9Sstevel@tonic-gate 	| expr PLUS expr
962*7c478bd9Sstevel@tonic-gate 	{
963*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr + expr\n"));
964*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_PLUS, $1, $3);
965*7c478bd9Sstevel@tonic-gate 		$1 = expr_seq_to_int($1);
966*7c478bd9Sstevel@tonic-gate 		$3 = expr_seq_to_int($3);
967*7c478bd9Sstevel@tonic-gate 		switch ($1->type) {
968*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
969*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
970*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
971*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_PLUS_D_D, $1, $3);
972*7c478bd9Sstevel@tonic-gate 				break;
973*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
974*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_PLUS_D_R, $1, $3);
975*7c478bd9Sstevel@tonic-gate 				break;
976*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
977*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_PLUS_D_INVD, $1, $3);
978*7c478bd9Sstevel@tonic-gate 				break;
979*7c478bd9Sstevel@tonic-gate 			default:
980*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_PLUS_D_E, $1, $3);
981*7c478bd9Sstevel@tonic-gate 				break;
982*7c478bd9Sstevel@tonic-gate 		}
983*7c478bd9Sstevel@tonic-gate 			break;
984*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
985*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
986*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
987*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_PLUS_R_D, $1, $3);
988*7c478bd9Sstevel@tonic-gate 				break;
989*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
990*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_PLUS_R_R, $1, $3);
991*7c478bd9Sstevel@tonic-gate 				break;
992*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
993*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_PLUS_R_INVD, $1, $3);
994*7c478bd9Sstevel@tonic-gate 				break;
995*7c478bd9Sstevel@tonic-gate 			default:
996*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_PLUS_R_E, $1, $3);
997*7c478bd9Sstevel@tonic-gate 				break;
998*7c478bd9Sstevel@tonic-gate 		}
999*7c478bd9Sstevel@tonic-gate 			break;
1000*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
1001*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1002*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1003*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_PLUS_INVD_D, $1, $3);
1004*7c478bd9Sstevel@tonic-gate 				break;
1005*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1006*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_PLUS_INVD_R, $1, $3);
1007*7c478bd9Sstevel@tonic-gate 				break;
1008*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1009*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_PLUS_INVD_INVD,
1010*7c478bd9Sstevel@tonic-gate 					$1, $3);
1011*7c478bd9Sstevel@tonic-gate 				break;
1012*7c478bd9Sstevel@tonic-gate 			default:
1013*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_PLUS_INVD_E, $1, $3);
1014*7c478bd9Sstevel@tonic-gate 				break;
1015*7c478bd9Sstevel@tonic-gate 		}
1016*7c478bd9Sstevel@tonic-gate 			break;
1017*7c478bd9Sstevel@tonic-gate 		default:
1018*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1019*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1020*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_PLUS_E_D, $1, $3);
1021*7c478bd9Sstevel@tonic-gate 				break;
1022*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1023*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_PLUS_E_R, $1, $3);
1024*7c478bd9Sstevel@tonic-gate 				break;
1025*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1026*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_PLUS_E_INVD, $1, $3);
1027*7c478bd9Sstevel@tonic-gate 				break;
1028*7c478bd9Sstevel@tonic-gate 			default:
1029*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_PLUS, $1, $3);
1030*7c478bd9Sstevel@tonic-gate 				break;
1031*7c478bd9Sstevel@tonic-gate 			}
1032*7c478bd9Sstevel@tonic-gate 			break;
1033*7c478bd9Sstevel@tonic-gate 		}
1034*7c478bd9Sstevel@tonic-gate 	}
1035*7c478bd9Sstevel@tonic-gate 	| expr MINUS expr
1036*7c478bd9Sstevel@tonic-gate 	{
1037*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr - expr\n"));
1038*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_MINUS, $1, $3);
1039*7c478bd9Sstevel@tonic-gate 		$1 = expr_seq_to_int($1);
1040*7c478bd9Sstevel@tonic-gate 		$3 = expr_seq_to_int($3);
1041*7c478bd9Sstevel@tonic-gate 		switch ($1->type) {
1042*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
1043*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1044*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1045*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MINUS_D_D, $1, $3);
1046*7c478bd9Sstevel@tonic-gate 				break;
1047*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1048*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MINUS_D_R, $1, $3);
1049*7c478bd9Sstevel@tonic-gate 				break;
1050*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1051*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MINUS_D_INVD,
1052*7c478bd9Sstevel@tonic-gate 					$1, $3);
1053*7c478bd9Sstevel@tonic-gate 				break;
1054*7c478bd9Sstevel@tonic-gate 			default:
1055*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MINUS_D_E, $1, $3);
1056*7c478bd9Sstevel@tonic-gate 				break;
1057*7c478bd9Sstevel@tonic-gate 			}
1058*7c478bd9Sstevel@tonic-gate 			break;
1059*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
1060*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1061*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1062*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MINUS_R_D, $1, $3);
1063*7c478bd9Sstevel@tonic-gate 				break;
1064*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1065*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MINUS_R_R, $1, $3);
1066*7c478bd9Sstevel@tonic-gate 				break;
1067*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1068*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MINUS_R_INVD,
1069*7c478bd9Sstevel@tonic-gate 					$1, $3);
1070*7c478bd9Sstevel@tonic-gate 				break;
1071*7c478bd9Sstevel@tonic-gate 			default:
1072*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MINUS_R_E, $1, $3);
1073*7c478bd9Sstevel@tonic-gate 				break;
1074*7c478bd9Sstevel@tonic-gate 			}
1075*7c478bd9Sstevel@tonic-gate 			break;
1076*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
1077*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1078*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1079*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MINUS_INVD_D,
1080*7c478bd9Sstevel@tonic-gate 					$1, $3);
1081*7c478bd9Sstevel@tonic-gate 				break;
1082*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1083*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MINUS_INVD_R,
1084*7c478bd9Sstevel@tonic-gate 					$1, $3);
1085*7c478bd9Sstevel@tonic-gate 				break;
1086*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1087*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MINUS_INVD_INVD,
1088*7c478bd9Sstevel@tonic-gate 					$1, $3);
1089*7c478bd9Sstevel@tonic-gate 				break;
1090*7c478bd9Sstevel@tonic-gate 			default:
1091*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MINUS_INVD_E,
1092*7c478bd9Sstevel@tonic-gate 					$1, $3);
1093*7c478bd9Sstevel@tonic-gate 				break;
1094*7c478bd9Sstevel@tonic-gate 			}
1095*7c478bd9Sstevel@tonic-gate 			break;
1096*7c478bd9Sstevel@tonic-gate 		default:
1097*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1098*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1099*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MINUS_E_D, $1, $3);
1100*7c478bd9Sstevel@tonic-gate 				break;
1101*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1102*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MINUS_E_R, $1, $3);
1103*7c478bd9Sstevel@tonic-gate 				break;
1104*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1105*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MINUS_E_INVD,
1106*7c478bd9Sstevel@tonic-gate 					$1, $3);
1107*7c478bd9Sstevel@tonic-gate 				break;
1108*7c478bd9Sstevel@tonic-gate 			default:
1109*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MINUS, $1, $3);
1110*7c478bd9Sstevel@tonic-gate 				break;
1111*7c478bd9Sstevel@tonic-gate 			}
1112*7c478bd9Sstevel@tonic-gate 			break;
1113*7c478bd9Sstevel@tonic-gate 		}
1114*7c478bd9Sstevel@tonic-gate 	}
1115*7c478bd9Sstevel@tonic-gate 	| expr MUL expr
1116*7c478bd9Sstevel@tonic-gate 	{
1117*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr		*expr\n"));
1118*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_MUL, $1, $3);
1119*7c478bd9Sstevel@tonic-gate 		$1 = expr_seq_to_int($1);
1120*7c478bd9Sstevel@tonic-gate 		$3 = expr_seq_to_int($3);
1121*7c478bd9Sstevel@tonic-gate 		switch ($1->type) {
1122*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
1123*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1124*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1125*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MUL_D_D, $1, $3);
1126*7c478bd9Sstevel@tonic-gate 				break;
1127*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1128*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MUL_D_R, $1, $3);
1129*7c478bd9Sstevel@tonic-gate 				break;
1130*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1131*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MUL_D_INVD, $1, $3);
1132*7c478bd9Sstevel@tonic-gate 				break;
1133*7c478bd9Sstevel@tonic-gate 			default:
1134*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MUL_D_E, $1, $3);
1135*7c478bd9Sstevel@tonic-gate 				break;
1136*7c478bd9Sstevel@tonic-gate 			}
1137*7c478bd9Sstevel@tonic-gate 			break;
1138*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
1139*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1140*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1141*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MUL_R_D, $1, $3);
1142*7c478bd9Sstevel@tonic-gate 				break;
1143*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1144*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MUL_R_R, $1, $3);
1145*7c478bd9Sstevel@tonic-gate 				break;
1146*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1147*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MUL_R_INVD, $1, $3);
1148*7c478bd9Sstevel@tonic-gate 				break;
1149*7c478bd9Sstevel@tonic-gate 			default:
1150*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MUL_R_E, $1, $3);
1151*7c478bd9Sstevel@tonic-gate 				break;
1152*7c478bd9Sstevel@tonic-gate 			}
1153*7c478bd9Sstevel@tonic-gate 			break;
1154*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
1155*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1156*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1157*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MUL_INVD_D, $1, $3);
1158*7c478bd9Sstevel@tonic-gate 				break;
1159*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1160*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MUL_INVD_R, $1, $3);
1161*7c478bd9Sstevel@tonic-gate 				break;
1162*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1163*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MUL_INVD_INVD,
1164*7c478bd9Sstevel@tonic-gate 					$1, $3);
1165*7c478bd9Sstevel@tonic-gate 				break;
1166*7c478bd9Sstevel@tonic-gate 			default:
1167*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MUL_INVD_E, $1, $3);
1168*7c478bd9Sstevel@tonic-gate 				break;
1169*7c478bd9Sstevel@tonic-gate 			}
1170*7c478bd9Sstevel@tonic-gate 			break;
1171*7c478bd9Sstevel@tonic-gate 		default:
1172*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1173*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1174*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MUL_E_D, $1, $3);
1175*7c478bd9Sstevel@tonic-gate 				break;
1176*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1177*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MUL_E_R, $1, $3);
1178*7c478bd9Sstevel@tonic-gate 				break;
1179*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1180*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MUL_E_INVD, $1, $3);
1181*7c478bd9Sstevel@tonic-gate 				break;
1182*7c478bd9Sstevel@tonic-gate 			default:
1183*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MUL, $1, $3);
1184*7c478bd9Sstevel@tonic-gate 				break;
1185*7c478bd9Sstevel@tonic-gate 			}
1186*7c478bd9Sstevel@tonic-gate 			break;
1187*7c478bd9Sstevel@tonic-gate 		}
1188*7c478bd9Sstevel@tonic-gate 	}
1189*7c478bd9Sstevel@tonic-gate 	| expr DIV expr
1190*7c478bd9Sstevel@tonic-gate 	{
1191*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr / expr\n"));
1192*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_DIV, $1, $3);
1193*7c478bd9Sstevel@tonic-gate 		$1 = expr_seq_to_int($1);
1194*7c478bd9Sstevel@tonic-gate 		$3 = expr_seq_to_int($3);
1195*7c478bd9Sstevel@tonic-gate 		switch ($1->type) {
1196*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
1197*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1198*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1199*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_DIV_D_D, $1, $3);
1200*7c478bd9Sstevel@tonic-gate 				break;
1201*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1202*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_DIV_D_R, $1, $3);
1203*7c478bd9Sstevel@tonic-gate 				break;
1204*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1205*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_DIV_D_INVD, $1, $3);
1206*7c478bd9Sstevel@tonic-gate 				break;
1207*7c478bd9Sstevel@tonic-gate 			default:
1208*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_DIV_D_E, $1, $3);
1209*7c478bd9Sstevel@tonic-gate 				break;
1210*7c478bd9Sstevel@tonic-gate 			}
1211*7c478bd9Sstevel@tonic-gate 			break;
1212*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
1213*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1214*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1215*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_DIV_R_D, $1, $3);
1216*7c478bd9Sstevel@tonic-gate 				break;
1217*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1218*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_DIV_R_R, $1, $3);
1219*7c478bd9Sstevel@tonic-gate 				break;
1220*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1221*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_DIV_R_INVD, $1, $3);
1222*7c478bd9Sstevel@tonic-gate 				break;
1223*7c478bd9Sstevel@tonic-gate 			default:
1224*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_DIV_R_E, $1, $3);
1225*7c478bd9Sstevel@tonic-gate 				break;
1226*7c478bd9Sstevel@tonic-gate 			}
1227*7c478bd9Sstevel@tonic-gate 			break;
1228*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
1229*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1230*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1231*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_DIV_INVD_D, $1, $3);
1232*7c478bd9Sstevel@tonic-gate 				break;
1233*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1234*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_DIV_INVD_R, $1, $3);
1235*7c478bd9Sstevel@tonic-gate 				break;
1236*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1237*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_DIV_INVD_INVD,
1238*7c478bd9Sstevel@tonic-gate 					$1, $3);
1239*7c478bd9Sstevel@tonic-gate 				break;
1240*7c478bd9Sstevel@tonic-gate 			default:
1241*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_DIV_INVD_E, $1, $3);
1242*7c478bd9Sstevel@tonic-gate 				break;
1243*7c478bd9Sstevel@tonic-gate 			}
1244*7c478bd9Sstevel@tonic-gate 			break;
1245*7c478bd9Sstevel@tonic-gate 		default:
1246*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1247*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1248*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_DIV_E_D, $1, $3);
1249*7c478bd9Sstevel@tonic-gate 				break;
1250*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1251*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_DIV_E_R, $1, $3);
1252*7c478bd9Sstevel@tonic-gate 				break;
1253*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1254*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_DIV_E_INVD, $1, $3);
1255*7c478bd9Sstevel@tonic-gate 				break;
1256*7c478bd9Sstevel@tonic-gate 			default:
1257*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_DIV, $1, $3);
1258*7c478bd9Sstevel@tonic-gate 				break;
1259*7c478bd9Sstevel@tonic-gate 			}
1260*7c478bd9Sstevel@tonic-gate 			break;
1261*7c478bd9Sstevel@tonic-gate 		}
1262*7c478bd9Sstevel@tonic-gate 	}
1263*7c478bd9Sstevel@tonic-gate 	| expr MOD expr
1264*7c478bd9Sstevel@tonic-gate 	{
1265*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr % expr\n"));
1266*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_MOD, $1, $3);
1267*7c478bd9Sstevel@tonic-gate 		$1 = expr_seq_to_int($1);
1268*7c478bd9Sstevel@tonic-gate 		$3 = expr_seq_to_int($3);
1269*7c478bd9Sstevel@tonic-gate 		switch ($1->type) {
1270*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
1271*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1272*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1273*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MOD_D_D, $1, $3);
1274*7c478bd9Sstevel@tonic-gate 				break;
1275*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1276*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MOD_D_R, $1, $3);
1277*7c478bd9Sstevel@tonic-gate 				break;
1278*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1279*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MOD_D_INVD, $1, $3);
1280*7c478bd9Sstevel@tonic-gate 				break;
1281*7c478bd9Sstevel@tonic-gate 			default:
1282*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MOD_D_E, $1, $3);
1283*7c478bd9Sstevel@tonic-gate 				break;
1284*7c478bd9Sstevel@tonic-gate 			}
1285*7c478bd9Sstevel@tonic-gate 			break;
1286*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
1287*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1288*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1289*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MOD_R_D, $1, $3);
1290*7c478bd9Sstevel@tonic-gate 				break;
1291*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1292*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MOD_R_R, $1, $3);
1293*7c478bd9Sstevel@tonic-gate 				break;
1294*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1295*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MOD_R_INVD, $1, $3);
1296*7c478bd9Sstevel@tonic-gate 				break;
1297*7c478bd9Sstevel@tonic-gate 			default:
1298*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MOD_R_E, $1, $3);
1299*7c478bd9Sstevel@tonic-gate 				break;
1300*7c478bd9Sstevel@tonic-gate 			}
1301*7c478bd9Sstevel@tonic-gate 			break;
1302*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
1303*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1304*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1305*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MOD_INVD_D, $1, $3);
1306*7c478bd9Sstevel@tonic-gate 				break;
1307*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1308*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MOD_INVD_R, $1, $3);
1309*7c478bd9Sstevel@tonic-gate 				break;
1310*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1311*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MOD_INVD_INVD,
1312*7c478bd9Sstevel@tonic-gate 					$1, $3);
1313*7c478bd9Sstevel@tonic-gate 				break;
1314*7c478bd9Sstevel@tonic-gate 			default:
1315*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MOD_INVD_E, $1, $3);
1316*7c478bd9Sstevel@tonic-gate 				break;
1317*7c478bd9Sstevel@tonic-gate 			}
1318*7c478bd9Sstevel@tonic-gate 			break;
1319*7c478bd9Sstevel@tonic-gate 		default:
1320*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1321*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1322*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MOD_E_D, $1, $3);
1323*7c478bd9Sstevel@tonic-gate 				break;
1324*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1325*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MOD_E_R, $1, $3);
1326*7c478bd9Sstevel@tonic-gate 				break;
1327*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1328*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MOD_E_INVD, $1, $3);
1329*7c478bd9Sstevel@tonic-gate 				break;
1330*7c478bd9Sstevel@tonic-gate 			default:
1331*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_MOD, $1, $3);
1332*7c478bd9Sstevel@tonic-gate 				break;
1333*7c478bd9Sstevel@tonic-gate 			}
1334*7c478bd9Sstevel@tonic-gate 			break;
1335*7c478bd9Sstevel@tonic-gate 		}
1336*7c478bd9Sstevel@tonic-gate 	}
1337*7c478bd9Sstevel@tonic-gate 	| expr SHL expr
1338*7c478bd9Sstevel@tonic-gate 	{
1339*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr << expr\n"));
1340*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_SHIFT_L, $1, $3);
1341*7c478bd9Sstevel@tonic-gate 		$1 = expr_seq_to_int($1);
1342*7c478bd9Sstevel@tonic-gate 		$3 = expr_seq_to_int($3);
1343*7c478bd9Sstevel@tonic-gate 		switch ($1->type) {
1344*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
1345*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1346*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1347*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_L_D_D, $1, $3);
1348*7c478bd9Sstevel@tonic-gate 				break;
1349*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1350*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_L_D_R, $1, $3);
1351*7c478bd9Sstevel@tonic-gate 				break;
1352*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1353*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_L_D_INVD,
1354*7c478bd9Sstevel@tonic-gate 					$1, $3);
1355*7c478bd9Sstevel@tonic-gate 				break;
1356*7c478bd9Sstevel@tonic-gate 			default:
1357*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_L_D_E, $1, $3);
1358*7c478bd9Sstevel@tonic-gate 				break;
1359*7c478bd9Sstevel@tonic-gate 			}
1360*7c478bd9Sstevel@tonic-gate 			break;
1361*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
1362*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1363*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1364*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_L_R_D, $1, $3);
1365*7c478bd9Sstevel@tonic-gate 				break;
1366*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1367*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_L_R_R, $1, $3);
1368*7c478bd9Sstevel@tonic-gate 				break;
1369*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1370*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_L_R_INVD,
1371*7c478bd9Sstevel@tonic-gate 					$1, $3);
1372*7c478bd9Sstevel@tonic-gate 				break;
1373*7c478bd9Sstevel@tonic-gate 			default:
1374*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_L_R_E, $1, $3);
1375*7c478bd9Sstevel@tonic-gate 				break;
1376*7c478bd9Sstevel@tonic-gate 			}
1377*7c478bd9Sstevel@tonic-gate 			break;
1378*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
1379*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1380*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1381*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_L_INVD_D,
1382*7c478bd9Sstevel@tonic-gate 					$1, $3);
1383*7c478bd9Sstevel@tonic-gate 				break;
1384*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1385*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_L_INVD_R,
1386*7c478bd9Sstevel@tonic-gate 					$1, $3);
1387*7c478bd9Sstevel@tonic-gate 				break;
1388*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1389*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_L_INVD_INVD,
1390*7c478bd9Sstevel@tonic-gate 					$1, $3);
1391*7c478bd9Sstevel@tonic-gate 				break;
1392*7c478bd9Sstevel@tonic-gate 			default:
1393*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_L_INVD_E,
1394*7c478bd9Sstevel@tonic-gate 					$1, $3);
1395*7c478bd9Sstevel@tonic-gate 				break;
1396*7c478bd9Sstevel@tonic-gate 			}
1397*7c478bd9Sstevel@tonic-gate 			break;
1398*7c478bd9Sstevel@tonic-gate 		default:
1399*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1400*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1401*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_L_E_D, $1, $3);
1402*7c478bd9Sstevel@tonic-gate 				break;
1403*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1404*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_L_E_R, $1, $3);
1405*7c478bd9Sstevel@tonic-gate 				break;
1406*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1407*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_L_E_INVD,
1408*7c478bd9Sstevel@tonic-gate 					$1, $3);
1409*7c478bd9Sstevel@tonic-gate 				break;
1410*7c478bd9Sstevel@tonic-gate 			default:
1411*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_L, $1, $3);
1412*7c478bd9Sstevel@tonic-gate 				break;
1413*7c478bd9Sstevel@tonic-gate 			}
1414*7c478bd9Sstevel@tonic-gate 			break;
1415*7c478bd9Sstevel@tonic-gate 		}
1416*7c478bd9Sstevel@tonic-gate 	}
1417*7c478bd9Sstevel@tonic-gate 	| expr SHR expr
1418*7c478bd9Sstevel@tonic-gate 	{
1419*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr >> expr\n"));
1420*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_SHIFT_R, $1, $3);
1421*7c478bd9Sstevel@tonic-gate 		$1 = expr_seq_to_int($1);
1422*7c478bd9Sstevel@tonic-gate 		$3 = expr_seq_to_int($3);
1423*7c478bd9Sstevel@tonic-gate 		switch ($1->type) {
1424*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
1425*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1426*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1427*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_R_D_D, $1, $3);
1428*7c478bd9Sstevel@tonic-gate 				break;
1429*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1430*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_R_D_R, $1, $3);
1431*7c478bd9Sstevel@tonic-gate 				break;
1432*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1433*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_R_D_INVD,
1434*7c478bd9Sstevel@tonic-gate 					$1, $3);
1435*7c478bd9Sstevel@tonic-gate 				break;
1436*7c478bd9Sstevel@tonic-gate 			default:
1437*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_R_D_E, $1, $3);
1438*7c478bd9Sstevel@tonic-gate 				break;
1439*7c478bd9Sstevel@tonic-gate 			}
1440*7c478bd9Sstevel@tonic-gate 			break;
1441*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
1442*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1443*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1444*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_R_R_D, $1, $3);
1445*7c478bd9Sstevel@tonic-gate 				break;
1446*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1447*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_R_R_R, $1, $3);
1448*7c478bd9Sstevel@tonic-gate 				break;
1449*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1450*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_R_R_INVD,
1451*7c478bd9Sstevel@tonic-gate 					$1, $3);
1452*7c478bd9Sstevel@tonic-gate 				break;
1453*7c478bd9Sstevel@tonic-gate 			default:
1454*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_R_R_E, $1, $3);
1455*7c478bd9Sstevel@tonic-gate 				break;
1456*7c478bd9Sstevel@tonic-gate 			}
1457*7c478bd9Sstevel@tonic-gate 			break;
1458*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
1459*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1460*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1461*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_R_INVD_D,
1462*7c478bd9Sstevel@tonic-gate 					$1, $3);
1463*7c478bd9Sstevel@tonic-gate 				break;
1464*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1465*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_R_INVD_R,
1466*7c478bd9Sstevel@tonic-gate 					$1, $3);
1467*7c478bd9Sstevel@tonic-gate 				break;
1468*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1469*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_R_INVD_INVD,
1470*7c478bd9Sstevel@tonic-gate 					$1, $3);
1471*7c478bd9Sstevel@tonic-gate 				break;
1472*7c478bd9Sstevel@tonic-gate 			default:
1473*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_R_INVD_E,
1474*7c478bd9Sstevel@tonic-gate 					$1, $3);
1475*7c478bd9Sstevel@tonic-gate 				break;
1476*7c478bd9Sstevel@tonic-gate 			}
1477*7c478bd9Sstevel@tonic-gate 			break;
1478*7c478bd9Sstevel@tonic-gate 		default:
1479*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1480*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1481*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_R_E_D, $1, $3);
1482*7c478bd9Sstevel@tonic-gate 				break;
1483*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1484*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_R_E_R, $1, $3);
1485*7c478bd9Sstevel@tonic-gate 				break;
1486*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1487*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_R_E_INVD,
1488*7c478bd9Sstevel@tonic-gate 					$1, $3);
1489*7c478bd9Sstevel@tonic-gate 				break;
1490*7c478bd9Sstevel@tonic-gate 			default:
1491*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_SHIFT_R, $1, $3);
1492*7c478bd9Sstevel@tonic-gate 				break;
1493*7c478bd9Sstevel@tonic-gate 			}
1494*7c478bd9Sstevel@tonic-gate 			break;
1495*7c478bd9Sstevel@tonic-gate 		}
1496*7c478bd9Sstevel@tonic-gate 	}
1497*7c478bd9Sstevel@tonic-gate 	| expr OR expr
1498*7c478bd9Sstevel@tonic-gate 	{
1499*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr | expr\n"));
1500*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_OR, $1, $3);
1501*7c478bd9Sstevel@tonic-gate 		$1 = expr_seq_to_int($1);
1502*7c478bd9Sstevel@tonic-gate 		$3 = expr_seq_to_int($3);
1503*7c478bd9Sstevel@tonic-gate 		switch ($1->type) {
1504*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
1505*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1506*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1507*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_OR_D_D, $1, $3);
1508*7c478bd9Sstevel@tonic-gate 				break;
1509*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1510*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_OR_D_R, $1, $3);
1511*7c478bd9Sstevel@tonic-gate 				break;
1512*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1513*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_OR_D_INVD, $1, $3);
1514*7c478bd9Sstevel@tonic-gate 				break;
1515*7c478bd9Sstevel@tonic-gate 			default:
1516*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_OR_D_E, $1, $3);
1517*7c478bd9Sstevel@tonic-gate 				break;
1518*7c478bd9Sstevel@tonic-gate 			}
1519*7c478bd9Sstevel@tonic-gate 			break;
1520*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
1521*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1522*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1523*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_OR_R_D, $1, $3);
1524*7c478bd9Sstevel@tonic-gate 				break;
1525*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1526*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_OR_R_R, $1, $3);
1527*7c478bd9Sstevel@tonic-gate 				break;
1528*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1529*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_OR_R_INVD, $1, $3);
1530*7c478bd9Sstevel@tonic-gate 				break;
1531*7c478bd9Sstevel@tonic-gate 			default:
1532*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_OR_R_E, $1, $3);
1533*7c478bd9Sstevel@tonic-gate 				break;
1534*7c478bd9Sstevel@tonic-gate 			}
1535*7c478bd9Sstevel@tonic-gate 			break;
1536*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
1537*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1538*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1539*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_OR_INVD_D, $1, $3);
1540*7c478bd9Sstevel@tonic-gate 				break;
1541*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1542*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_OR_INVD_R, $1, $3);
1543*7c478bd9Sstevel@tonic-gate 				break;
1544*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1545*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_OR_INVD_INVD,
1546*7c478bd9Sstevel@tonic-gate 					$1, $3);
1547*7c478bd9Sstevel@tonic-gate 				break;
1548*7c478bd9Sstevel@tonic-gate 			default:
1549*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_OR_INVD_E, $1, $3);
1550*7c478bd9Sstevel@tonic-gate 				break;
1551*7c478bd9Sstevel@tonic-gate 			}
1552*7c478bd9Sstevel@tonic-gate 			break;
1553*7c478bd9Sstevel@tonic-gate 		default:
1554*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1555*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1556*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_OR_E_D, $1, $3);
1557*7c478bd9Sstevel@tonic-gate 				break;
1558*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1559*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_OR_E_R, $1, $3);
1560*7c478bd9Sstevel@tonic-gate 				break;
1561*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1562*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_OR_E_INVD, $1, $3);
1563*7c478bd9Sstevel@tonic-gate 				break;
1564*7c478bd9Sstevel@tonic-gate 			default:
1565*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_OR, $1, $3);
1566*7c478bd9Sstevel@tonic-gate 				break;
1567*7c478bd9Sstevel@tonic-gate 			}
1568*7c478bd9Sstevel@tonic-gate 			break;
1569*7c478bd9Sstevel@tonic-gate 		}
1570*7c478bd9Sstevel@tonic-gate 	}
1571*7c478bd9Sstevel@tonic-gate 	| expr XOR expr
1572*7c478bd9Sstevel@tonic-gate 	{
1573*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr ^ expr\n"));
1574*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_XOR, $1, $3);
1575*7c478bd9Sstevel@tonic-gate 		$1 = expr_seq_to_int($1);
1576*7c478bd9Sstevel@tonic-gate 		$3 = expr_seq_to_int($3);
1577*7c478bd9Sstevel@tonic-gate 		switch ($1->type) {
1578*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
1579*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1580*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1581*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_XOR_D_D, $1, $3);
1582*7c478bd9Sstevel@tonic-gate 				break;
1583*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1584*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_XOR_D_R, $1, $3);
1585*7c478bd9Sstevel@tonic-gate 				break;
1586*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1587*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_XOR_D_INVD, $1, $3);
1588*7c478bd9Sstevel@tonic-gate 				break;
1589*7c478bd9Sstevel@tonic-gate 			default:
1590*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_XOR_D_E, $1, $3);
1591*7c478bd9Sstevel@tonic-gate 				break;
1592*7c478bd9Sstevel@tonic-gate 			}
1593*7c478bd9Sstevel@tonic-gate 			break;
1594*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
1595*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1596*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1597*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_XOR_R_D, $1, $3);
1598*7c478bd9Sstevel@tonic-gate 				break;
1599*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1600*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_XOR_R_R, $1, $3);
1601*7c478bd9Sstevel@tonic-gate 				break;
1602*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1603*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_XOR_R_INVD, $1, $3);
1604*7c478bd9Sstevel@tonic-gate 				break;
1605*7c478bd9Sstevel@tonic-gate 			default:
1606*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_XOR_R_E, $1, $3);
1607*7c478bd9Sstevel@tonic-gate 				break;
1608*7c478bd9Sstevel@tonic-gate 			}
1609*7c478bd9Sstevel@tonic-gate 			break;
1610*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
1611*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1612*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1613*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_XOR_INVD_D, $1, $3);
1614*7c478bd9Sstevel@tonic-gate 				break;
1615*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1616*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_XOR_INVD_R, $1, $3);
1617*7c478bd9Sstevel@tonic-gate 				break;
1618*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1619*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_XOR_INVD_INVD,
1620*7c478bd9Sstevel@tonic-gate 					$1, $3);
1621*7c478bd9Sstevel@tonic-gate 				break;
1622*7c478bd9Sstevel@tonic-gate 			default:
1623*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_XOR_INVD_E, $1, $3);
1624*7c478bd9Sstevel@tonic-gate 				break;
1625*7c478bd9Sstevel@tonic-gate 			}
1626*7c478bd9Sstevel@tonic-gate 			break;
1627*7c478bd9Sstevel@tonic-gate 		default:
1628*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1629*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1630*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_XOR_E_D, $1, $3);
1631*7c478bd9Sstevel@tonic-gate 				break;
1632*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1633*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_XOR_E_R, $1, $3);
1634*7c478bd9Sstevel@tonic-gate 				break;
1635*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1636*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_XOR_E_INVD, $1, $3);
1637*7c478bd9Sstevel@tonic-gate 				break;
1638*7c478bd9Sstevel@tonic-gate 			default:
1639*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_XOR, $1, $3);
1640*7c478bd9Sstevel@tonic-gate 				break;
1641*7c478bd9Sstevel@tonic-gate 			}
1642*7c478bd9Sstevel@tonic-gate 			break;
1643*7c478bd9Sstevel@tonic-gate 		}
1644*7c478bd9Sstevel@tonic-gate 	}
1645*7c478bd9Sstevel@tonic-gate 	| expr AND expr
1646*7c478bd9Sstevel@tonic-gate 	{
1647*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr & expr\n"));
1648*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_AND, $1, $3);
1649*7c478bd9Sstevel@tonic-gate 		$1 = expr_seq_to_int($1);
1650*7c478bd9Sstevel@tonic-gate 		$3 = expr_seq_to_int($3);
1651*7c478bd9Sstevel@tonic-gate 		switch ($1->type) {
1652*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
1653*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1654*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1655*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_AND_D_D, $1, $3);
1656*7c478bd9Sstevel@tonic-gate 				break;
1657*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1658*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_AND_D_R, $1, $3);
1659*7c478bd9Sstevel@tonic-gate 				break;
1660*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1661*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_AND_D_INVD, $1, $3);
1662*7c478bd9Sstevel@tonic-gate 				break;
1663*7c478bd9Sstevel@tonic-gate 			default:
1664*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_AND_D_E, $1, $3);
1665*7c478bd9Sstevel@tonic-gate 				break;
1666*7c478bd9Sstevel@tonic-gate 	}
1667*7c478bd9Sstevel@tonic-gate 			break;
1668*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
1669*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1670*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1671*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_AND_R_D, $1, $3);
1672*7c478bd9Sstevel@tonic-gate 				break;
1673*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1674*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_AND_R_R, $1, $3);
1675*7c478bd9Sstevel@tonic-gate 				break;
1676*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1677*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_AND_R_INVD, $1, $3);
1678*7c478bd9Sstevel@tonic-gate 				break;
1679*7c478bd9Sstevel@tonic-gate 			default:
1680*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_AND_R_E, $1, $3);
1681*7c478bd9Sstevel@tonic-gate 				break;
1682*7c478bd9Sstevel@tonic-gate 			}
1683*7c478bd9Sstevel@tonic-gate 			break;
1684*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
1685*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1686*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1687*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_AND_INVD_D, $1, $3);
1688*7c478bd9Sstevel@tonic-gate 				break;
1689*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1690*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_AND_INVD_R, $1, $3);
1691*7c478bd9Sstevel@tonic-gate 				break;
1692*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1693*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_AND_INVD_INVD,
1694*7c478bd9Sstevel@tonic-gate 					$1, $3);
1695*7c478bd9Sstevel@tonic-gate 				break;
1696*7c478bd9Sstevel@tonic-gate 			default:
1697*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_AND_INVD_E, $1, $3);
1698*7c478bd9Sstevel@tonic-gate 				break;
1699*7c478bd9Sstevel@tonic-gate 			}
1700*7c478bd9Sstevel@tonic-gate 			break;
1701*7c478bd9Sstevel@tonic-gate 		default:
1702*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1703*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1704*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_AND_E_D, $1, $3);
1705*7c478bd9Sstevel@tonic-gate 				break;
1706*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1707*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_AND_E_R, $1, $3);
1708*7c478bd9Sstevel@tonic-gate 				break;
1709*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1710*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_AND_E_INVD, $1, $3);
1711*7c478bd9Sstevel@tonic-gate 				break;
1712*7c478bd9Sstevel@tonic-gate 			default:
1713*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_AND, $1, $3);
1714*7c478bd9Sstevel@tonic-gate 				break;
1715*7c478bd9Sstevel@tonic-gate 			}
1716*7c478bd9Sstevel@tonic-gate 			break;
1717*7c478bd9Sstevel@tonic-gate 		}
1718*7c478bd9Sstevel@tonic-gate 	}
1719*7c478bd9Sstevel@tonic-gate 	| expr EQ expr
1720*7c478bd9Sstevel@tonic-gate 	{
1721*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr == expr\n"));
1722*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_EQ, $1, $3);
1723*7c478bd9Sstevel@tonic-gate 		$1 = expr_seq_to_int($1);
1724*7c478bd9Sstevel@tonic-gate 		$3 = expr_seq_to_int($3);
1725*7c478bd9Sstevel@tonic-gate 		switch ($1->type) {
1726*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
1727*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1728*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1729*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_EQ_D_D, $1, $3);
1730*7c478bd9Sstevel@tonic-gate 				break;
1731*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1732*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_EQ_D_R, $1, $3);
1733*7c478bd9Sstevel@tonic-gate 				break;
1734*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1735*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_EQ_D_INVD, $1, $3);
1736*7c478bd9Sstevel@tonic-gate 				break;
1737*7c478bd9Sstevel@tonic-gate 			default:
1738*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_EQ_D_E, $1, $3);
1739*7c478bd9Sstevel@tonic-gate 				break;
1740*7c478bd9Sstevel@tonic-gate 			}
1741*7c478bd9Sstevel@tonic-gate 			break;
1742*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
1743*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1744*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1745*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_EQ_R_D, $1, $3);
1746*7c478bd9Sstevel@tonic-gate 				break;
1747*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1748*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_EQ_R_R, $1, $3);
1749*7c478bd9Sstevel@tonic-gate 				break;
1750*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1751*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_EQ_R_INVD, $1, $3);
1752*7c478bd9Sstevel@tonic-gate 				break;
1753*7c478bd9Sstevel@tonic-gate 			default:
1754*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_EQ_R_E, $1, $3);
1755*7c478bd9Sstevel@tonic-gate 				break;
1756*7c478bd9Sstevel@tonic-gate 			}
1757*7c478bd9Sstevel@tonic-gate 			break;
1758*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
1759*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1760*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1761*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_EQ_INVD_D, $1, $3);
1762*7c478bd9Sstevel@tonic-gate 				break;
1763*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1764*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_EQ_INVD_R, $1, $3);
1765*7c478bd9Sstevel@tonic-gate 				break;
1766*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1767*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_EQ_INVD_INVD,
1768*7c478bd9Sstevel@tonic-gate 					$1, $3);
1769*7c478bd9Sstevel@tonic-gate 				break;
1770*7c478bd9Sstevel@tonic-gate 			default:
1771*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_EQ_INVD_E, $1, $3);
1772*7c478bd9Sstevel@tonic-gate 				break;
1773*7c478bd9Sstevel@tonic-gate 			}
1774*7c478bd9Sstevel@tonic-gate 			break;
1775*7c478bd9Sstevel@tonic-gate 		default:
1776*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1777*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1778*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_EQ_E_D, $1, $3);
1779*7c478bd9Sstevel@tonic-gate 				break;
1780*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1781*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_EQ_E_R, $1, $3);
1782*7c478bd9Sstevel@tonic-gate 				break;
1783*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1784*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_EQ_E_INVD, $1, $3);
1785*7c478bd9Sstevel@tonic-gate 				break;
1786*7c478bd9Sstevel@tonic-gate 			default:
1787*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_EQ, $1, $3);
1788*7c478bd9Sstevel@tonic-gate 				break;
1789*7c478bd9Sstevel@tonic-gate 			}
1790*7c478bd9Sstevel@tonic-gate 			break;
1791*7c478bd9Sstevel@tonic-gate 		}
1792*7c478bd9Sstevel@tonic-gate 	}
1793*7c478bd9Sstevel@tonic-gate 	| expr NE expr
1794*7c478bd9Sstevel@tonic-gate 	{
1795*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr != expr\n"));
1796*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_NE, $1, $3);
1797*7c478bd9Sstevel@tonic-gate 		$1 = expr_seq_to_int($1);
1798*7c478bd9Sstevel@tonic-gate 		$3 = expr_seq_to_int($3);
1799*7c478bd9Sstevel@tonic-gate 		switch ($1->type) {
1800*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
1801*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1802*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1803*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_NE_D_D, $1, $3);
1804*7c478bd9Sstevel@tonic-gate 				break;
1805*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1806*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_NE_D_R, $1, $3);
1807*7c478bd9Sstevel@tonic-gate 				break;
1808*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1809*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_NE_D_INVD, $1, $3);
1810*7c478bd9Sstevel@tonic-gate 				break;
1811*7c478bd9Sstevel@tonic-gate 			default:
1812*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_NE_D_E, $1, $3);
1813*7c478bd9Sstevel@tonic-gate 				break;
1814*7c478bd9Sstevel@tonic-gate 			}
1815*7c478bd9Sstevel@tonic-gate 			break;
1816*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
1817*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1818*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1819*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_NE_R_D, $1, $3);
1820*7c478bd9Sstevel@tonic-gate 				break;
1821*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1822*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_NE_R_R, $1, $3);
1823*7c478bd9Sstevel@tonic-gate 				break;
1824*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1825*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_NE_R_INVD, $1, $3);
1826*7c478bd9Sstevel@tonic-gate 				break;
1827*7c478bd9Sstevel@tonic-gate 			default:
1828*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_NE_R_E, $1, $3);
1829*7c478bd9Sstevel@tonic-gate 				break;
1830*7c478bd9Sstevel@tonic-gate 			}
1831*7c478bd9Sstevel@tonic-gate 			break;
1832*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
1833*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1834*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1835*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_NE_INVD_D, $1, $3);
1836*7c478bd9Sstevel@tonic-gate 				break;
1837*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1838*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_NE_INVD_R, $1, $3);
1839*7c478bd9Sstevel@tonic-gate 				break;
1840*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1841*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_NE_INVD_INVD,
1842*7c478bd9Sstevel@tonic-gate 					$1, $3);
1843*7c478bd9Sstevel@tonic-gate 				break;
1844*7c478bd9Sstevel@tonic-gate 			default:
1845*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_NE_INVD_E, $1, $3);
1846*7c478bd9Sstevel@tonic-gate 				break;
1847*7c478bd9Sstevel@tonic-gate 			}
1848*7c478bd9Sstevel@tonic-gate 			break;
1849*7c478bd9Sstevel@tonic-gate 		default:
1850*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1851*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1852*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_NE_E_D, $1, $3);
1853*7c478bd9Sstevel@tonic-gate 				break;
1854*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1855*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_NE_E_R, $1, $3);
1856*7c478bd9Sstevel@tonic-gate 				break;
1857*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1858*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_NE_E_INVD, $1, $3);
1859*7c478bd9Sstevel@tonic-gate 				break;
1860*7c478bd9Sstevel@tonic-gate 			default:
1861*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_NE, $1, $3);
1862*7c478bd9Sstevel@tonic-gate 				break;
1863*7c478bd9Sstevel@tonic-gate 			}
1864*7c478bd9Sstevel@tonic-gate 			break;
1865*7c478bd9Sstevel@tonic-gate 		}
1866*7c478bd9Sstevel@tonic-gate 	}
1867*7c478bd9Sstevel@tonic-gate 	| expr GT  expr
1868*7c478bd9Sstevel@tonic-gate 	{
1869*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr > expr\n"));
1870*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_GT, $1, $3);
1871*7c478bd9Sstevel@tonic-gate 		$1 = expr_seq_to_int($1);
1872*7c478bd9Sstevel@tonic-gate 		$3 = expr_seq_to_int($3);
1873*7c478bd9Sstevel@tonic-gate 		switch ($1->type) {
1874*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
1875*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1876*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1877*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GT_D_D, $1, $3);
1878*7c478bd9Sstevel@tonic-gate 				break;
1879*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1880*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GT_D_R, $1, $3);
1881*7c478bd9Sstevel@tonic-gate 				break;
1882*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1883*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GT_D_INVD, $1, $3);
1884*7c478bd9Sstevel@tonic-gate 				break;
1885*7c478bd9Sstevel@tonic-gate 			default:
1886*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GT_D_E, $1, $3);
1887*7c478bd9Sstevel@tonic-gate 				break;
1888*7c478bd9Sstevel@tonic-gate 			}
1889*7c478bd9Sstevel@tonic-gate 			break;
1890*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
1891*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1892*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1893*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GT_R_D, $1, $3);
1894*7c478bd9Sstevel@tonic-gate 				break;
1895*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1896*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GT_R_R, $1, $3);
1897*7c478bd9Sstevel@tonic-gate 				break;
1898*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1899*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GT_R_INVD, $1, $3);
1900*7c478bd9Sstevel@tonic-gate 				break;
1901*7c478bd9Sstevel@tonic-gate 			default:
1902*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GT_R_E, $1, $3);
1903*7c478bd9Sstevel@tonic-gate 				break;
1904*7c478bd9Sstevel@tonic-gate 			}
1905*7c478bd9Sstevel@tonic-gate 			break;
1906*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
1907*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1908*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1909*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GT_INVD_D, $1, $3);
1910*7c478bd9Sstevel@tonic-gate 				break;
1911*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1912*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GT_INVD_R, $1, $3);
1913*7c478bd9Sstevel@tonic-gate 				break;
1914*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1915*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GT_INVD_INVD,
1916*7c478bd9Sstevel@tonic-gate 					$1, $3);
1917*7c478bd9Sstevel@tonic-gate 				break;
1918*7c478bd9Sstevel@tonic-gate 			default:
1919*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GT_INVD_E, $1, $3);
1920*7c478bd9Sstevel@tonic-gate 				break;
1921*7c478bd9Sstevel@tonic-gate 			}
1922*7c478bd9Sstevel@tonic-gate 			break;
1923*7c478bd9Sstevel@tonic-gate 		default:
1924*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1925*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1926*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GT_E_D, $1, $3);
1927*7c478bd9Sstevel@tonic-gate 				break;
1928*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1929*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GT_E_R, $1, $3);
1930*7c478bd9Sstevel@tonic-gate 				break;
1931*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1932*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GT_E_INVD, $1, $3);
1933*7c478bd9Sstevel@tonic-gate 				break;
1934*7c478bd9Sstevel@tonic-gate 			default:
1935*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GT, $1, $3);
1936*7c478bd9Sstevel@tonic-gate 				break;
1937*7c478bd9Sstevel@tonic-gate 			}
1938*7c478bd9Sstevel@tonic-gate 			break;
1939*7c478bd9Sstevel@tonic-gate 		}
1940*7c478bd9Sstevel@tonic-gate 	}
1941*7c478bd9Sstevel@tonic-gate 	| expr GE  expr
1942*7c478bd9Sstevel@tonic-gate 	{
1943*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr >= expr\n"));
1944*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_GE, $1, $3);
1945*7c478bd9Sstevel@tonic-gate 		$1 = expr_seq_to_int($1);
1946*7c478bd9Sstevel@tonic-gate 		$3 = expr_seq_to_int($3);
1947*7c478bd9Sstevel@tonic-gate 		switch ($1->type) {
1948*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
1949*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1950*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1951*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GE_D_D, $1, $3);
1952*7c478bd9Sstevel@tonic-gate 				break;
1953*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1954*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GE_D_R, $1, $3);
1955*7c478bd9Sstevel@tonic-gate 				break;
1956*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1957*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GE_D_INVD, $1, $3);
1958*7c478bd9Sstevel@tonic-gate 				break;
1959*7c478bd9Sstevel@tonic-gate 			default:
1960*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GE_D_E, $1, $3);
1961*7c478bd9Sstevel@tonic-gate 				break;
1962*7c478bd9Sstevel@tonic-gate 			}
1963*7c478bd9Sstevel@tonic-gate 			break;
1964*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
1965*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1966*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1967*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GE_R_D, $1, $3);
1968*7c478bd9Sstevel@tonic-gate 				break;
1969*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1970*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GE_R_R, $1, $3);
1971*7c478bd9Sstevel@tonic-gate 				break;
1972*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1973*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GE_R_INVD, $1, $3);
1974*7c478bd9Sstevel@tonic-gate 				break;
1975*7c478bd9Sstevel@tonic-gate 			default:
1976*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GE_R_E, $1, $3);
1977*7c478bd9Sstevel@tonic-gate 				break;
1978*7c478bd9Sstevel@tonic-gate 			}
1979*7c478bd9Sstevel@tonic-gate 			break;
1980*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
1981*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1982*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
1983*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GE_INVD_D, $1, $3);
1984*7c478bd9Sstevel@tonic-gate 				break;
1985*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
1986*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GE_INVD_R, $1, $3);
1987*7c478bd9Sstevel@tonic-gate 				break;
1988*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
1989*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GE_INVD_INVD,
1990*7c478bd9Sstevel@tonic-gate 					$1, $3);
1991*7c478bd9Sstevel@tonic-gate 				break;
1992*7c478bd9Sstevel@tonic-gate 			default:
1993*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GE_INVD_E, $1, $3);
1994*7c478bd9Sstevel@tonic-gate 				break;
1995*7c478bd9Sstevel@tonic-gate 			}
1996*7c478bd9Sstevel@tonic-gate 			break;
1997*7c478bd9Sstevel@tonic-gate 		default:
1998*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
1999*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
2000*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GE_E_D, $1, $3);
2001*7c478bd9Sstevel@tonic-gate 				break;
2002*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
2003*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GE_E_R, $1, $3);
2004*7c478bd9Sstevel@tonic-gate 				break;
2005*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
2006*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GE_E_INVD, $1, $3);
2007*7c478bd9Sstevel@tonic-gate 				break;
2008*7c478bd9Sstevel@tonic-gate 			default:
2009*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_GE, $1, $3);
2010*7c478bd9Sstevel@tonic-gate 				break;
2011*7c478bd9Sstevel@tonic-gate 			}
2012*7c478bd9Sstevel@tonic-gate 			break;
2013*7c478bd9Sstevel@tonic-gate 		}
2014*7c478bd9Sstevel@tonic-gate 	}
2015*7c478bd9Sstevel@tonic-gate 	| expr LT  expr
2016*7c478bd9Sstevel@tonic-gate 	{
2017*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr < expr\n"));
2018*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_LT, $1, $3);
2019*7c478bd9Sstevel@tonic-gate 		$1 = expr_seq_to_int($1);
2020*7c478bd9Sstevel@tonic-gate 		$3 = expr_seq_to_int($3);
2021*7c478bd9Sstevel@tonic-gate 		switch ($1->type) {
2022*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
2023*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
2024*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
2025*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LT_D_D, $1, $3);
2026*7c478bd9Sstevel@tonic-gate 				break;
2027*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
2028*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LT_D_R, $1, $3);
2029*7c478bd9Sstevel@tonic-gate 				break;
2030*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
2031*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LT_D_INVD, $1, $3);
2032*7c478bd9Sstevel@tonic-gate 				break;
2033*7c478bd9Sstevel@tonic-gate 			default:
2034*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LT_D_E, $1, $3);
2035*7c478bd9Sstevel@tonic-gate 				break;
2036*7c478bd9Sstevel@tonic-gate 			}
2037*7c478bd9Sstevel@tonic-gate 			break;
2038*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
2039*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
2040*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
2041*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LT_R_D, $1, $3);
2042*7c478bd9Sstevel@tonic-gate 				break;
2043*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
2044*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LT_R_R, $1, $3);
2045*7c478bd9Sstevel@tonic-gate 				break;
2046*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
2047*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LT_R_INVD, $1, $3);
2048*7c478bd9Sstevel@tonic-gate 				break;
2049*7c478bd9Sstevel@tonic-gate 			default:
2050*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LT_R_E, $1, $3);
2051*7c478bd9Sstevel@tonic-gate 				break;
2052*7c478bd9Sstevel@tonic-gate 			}
2053*7c478bd9Sstevel@tonic-gate 			break;
2054*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
2055*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
2056*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
2057*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LT_INVD_D, $1, $3);
2058*7c478bd9Sstevel@tonic-gate 				break;
2059*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
2060*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LT_INVD_R, $1, $3);
2061*7c478bd9Sstevel@tonic-gate 				break;
2062*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
2063*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LT_INVD_INVD,
2064*7c478bd9Sstevel@tonic-gate 					$1, $3);
2065*7c478bd9Sstevel@tonic-gate 				break;
2066*7c478bd9Sstevel@tonic-gate 			default:
2067*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LT_INVD_E, $1, $3);
2068*7c478bd9Sstevel@tonic-gate 				break;
2069*7c478bd9Sstevel@tonic-gate 			}
2070*7c478bd9Sstevel@tonic-gate 			break;
2071*7c478bd9Sstevel@tonic-gate 		default:
2072*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
2073*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
2074*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LT_E_D, $1, $3);
2075*7c478bd9Sstevel@tonic-gate 				break;
2076*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
2077*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LT_E_R, $1, $3);
2078*7c478bd9Sstevel@tonic-gate 				break;
2079*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
2080*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LT_E_INVD, $1, $3);
2081*7c478bd9Sstevel@tonic-gate 				break;
2082*7c478bd9Sstevel@tonic-gate 			default:
2083*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LT, $1, $3);
2084*7c478bd9Sstevel@tonic-gate 				break;
2085*7c478bd9Sstevel@tonic-gate 				}
2086*7c478bd9Sstevel@tonic-gate 			break;
2087*7c478bd9Sstevel@tonic-gate 		}
2088*7c478bd9Sstevel@tonic-gate 	}
2089*7c478bd9Sstevel@tonic-gate 	| expr LE  expr
2090*7c478bd9Sstevel@tonic-gate 	{
2091*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr <= expr\n"));
2092*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_LE, $1, $3);
2093*7c478bd9Sstevel@tonic-gate 		$1 = expr_seq_to_int($1);
2094*7c478bd9Sstevel@tonic-gate 		$3 = expr_seq_to_int($3);
2095*7c478bd9Sstevel@tonic-gate 		switch ($1->type) {
2096*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_INT:
2097*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
2098*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
2099*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LE_D_D, $1, $3);
2100*7c478bd9Sstevel@tonic-gate 				break;
2101*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
2102*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LE_D_R, $1, $3);
2103*7c478bd9Sstevel@tonic-gate 				break;
2104*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
2105*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LE_D_INVD, $1, $3);
2106*7c478bd9Sstevel@tonic-gate 				break;
2107*7c478bd9Sstevel@tonic-gate 			default:
2108*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LE_D_E, $1, $3);
2109*7c478bd9Sstevel@tonic-gate 				break;
2110*7c478bd9Sstevel@tonic-gate 			}
2111*7c478bd9Sstevel@tonic-gate 			break;
2112*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_REG:
2113*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
2114*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
2115*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LE_R_D, $1, $3);
2116*7c478bd9Sstevel@tonic-gate 				break;
2117*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
2118*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LE_R_R, $1, $3);
2119*7c478bd9Sstevel@tonic-gate 				break;
2120*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
2121*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LE_R_INVD, $1, $3);
2122*7c478bd9Sstevel@tonic-gate 				break;
2123*7c478bd9Sstevel@tonic-gate 			default:
2124*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LE_R_E, $1, $3);
2125*7c478bd9Sstevel@tonic-gate 				break;
2126*7c478bd9Sstevel@tonic-gate 			}
2127*7c478bd9Sstevel@tonic-gate 			break;
2128*7c478bd9Sstevel@tonic-gate 		case ITM_EXPR_IN_VECTOR_D:
2129*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
2130*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
2131*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LE_INVD_D, $1, $3);
2132*7c478bd9Sstevel@tonic-gate 				break;
2133*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
2134*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LE_INVD_R, $1, $3);
2135*7c478bd9Sstevel@tonic-gate 				break;
2136*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
2137*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LE_INVD_INVD,
2138*7c478bd9Sstevel@tonic-gate 					$1, $3);
2139*7c478bd9Sstevel@tonic-gate 				break;
2140*7c478bd9Sstevel@tonic-gate 			default:
2141*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LE_INVD_E, $1, $3);
2142*7c478bd9Sstevel@tonic-gate 				break;
2143*7c478bd9Sstevel@tonic-gate 			}
2144*7c478bd9Sstevel@tonic-gate 			break;
2145*7c478bd9Sstevel@tonic-gate 		default:
2146*7c478bd9Sstevel@tonic-gate 			switch ($3->type) {
2147*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_INT:
2148*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LE_E_D, $1, $3);
2149*7c478bd9Sstevel@tonic-gate 				break;
2150*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_REG:
2151*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LE_E_R, $1, $3);
2152*7c478bd9Sstevel@tonic-gate 				break;
2153*7c478bd9Sstevel@tonic-gate 			case ITM_EXPR_IN_VECTOR_D:
2154*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LE_E_INVD, $1, $3);
2155*7c478bd9Sstevel@tonic-gate 				break;
2156*7c478bd9Sstevel@tonic-gate 			default:
2157*7c478bd9Sstevel@tonic-gate 				$$ = expr_binary2(ITM_EXPR_LE, $1, $3);
2158*7c478bd9Sstevel@tonic-gate 				break;
2159*7c478bd9Sstevel@tonic-gate 			}
2160*7c478bd9Sstevel@tonic-gate 			break;
2161*7c478bd9Sstevel@tonic-gate 		}
2162*7c478bd9Sstevel@tonic-gate 	}
2163*7c478bd9Sstevel@tonic-gate 	| name ASSIGN expr
2164*7c478bd9Sstevel@tonic-gate 	{
2165*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: NAME = expr\n"));
2166*7c478bd9Sstevel@tonic-gate 		$$ = expr_assign(ITM_EXPR_ASSIGN, $1, $3);
2167*7c478bd9Sstevel@tonic-gate 	}
2168*7c478bd9Sstevel@tonic-gate 	| expr LOR expr
2169*7c478bd9Sstevel@tonic-gate 	{
2170*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr || expr\n"));
2171*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_LOR, $1, $3);
2172*7c478bd9Sstevel@tonic-gate 	}
2173*7c478bd9Sstevel@tonic-gate 	| expr LAND expr
2174*7c478bd9Sstevel@tonic-gate 	{
2175*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('y', ("expr: expr && expr\n"));
2176*7c478bd9Sstevel@tonic-gate 		$$ = expr_binary(ITM_EXPR_LAND, $1, $3);
2177*7c478bd9Sstevel@tonic-gate 	}
2178*7c478bd9Sstevel@tonic-gate 	;
2179*7c478bd9Sstevel@tonic-gate 
2180*7c478bd9Sstevel@tonic-gate %%
2181