LALR(1)分析器快速生成  被引量:1

Faster generation of LALR(1) parsers

在线阅读下载全文

作  者:李虎[1] 杨晓津[2] 刘超[1] 

机构地区:[1]北京航空航天大学计算机学院,北京100083 [2]总参第61研究所,北京100039

出  处:《北京航空航天大学学报》2008年第1期117-121,共5页Journal of Beijing University of Aeronautics and Astronautics

基  金:国家自然科学基金资助项目(60573084,60703057);国家高技术研究发展(863)计划资助项目(2006AA01Z176)

摘  要:根据LR(0)自动机的构造理论及Deremer和Pennello的LALR(1)向前看符号集计算公式,提出求解公式中的lookback关系和includes关系的高效算法.研究过程表明,LR(0)项目集闭包计算和项目集的查找是LR(0)分析器构造过程中的主要性能瓶颈.对这两个计算过程给出了高效的数据结构和算法设计,实现了LALR(1)分析器的快速生成.系统实现及实验数据表明,LALR(1)分析器的生成速度超过了自由软件基金会的LALR(1)分析器生成器B ison.Deremer & Pennello's formula for computing LALR( 1 ) lookaheads was studied in practice, by introducing a forward searching method for the computation of lookback and includes relations which were defined in the formula. Efficient algorithms for implementing of the two relations were designed. Several experiments were conducted to show that the computation of LR(0) items closure and searching for a sate in LR(0) state machine are the main bottlenecks of parser generation. Effective and efficient data structures and algorithms for the optimization of these two computations were also proposed. Experimental results show that the speed of LALR(1) parser generation implemented by improved algorithm is even faster than the speed of Bison, a well-known defacto industrial standard-of LALR( 1 ) parser generator.

关 键 词:语法分析器生成 自底向上分析 向前看符号集 

分 类 号:TP310[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象