正在加载图片...
LR Parsers The most powerful shift-reduce parsing (yet efficient)is: LR(k)parsing left to right right-most k lookhead scanning derivation (k is omitted→it is 1) LR parsing is attractive because: -LR parsing is most general non-backtracking shift-reduce parsing,yet it is still efficient. The class of grammars that can be parsed using LR methods is a proper superset of the class of grammars that can be parsed with predictive parsers. LL(1)-Grammars C LR(1)-Grammars -An LR-parser can detect a syntactic error as soon as it is possible to do so a left-to-right scan of the input. CS308 Compiler Theory 12LR Parsers • Th f l hif he most powerful shift-red i ( ffi i ) i duce parsing (yet efficient) is: LR(k) parsing. left to right right-most k lookhead scanning derivation (k is omitted Î it is 1) • LR parsing is attractive because: – LR parsing is most general non-backtracking shift-reduce parsing, yet it is still efficient. – The class of grammars that can be parsed using LR methods is a proper superset of the class of g p pp rammars that can be parsed with predictive parsers. LL(1)-Grammars ⊂ LR(1)-Grammars – An LR-parser can detect a syntactic error as soon as it is possible to do so a left-to-right scan of the input CS308 Compiler Theory 12 scan of the input
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有