- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Elkhound: A Fast, PracticalGLR Parser Generator Scott McPeaksmcpeak@9/16/02 OSQ Lunch So what’s wrong with Bison? LALR(1) is the problem Restrictive subset of context-free grammars Grammar hacking breaks conceptual structure Can’t resolve conflicts automatically if actions are present LR is not closed under composition (union) Fixing LR conflicts is hard: time, expertise Ambiguous Grammars Use of ambiguity can simplify grammar e.g. “E ! E + E”, plus a rule for associativity Ambiguity can delay hard choices Type/variable name ambiguity in C: “(a) (b)” C++: constructors, function-style casts, etc. Other hard languages: Javascript, Perl Natural languages? Generalized LR (GLR) Developed in 80’s; natural language parsing Conceptually simple Uses any context-free grammar Ambiguous grammars ! parse forest Efficient: same as LR in best case Worst case: O(2n) Earley (1970) best is Q(n2), worst is O(n3) Review: LR Parsing “L”: left-to-right parsing of input “R”: build rightmost derivation (in reverse) Build parse tables ahead of time On each token, either shift it, pushing it onto the parse stack, or reduce symbols at top of stack, via some production Example: Arithmetic Example LR Parse GLR: Graph-structured stack Idea: pursue all possible parses at once Allow stack to be forked into multiple “parsers” Alternate between shifts and reduces If two parsers enter same state, merge them GLR: Graph-structured stack Idea: pursue all possible parses at once Allow stack to be forked into multiple “parsers” Alternate between shifts and reduces If two parsers enter same state, merge them Example GLR Parse Aside: Nondeterminism GLR extends LR by making the stack nondeterministic Other examples: DFA NFA finite control LL LR finite control LR GLR pushdown stack Optimization: Hybrid LR/GLR Full GLR is slower than LR due to the cost of interpreting the GSS But grammars are likely to be mostly deterministic (mostly linear stack) Question: How to recognize when deterministic
您可能关注的文档
- Efficient Storage of Defect Maps for Nanoscale Memory纳米级存储器缺陷映射的有效存储.pptx
- EGC safenglishEGC safenglish.files.wordpress.pptx
- EForms Dartmouth College电子窗体达特茅斯学院.pptx
- Egg Drop Challenge sharepoint产蛋下降的挑战 SharePoint.snoqualmie.k12.wa.us.ppt
- EFL Resource英语资源.ppt
- EGov Experience of US Canada电子政务的美国和加拿大的经验.ppt
- EGYPT AND MESOPOTAMIA Collin College科林学院埃及和美索不达米亚.ppt
- EGN1002 IntroductionEGN 1002 简介.pptx
- Egham Water Treatment Works UMass Amherst水处理工程埃格哈姆马萨诸塞大学阿默斯特分校.ppt
- Egypt Powerpoint Presentations for teachers埃及的PowerPoint演示文稿的教师.ppt
- Ellen G克. White and the Trinity Andrews University.ppt
- Elliptic Curves in Cryptography Er Net密码学中的椭圆曲线.pptx
- Ellen G克. White Andrews University.ppt
- Elizabethan London Clothes and Beauty Mary Adams伊丽莎白伦敦服装与美玛丽亚当斯.ppt
- Ellucian Banner System UNC State Grant Interface ellucian旗帜系统&UNC state格兰特界面.pptx
- ELSR 2013 Galaxy TrekJourney to the Center of the elsr 2013银河跋涉旅途to the Center of the.pptx
- ELLY kronberggymnasium艾莉博格体育馆.ppt
- Elusive Immigrants The Search for Irish Alsatian 难以捉摸的移民爱尔兰&阿尔萨斯搜索.ppt
- Elterninformation BEGYS gymnasiumwissenelterninformation begys高中知识.ppt
- Elvis Presley Marlington Local猫王marlington局域网.ppt
最近下载
- 高中政治必修三政治与法治重点知识点归纳总结(复习必背).docx VIP
- Unit6+Understanding+Ideas高中英语外研版(2019)必修第三册.pptx VIP
- 高中物理人教版高三一轮复习牛顿第二定律之板块模型.pptx VIP
- 05-吹瓶生产工艺Krones吹瓶教程.ppt VIP
- 中外合作办学的可行性报告.pdf VIP
- 2025年[指南]胃息肉 .pdf VIP
- 函数专题二次函数在闭区间上的最值问题(5大题型).docx VIP
- 3.5.2 二次函数在闭区间上的最值问题-(必修第一册) (教师版).docx VIP
- 2025年招标资格证考试题库及答案(通用版).pdf VIP
- 办公设备维保服务办公设备维保方案.doc VIP
文档评论(0)