~ubuntu-branches/ubuntu/utopic/golang/utopic

« back to all changes in this revision

Viewing changes to src/cmd/8a/a.y

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
%left   '+' '-'
54
54
%left   '*' '/' '%'
55
55
%token  <lval>  LTYPE0 LTYPE1 LTYPE2 LTYPE3 LTYPE4
56
 
%token  <lval>  LTYPEC LTYPED LTYPEN LTYPER LTYPET LTYPES LTYPEM LTYPEI LTYPEG
57
 
%token  <lval>  LCONST LFP LPC LSB
58
 
%token  <lval>  LBREG LLREG LSREG LFREG
 
56
%token  <lval>  LTYPEC LTYPED LTYPEN LTYPER LTYPET LTYPES LTYPEM LTYPEI LTYPEG LTYPEXC
 
57
%token  <lval>  LTYPEX LCONST LFP LPC LSB
 
58
%token  <lval>  LBREG LLREG LSREG LFREG LXREG
59
59
%token  <dval>  LFCONST
60
60
%token  <sval>  LSCONST LSP
61
61
%token  <sym>   LNAME LLAB LVAR
63
63
%type   <con2>  con2
64
64
%type   <gen>   mem imm imm2 reg nam rel rem rim rom omem nmem
65
65
%type   <gen2>  nonnon nonrel nonrem rimnon rimrem remrim
66
 
%type   <gen2>  spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8
 
66
%type   <gen2>  spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8 spec9 spec10
67
67
%%
68
68
prog:
69
69
|       prog
116
116
|       LTYPEM spec6    { outcode($1, &$2); }
117
117
|       LTYPEI spec7    { outcode($1, &$2); }
118
118
|       LTYPEG spec8    { outcode($1, &$2); }
 
119
|       LTYPEXC spec9   { outcode($1, &$2); }
 
120
|       LTYPEX spec10   { outcode($1, &$2); }
119
121
 
120
122
nonnon:
121
123
        {
177
179
                $$.from = nullgen;
178
180
                $$.to = $1;
179
181
        }
 
182
|       imm ',' rel
 
183
        {
 
184
                $$.from = $1;
 
185
                $$.to = $3;
 
186
        }
180
187
 
181
188
spec1:  /* DATA */
182
189
        nam '/' con ',' imm
282
289
                $$.to = $5;
283
290
        }
284
291
 
 
292
spec9:  /* CMPPS/CMPPD */
 
293
        reg ',' rem ',' con
 
294
        {
 
295
                $$.from = $1;
 
296
                $$.to = $3;
 
297
                $$.to.offset = $5;
 
298
        }
 
299
 
 
300
spec10: /* PINSRD */
 
301
        imm ',' rem ',' reg
 
302
        {
 
303
                $$.from = $3;
 
304
                $$.to = $5;
 
305
                if($1.type != D_CONST)
 
306
                        yyerror("illegal constant");
 
307
                $$.to.offset = $1.offset;
 
308
        }
 
309
 
285
310
rem:
286
311
        reg
287
312
|       mem
345
370
                $$ = nullgen;
346
371
                $$.type = $1;
347
372
        }
 
373
|       LXREG
 
374
        {
 
375
                $$ = nullgen;
 
376
                $$.type = $1;
 
377
        }
348
378
|       LSP
349
379
        {
350
380
                $$ = nullgen;
477
507
                $$.scale = $8;
478
508
                checkscale($$.scale);
479
509
        }
 
510
|       con '(' LLREG ')' '(' LSREG '*' con ')'
 
511
        {
 
512
                $$ = nullgen;
 
513
                $$.type = D_INDIR+$3;
 
514
                $$.offset = $1;
 
515
                $$.index = $6;
 
516
                $$.scale = $8;
 
517
                checkscale($$.scale);
 
518
        }
480
519
|       '(' LLREG ')'
481
520
        {
482
521
                $$ = nullgen;