ERROR REPAIR IN SHIFT-REDUCE PARSERS

被引:12
作者
MCKENZIE, BJ
YEATMAN, C
DEVERE, L
机构
来源
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS | 1995年 / 17卷 / 04期
关键词
BISON; ERROR RECOVERY; LEAST COST; SHIFT-REDUCE; YACC;
D O I
10.1145/210184.210193
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Local error repair of strings during CFG parsing requires the insertion and deletion of symbols in the region of a syntax error to produce a string that is error free. Rather than precalculating tables at parser generation time to assist in finding such repairs, this article shows how such repairs can be found during shift-reduce parsing by using the parsing tables themselves. This results in a substantial space saving over methods that require precalculated tables. Furthermore, the article shows how the method can be integrated with lookahead to avoid finding repairs that immediately result in further syntax errors. The article presents the results of experiments on a version of the LALR(1)-based parser generator Bison to which the algorithm was added.
引用
收藏
页码:672 / 689
页数:18
相关论文
共 30 条
[11]   ON THE ROLE OF ERROR PRODUCTIONS IN SYNTACTIC ERROR CORRECTION [J].
FISCHER, CN ;
MAUNEY, J .
COMPUTER LANGUAGES, 1980, 5 (3-4) :131-139
[12]  
FISCHER CN, 1979, 363 U WISC TECH REP
[13]  
FISCHER CN, 1988, CRAFTING COMPILER
[14]  
FISCHER CN, 1979, 371 U WISC TECH REP
[15]  
GROSCH J, 1990, STRUCT PROGRAM, V11, P129
[16]   AN ERROR-CORRECTING PARSE ALGORITHM [J].
IRONS, ET .
COMMUNICATIONS OF THE ACM, 1963, 6 (11) :669-673
[17]  
JAMES LR, 1972, CSRG13 U TOR COMP SY
[18]  
JOHNSON SC, 1975, 32 BELL LAB COMP SCI
[19]  
KREUTZER W, 1991, INT COMPUTER SCI SER
[20]  
LAFRANCE JE, 1971, 249 U ILL DOC