home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / source / rat / r.g < prev    next >
Encoding:
Text File  |  1975-05-13  |  864 b   |  41 lines

  1. %term    LCURL RCURL LPAR RPAR SCOL DIGITS
  2. %term    XIF XELSE XFOR XWHILE XBREAK NEXT 
  3. %term    OLDDO NEWDO
  4. %term    XGOK XDEFINE XINCLUDE
  5. %term    REPEAT UNTIL
  6. %%
  7.  
  8. statl    : statl  stat
  9.     |
  10.     ;
  11. stat    : if stat    ={ outcont($1); }
  12.     | ifelse stat    ={ outcont($1+1); }
  13.     | while stat    ={ whilestat($1); }
  14.     | for stat    ={ forstat($1); }
  15.     | repeat stat UNTIL    ={ untils($1); }
  16.     | XBREAK    ={ breakcode($1); }
  17.     | NEXT        ={ nextcode($1); }
  18.     | newdo stat    ={ dostat($1); }
  19.     | OLDDO        ={ docode(0,$1); }
  20.     | XGOK        ={ gokcode($1); }
  21.     | SCOL
  22.     | LCURL statl RCURL
  23.     | label stat
  24.     | error        ={ errcode($1); yyclearin; }
  25.     ;
  26. label    : DIGITS    ={ outcode($1); outcode("\t"); }
  27.     ;
  28. if    : XIF        ={ ifcode($1); }
  29.     ;
  30. ifelse    : if stat XELSE    ={ outgoto($1+1); outcont($1); }
  31.     ;
  32. while    : XWHILE    ={ whilecode($1); }
  33.     ;
  34. for    : XFOR        ={ forcode($1); }
  35.     ;
  36. repeat    : REPEAT    ={ repcode($1); }
  37.     ;
  38. newdo    : NEWDO        ={ docode(1,$1); }
  39.     ;
  40. %%
  41.