22 %token <lval> LTYPE0 LTYPE1 LTYPE2 LTYPE3 LTYPE4
23 %token <lval> LTYPEC LTYPED LTYPEN LTYPER LTYPET LTYPES LTYPEM LTYPEI LTYPEG LTYPEXC LTYPEX
24 %token <lval> LCONST LFP LPC LSB
25 %token <lval> LBREG LLREG LSREG LFREG LMREG LXREG
27 %token <sval> LSCONST LSP
28 %token <sym> LNAME LLAB LVAR
29 %type <lval> con expr pointer offset
31 %type <gen> mem imm imm2 reg nam rel rem rim rom omem nmem
32 %type <gen2> nonnon nonrel nonrem rimnon rimrem remrim
33 %type <gen2> spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8 spec9 spec10
42 yyerror("redeclaration of %s", $1->name);
65 yyerror("redeclaration of %s", $1->name);
68 | LTYPE0 nonnon { outcode($1, &$2); }
69 | LTYPE1 nonrem { outcode($1, &$2); }
70 | LTYPE2 rimnon { outcode($1, &$2); }
71 | LTYPE3 rimrem { outcode($1, &$2); }
72 | LTYPE4 remrim { outcode($1, &$2); }
73 | LTYPER nonrel { outcode($1, &$2); }
74 | LTYPED spec1 { outcode($1, &$2); }
75 | LTYPET spec2 { outcode($1, &$2); }
76 | LTYPEC spec3 { outcode($1, &$2); }
77 | LTYPEN spec4 { outcode($1, &$2); }
78 | LTYPES spec5 { outcode($1, &$2); }
79 | LTYPEM spec6 { outcode($1, &$2); }
80 | LTYPEI spec7 { outcode($1, &$2); }
81 | LTYPEG spec8 { outcode($1, &$2); }
82 | LTYPEXC spec9 { outcode($1, &$2); }
83 | LTYPEX spec10 { outcode($1, &$2); }
160 | mem ',' con ',' imm
167 spec3: /* JMP/CALL */
189 | rim ',' rem ':' LLREG
193 if($$.from.index != D_NONE)
194 yyerror("dp shift with lhs index");
198 spec6: /* MOVW/MOVL */
204 | rim ',' rem ':' LSREG
208 if($$.to.index != D_NONE)
209 yyerror("dp move with lhs index");
236 | mem ',' con ',' imm
242 spec9: /* CMPPS/CMPPD */
255 if($1.type != D_CONST)
256 yyerror("illegal constant");
257 $$.to.offset = $1.offset;
294 yyerror("undefined label: %s", $1->name);
304 $$.offset = $1->value + $2;
357 if($2.type == D_AUTO || $2.type == D_PARAM)
358 yyerror("constant cannot be automatic: %s",
366 memcpy($$.sval, $2, sizeof($$.sval));
374 | '$' '(' LFCONST ')'
412 | '-' LCONST '-' LCONST
426 $$.type = D_INDIR+D_NONE;
432 $$.type = D_INDIR+$3;
438 $$.type = D_INDIR+D_SP;
441 | con '(' LLREG '*' con ')'
444 $$.type = D_INDIR+D_NONE;
448 checkscale($$.scale);
450 | con '(' LLREG ')' '(' LLREG '*' con ')'
453 $$.type = D_INDIR+$3;
457 checkscale($$.scale);
462 $$.type = D_INDIR+$2;
467 $$.type = D_INDIR+D_SP;
472 $$.type = D_INDIR+$3;
475 | '(' LLREG '*' con ')'
478 $$.type = D_INDIR+D_NONE;
481 checkscale($$.scale);
483 | '(' LLREG ')' '(' LLREG '*' con ')'
486 $$.type = D_INDIR+$2;
489 checkscale($$.scale);
497 | nam '(' LLREG '*' con ')'
502 checkscale($$.scale);
506 LNAME offset '(' pointer ')'
513 | LNAME '<' '>' offset '(' LSB ')'