SL PARSES THE LR LANGUAGES

被引:5
|
作者
BARNARD, DT
CORDY, JR
机构
[1] Queen's Univ, Canada
来源
COMPUTER LANGUAGES | 1988年 / 13卷 / 02期
关键词
Automata Theory--Grammars - Computer Operating Systems;
D O I
10.1016/0096-0551(88)90010-0
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
SL, the Syntax Language component of S/SL (Syntax/Semantic Language) is a dataless programming language for implementing efficient recursive descent parsers. SL is clearly powerful enough to parse the LL(1) languages, but it is much less obvious that it is sufficiently powerful to parse the LR(κ) languages. We show that this is in fact the case by giving an algorithm to construct an SL program that parses the same language as a given LR(1) parser. This construction provides both a proof that SL has the parsing power of LR(1) [and hence LR(κ)] and a practical method for deriving efficient SL parsers from BNF grammars.
引用
收藏
页码:65 / 74
页数:10
相关论文
共 50 条