22 %token <lval> LTYPE0 LTYPE1 LTYPE2 LTYPE3 LTYPE4
23 %token <lval> LTYPEC LTYPED LTYPEN LTYPER LTYPET LTYPES LTYPEM LTYPEI LTYPEG
24 %token <lval> LCONST LFP LPC LSB
25 %token <lval> LBREG LLREG LSREG LFREG
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
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); }
158 | mem ',' con ',' imm
165 spec3: /* JMP/CALL */
187 | rim ',' rem ':' LLREG
191 if($$.from.index != D_NONE)
192 yyerror("dp shift with lhs index");
196 spec6: /* MOVW/MOVL */
202 | rim ',' rem ':' LSREG
206 if($$.to.index != D_NONE)
207 yyerror("dp move with lhs index");
234 | mem ',' con ',' imm
275 yyerror("undefined label: %s", $1->name);
285 $$.offset = $1->value + $2;
328 if($2.type == D_AUTO || $2.type == D_PARAM)
329 yyerror("constant cannot be automatic: %s",
337 memcpy($$.sval, $2, sizeof($$.sval));
345 | '$' '(' LFCONST ')'
383 | '-' LCONST '-' LCONST
397 $$.type = D_INDIR+D_NONE;
403 $$.type = D_INDIR+$3;
409 $$.type = D_INDIR+D_SP;
412 | con '(' LLREG '*' con ')'
415 $$.type = D_INDIR+D_NONE;
419 checkscale($$.scale);
421 | con '(' LLREG ')' '(' LLREG '*' con ')'
424 $$.type = D_INDIR+$3;
428 checkscale($$.scale);
433 $$.type = D_INDIR+$2;
438 $$.type = D_INDIR+D_SP;
443 $$.type = D_INDIR+$3;
446 | '(' LLREG '*' con ')'
449 $$.type = D_INDIR+D_NONE;
452 checkscale($$.scale);
454 | '(' LLREG ')' '(' LLREG '*' con ')'
457 $$.type = D_INDIR+$2;
460 checkscale($$.scale);
468 | nam '(' LLREG '*' con ')'
473 checkscale($$.scale);
477 LNAME offset '(' pointer ')'
484 | LNAME '<' '>' offset '(' LSB ')'