计算机学报
計算機學報
계산궤학보
CHINESE JOURNAL OF COMPUTERS
2010年
3期
483-492
,共10页
许福%金茂忠%李虎%宋淼
許福%金茂忠%李虎%宋淼
허복%금무충%리호%송묘
LR(k)文法%文法调试%断点调试
LR(k)文法%文法調試%斷點調試
LR(k)문법%문법조시%단점조시
LR(k)grammar%grammar debugging%breakpoint debugging
LR(k)文法能描述所有确定型上下文无关语言,广泛应用于各类分析器生成器中.传统的LR(k)文法断点调试方法仅支持在产生式右部末尾设置断点(后文简称尾部断点),不支持在产生式右部中间何置设置断点(后文简称中问断点),这给分析器的开发和调试带来了不便.文中提出了一种新颖的LR(k)文法断点调试方法,不但支持传统的尾部断点,还支持中问断点.该方法可显著增加可利用的断点数量,可以跟踪到更细粒度的文法成分,从而帮助用户更好地进行文法调试,降低分析器的开发难度.
LR(k)文法能描述所有確定型上下文無關語言,廣汎應用于各類分析器生成器中.傳統的LR(k)文法斷點調試方法僅支持在產生式右部末尾設置斷點(後文簡稱尾部斷點),不支持在產生式右部中間何置設置斷點(後文簡稱中問斷點),這給分析器的開髮和調試帶來瞭不便.文中提齣瞭一種新穎的LR(k)文法斷點調試方法,不但支持傳統的尾部斷點,還支持中問斷點.該方法可顯著增加可利用的斷點數量,可以跟蹤到更細粒度的文法成分,從而幫助用戶更好地進行文法調試,降低分析器的開髮難度.
LR(k)문법능묘술소유학정형상하문무관어언,엄범응용우각류분석기생성기중.전통적LR(k)문법단점조시방법부지지재산생식우부말미설치단점(후문간칭미부단점),불지지재산생식우부중간하치설치단점(후문간칭중문단점),저급분석기적개발화조시대래료불편.문중제출료일충신영적LR(k)문법단점조시방법,불단지지전통적미부단점,환지지중문단점.해방법가현저증가가이용적단점수량,가이근종도경세립도적문법성분,종이방조용호경호지진행문법조시,강저분석기적개발난도.
LR(k),the most general category of deterministic linear-time parsing,is widely used in various parser generators.The traditional breakpoint debugging methods for LR(k)grammars,only support the breakpoints at the end of productions and do not support the breakpoints in the middle of productions,This brings lots of difficulties for grammar debugging.This paper proposes a new breakpoint debugging method,which supports breakpoint debugging for both middle and tail grammar positions.It can increase the debugging positions remarkably and can help debug grammars more effectively.