BSD 3 development
[unix-history] / usr / src / cmd / mip / cgram.y
index 94d6348..37ef85c 100644 (file)
@@ -144,6 +144,9 @@ data_def:
                        ={  $1->op = FREE; }
                |  oattributes fdeclarator {
                                defid( tymerge($1,$2), curclass==STATIC?STATIC:EXTDEF );
                        ={  $1->op = FREE; }
                |  oattributes fdeclarator {
                                defid( tymerge($1,$2), curclass==STATIC?STATIC:EXTDEF );
+#ifndef LINT
+                               pfstab(stab[$2->rval].sname);
+#endif
                                }  function_body
                        ={  
                            if( blevel ) cerror( "function level error" );
                                }  function_body
                        ={  
                            if( blevel ) cerror( "function level error" );
@@ -166,6 +169,20 @@ stmt_list:    stmt_list statement
                            }
                ;
 
                            }
                ;
 
+r_dcl_stat_list        :  dcl_stat_list attributes SM
+                       ={  $2->op = FREE; 
+#ifndef LINT
+                           plcstab(blevel);
+#endif
+                           }
+               |  dcl_stat_list attributes init_dcl_list SM
+                       ={  $2->op = FREE; 
+#ifndef LINT
+                           plcstab(blevel);
+#endif
+                           }
+               ;
+
 dcl_stat_list  :  dcl_stat_list attributes SM
                        ={  $2->op = FREE; }
                |  dcl_stat_list attributes init_dcl_list SM
 dcl_stat_list  :  dcl_stat_list attributes SM
                        ={  $2->op = FREE; }
                |  dcl_stat_list attributes init_dcl_list SM
@@ -401,7 +418,25 @@ ibrace             : LC
 
 /*     STATEMENTS      */
 
 
 /*     STATEMENTS      */
 
-compoundstmt:     begin dcl_stat_list stmt_list RC
+compoundstmt:     dcmpstmt
+               |  cmpstmt
+               ;
+
+dcmpstmt:         begin r_dcl_stat_list stmt_list RC
+                       ={  
+#ifndef LINT
+                           prcstab(blevel);
+#endif
+                           --blevel;
+                           if( blevel == 1 ) blevel = 0;
+                           clearst( blevel );
+                           checkst( blevel );
+                           autooff = *--psavbc;
+                           regvar = *--psavbc;
+                           }
+               ;
+
+cmpstmt:          begin stmt_list RC
                        ={  --blevel;
                            if( blevel == 1 ) blevel = 0;
                            clearst( blevel );
                        ={  --blevel;
                            if( blevel == 1 ) blevel = 0;
                            clearst( blevel );