home *** CD-ROM | disk | FTP | other *** search
-
- ╔═════════════════════════════════════════════════════════════════════════════╗
- ║ ║
- ║ Fig. 2 LALR Error Recovery on a POPL program ║
- ║ ║
- ║ Parsing ... ║
- ║ 1 INT avg(INT a[10], INT count) ║
- ║ 2 { ║
- ║ 3 INT indx, sum; #local variables# ║
- ║ 4 ║
- ║ 5 indx = 0; ║
- ║ ----------------^ replacing with := ║
- ║ 6 sum := 0; ║
- ║ 7 WHILE indx < count DO { ║
- ║ 8 sum := sum + a[indx]; ║
- ║ 9 indx := indx + 1; ║
- ║ 10 } ║
- ║ 11 sum := sum ) / count; ║
- ║ -----------------------^ ignoring ) ║
- ║ 12 RETURN sum; ║
- ║ 13 ║
- ║ 14 ║
- ║ --------^ inserting } ║
- ║ 3 warnings, 14 lines, 0.11 sec. ║
- ║ ║
- ╚═════════════════════════════════════════════════════════════════════════════╝