1:   /*  Input/Output Statements */
   2: 
   3: io:   io1
   4:         { endio(); }
   5:     ;
   6: 
   7: io1:      iofmove ioctl
   8:     | iofmove unpar_fexpr
   9:         { ioclause(IOSUNIT, $2); endioctl(); }
  10:     | iofctl ioctl
  11:     | read ioctl
  12:         { doio(NULL); }
  13:     | read ioctl inlist
  14:         { doio($3); }
  15:     | read infmt SCOMMA inlist
  16:         { doio($4); }
  17:     | read ioctl SCOMMA inlist
  18:         { doio($4); }
  19:     | decode ioctlc inlist              /* E-D */
  20:         { doio($3); }               /* E-D */
  21:     | encode ioctlc                 /* E-D */
  22:         { doio(NULL); }             /* E-D */
  23:     | encode ioctlc outlist             /* E-D */
  24:         { doio($3); }               /* E-D */
  25:     | write ioctl
  26:         { doio(NULL); }
  27:     | write ioctl outlist
  28:         { doio($3); }
  29:     | print
  30:         { doio(NULL); }
  31:     | print SCOMMA outlist
  32:         { doio($3); }
  33:     ;
  34: 
  35: iofmove:   fmkwd end_spec in_ioctl
  36:     ;
  37: 
  38: fmkwd:    SBACKSPACE
  39:         { iostmt = IOBACKSPACE; }
  40:     | SREWIND
  41:         { iostmt = IOREWIND; }
  42:     | SENDFILE
  43:         { iostmt = IOENDFILE; }
  44:     ;
  45: 
  46: iofctl:  ctlkwd end_spec in_ioctl
  47:     ;
  48: 
  49: ctlkwd:   SINQUIRE
  50:         { iostmt = IOINQUIRE; }
  51:     | SOPEN
  52:         { iostmt = IOOPEN; }
  53:     | SCLOSE
  54:         { iostmt = IOCLOSE; }
  55:     ;
  56: 
  57: infmt:    unpar_fexpr
  58:         {
  59:         ioclause(IOSUNIT, NULL);
  60:         ioclause(IOSFMT, $1);
  61:         endioctl();
  62:         }
  63:     | SSTAR
  64:         {
  65:         ioclause(IOSUNIT, NULL);
  66:         ioclause(IOSFMT, NULL);
  67:         endioctl();
  68:         }
  69:     ;
  70: 
  71: ioctl:    SLPAR fexpr SRPAR
  72:         { ioclause(IOSUNIT, $2); endioctl(); }
  73:     | SLPAR ctllist SRPAR
  74:         { endioctl(); }
  75:     ;
  76: 
  77: ctllist:  ioclause SCOMMA ioclause
  78:     | ctllist SCOMMA ioclause
  79:     ;
  80: 
  81: ioclause:  fexpr
  82:         { ioclause(IOSPOSITIONAL, $1); }
  83:     | SSTAR
  84:         { ioclause(IOSPOSITIONAL, NULL); }
  85:     | nameeq expr
  86:         { ioclause($1, $2); }
  87:     | nameeq SSTAR
  88:         { ioclause($1, NULL); }
  89:     ;
  90: 
  91: nameeq:  SNAMEEQ
  92:         { $$ = iocname(); }
  93:     ;
  94: 
  95: ioctlc:  SLPAR expr SCOMMA fexpr SCOMMA fexpr SRPAR     /* E-D */
  96:         {                   /* E-D */
  97:         iosetecdc( $2 );            /* E-D */
  98:         ioclause( IOSUNIT, $6 );        /* E-D */
  99:         ioclause(  IOSFMT, $4 );        /* E-D */
 100:         endioctl();             /* E-D */
 101:         }                   /* E-D */
 102:     ;                       /* E-D */
 103: 
 104: read:     SREAD end_spec in_ioctl
 105:         { iostmt = IOREAD; }
 106:     ;
 107: 
 108: write:    SWRITE end_spec in_ioctl
 109:         { iostmt = IOWRITE; }
 110:     ;
 111: 
 112: decode:   SDECODE end_spec in_ioctl         /* E-D */
 113:         { iostmt = IOREAD; }            /* E-D */
 114:     ;                       /* E-D */
 115:                             /* E-D */
 116: encode:   SENCODE end_spec in_ioctl         /* E-D */
 117:         { iostmt = IOWRITE; }           /* E-D */
 118:     ;                       /* E-D */
 119: 
 120: print:    SPRINT end_spec fexpr in_ioctl
 121:         {
 122:         iostmt = IOWRITE;
 123:         ioclause(IOSUNIT, NULL);
 124:         ioclause(IOSFMT, $3);
 125:         endioctl();
 126:         }
 127:     | SPRINT end_spec SSTAR in_ioctl
 128:         {
 129:         iostmt = IOWRITE;
 130:         ioclause(IOSUNIT, NULL);
 131:         ioclause(IOSFMT, NULL);
 132:         endioctl();
 133:         }
 134:     ;
 135: 
 136: inlist:   inelt
 137:         { $$ = mkchain($1,0); }
 138:     | inlist SCOMMA inelt
 139:         { $$ = hookup($1, mkchain($3,0)); }
 140:     ;
 141: 
 142: inelt:    lhs
 143:     | SLPAR inlist SCOMMA dospec SRPAR
 144:         { $$ = mkiodo($4,$2); }
 145:     ;
 146: 
 147: outlist:  uexpr
 148:         { $$ = mkchain($1, 0); }
 149:     | other
 150:         { $$ = mkchain($1, 0); }
 151:     | out2
 152:     ;
 153: 
 154: out2:     uexpr SCOMMA uexpr
 155:         { $$ = mkchain($1, mkchain($3, 0) ); }
 156:     | uexpr SCOMMA other
 157:         { $$ = mkchain($1, mkchain($3, 0) ); }
 158:     | other SCOMMA uexpr
 159:         { $$ = mkchain($1, mkchain($3, 0) ); }
 160:     | other SCOMMA other
 161:         { $$ = mkchain($1, mkchain($3, 0) ); }
 162:     | out2  SCOMMA uexpr
 163:         { $$ = hookup($1, mkchain($3, 0) ); }
 164:     | out2  SCOMMA other
 165:         { $$ = hookup($1, mkchain($3, 0) ); }
 166:     ;
 167: 
 168: other:    complex_const
 169:     | SLPAR uexpr SCOMMA dospec SRPAR
 170:         { $$ = mkiodo($4, mkchain($2, 0) ); }
 171:     | SLPAR other SCOMMA dospec SRPAR
 172:         { $$ = mkiodo($4, mkchain($2, 0) ); }
 173:     | SLPAR out2  SCOMMA dospec SRPAR
 174:         { $$ = mkiodo($4, $2); }
 175:     ;
 176: 
 177: in_ioctl:
 178:         { startioctl(); }
 179:     ;
Last modified: 1987-02-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1790
Valid CSS Valid XHTML 1.0 Strict