Original BTL Ratfor System for 4.2
* %sccs.include.proprietary.c%
* @(#)r.y 1.2 (Berkeley) %G%
%term IF ELSE FOR WHILE BREAK NEXT
%term SWITCH CASE DEFAULT
stat : if stat ={ indent--; outcont($1); }
| ifelse stat ={ indent--; outcont($1+1); }
| switch fullcase '}' ={ endsw($1, $2); }
| while stat ={ whilestat($1); }
| for stat ={ forstat($1); }
| repeat stat UNTIL ={ untils($1,1); }
| repeat stat ={ untils($1,0); }
| BREAK ={ breakcode(); }
| do stat ={ dostat($1); }
| error ={ errcode(); yyclearin; }
sw : SWITCH ={ swcode(); }
fullcase: caselist ={ $$ = 0; }
| caselist defpart ={ $$ = 1; }
default : DEFAULT ={ getdefault(); }
case : CASE ={ getcase(); }
label : DIGITS ={ transfer = 0; outcode($1); }
ifelse : if stat ELSE ={ elsecode($1); }
while : WHILE ={ whilecode(); }
for : FOR ={ forcode(); }
repeat : REPEAT ={ repcode(); }