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 条
[1]  
Aho A. V., 1972, SIAM Journal on Computing, V1, P305, DOI 10.1137/0201022
[2]  
Aho A.V, 1986, COMPILERS PRINCIPLES
[3]   LOCALLY LEAST-COST ERROR RECOVERY IN EARLEY ALGORITHM [J].
ANDERSON, SO ;
BACKHOUSE, RC .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1981, 3 (03) :318-347
[4]   AN ASSESSMENT OF LOCALLY LEAST-COST ERROR RECOVERY [J].
ANDERSON, SO ;
BACKHOUSE, RC ;
BUGGE, EH ;
STIRLING, CP .
COMPUTER JOURNAL, 1983, 26 (01) :15-24
[5]  
BACKHOUSE RC, 1981, 14 HER U DEP COMP SC
[6]  
CORBETT R, 1991, BISON GNU PARSER GEN
[7]  
DION BA, 1978, 344 U WISC TECH REP
[8]  
FEYCOCK S, 1976, SOFTW PRACT EXPT, V6, P207
[9]   A SIMPLE, FAST, AND EFFECTIVE LL(1) ERROR REPAIR ALGORITHM [J].
FISCHER, CN ;
MAUNEY, J .
ACTA INFORMATICA, 1992, 29 (02) :109-120
[10]   EFFICIENT LL(1) ERROR CORRECTION AND RECOVERY USING ONLY INSERTIONS [J].
FISCHER, CN ;
MILTON, DR ;
QUIRING, SB .
ACTA INFORMATICA, 1980, 13 (02) :141-154