18 %token <lval> LTYPE0 LTYPE1 LTYPE2 LTYPE3 LTYPE4
19 %token <lval> LTYPEC LTYPED LTYPEN LTYPER LTYPET LTYPES LTYPEM LTYPEI LTYPEXC LTYPEX LTYPERT
20 %token <lval> LCONST LFP LPC LSB
21 %token <lval> LBREG LLREG LSREG LFREG LMREG LXREG
23 %token <sval> LSCONST LSP
24 %token <sym> LNAME LLAB LVAR
25 %type <lval> con expr pointer offset
26 %type <gen> mem imm reg nam rel rem rim rom omem nmem
27 %type <gen2> nonnon nonrel nonrem rimnon rimrem remrim spec10
28 %type <gen2> spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8 spec9
37 yyerror("redeclaration of %s", $1->name);
60 yyerror("redeclaration of %s", $1->name);
63 | LTYPE0 nonnon { outcode($1, &$2); }
64 | LTYPE1 nonrem { outcode($1, &$2); }
65 | LTYPE2 rimnon { outcode($1, &$2); }
66 | LTYPE3 rimrem { outcode($1, &$2); }
67 | LTYPE4 remrim { outcode($1, &$2); }
68 | LTYPER nonrel { outcode($1, &$2); }
69 | LTYPED spec1 { outcode($1, &$2); }
70 | LTYPET spec2 { outcode($1, &$2); }
71 | LTYPEC spec3 { outcode($1, &$2); }
72 | LTYPEN spec4 { outcode($1, &$2); }
73 | LTYPES spec5 { outcode($1, &$2); }
74 | LTYPEM spec6 { outcode($1, &$2); }
75 | LTYPEI spec7 { outcode($1, &$2); }
76 | LTYPEXC spec8 { outcode($1, &$2); }
77 | LTYPEX spec9 { outcode($1, &$2); }
78 | LTYPERT spec10 { outcode($1, &$2); }
155 | mem ',' con ',' imm
162 spec3: /* JMP/CALL */
184 | rim ',' rem ':' LLREG
188 if($$.from.index != D_NONE)
189 yyerror("dp shift with lhs index");
193 spec6: /* MOVW/MOVL */
199 | rim ',' rem ':' LSREG
203 if($$.to.index != D_NONE)
204 yyerror("dp move with lhs index");
225 spec8: /* CMPPS/CMPPD */
238 if($1.type != D_CONST)
239 yyerror("illegal constant");
240 $$.to.offset = $1.offset;
243 spec10: /* RET/RETF */
287 yyerror("undefined label: %s", $1->name);
297 $$.offset = $1->value + $2;
350 if($2.type == D_AUTO || $2.type == D_PARAM)
351 yyerror("constant cannot be automatic: %s",
359 memcpy($$.sval, $2, sizeof($$.sval));
367 | '$' '(' LFCONST ')'
388 $$.type = D_INDIR+D_NONE;
394 $$.type = D_INDIR+$3;
400 $$.type = D_INDIR+D_SP;
403 | con '(' LLREG '*' con ')'
406 $$.type = D_INDIR+D_NONE;
410 checkscale($$.scale);
412 | con '(' LLREG ')' '(' LLREG '*' con ')'
415 $$.type = D_INDIR+$3;
419 checkscale($$.scale);
424 $$.type = D_INDIR+$2;
429 $$.type = D_INDIR+D_SP;
431 | '(' LLREG '*' con ')'
434 $$.type = D_INDIR+D_NONE;
437 checkscale($$.scale);
439 | '(' LLREG ')' '(' LLREG '*' con ')'
442 $$.type = D_INDIR+$2;
445 checkscale($$.scale);
453 | nam '(' LLREG '*' con ')'
458 checkscale($$.scale);
462 LNAME offset '(' pointer ')'
469 | LNAME '<' '>' offset '(' LSB ')'