首页 | 本学科首页   官方微博 | 高级检索  
     


Parsing Non-LR(k) grammars with yacc
Authors:Gary H. Merrill
Abstract:Of the parser generating tools currently in use, yacc (or one of its several variants) is perhaps the most frequently employed. However, because of inherent ambiguities there are some languages (such as C++) that a yacc-generated parser cannot successfully compile. This paper describes a set of minor modifications to yacc-like tools that allows them to be used in a straightforward way to parse ambiguities and, more generally, grammars that require an indefinite amount of lookahead. Required changes to the lexical analyzer are also discussed, and the application of these techniques is illustrated within the context of specific examples.
Keywords:Yacc  Parsers  Parser generators  Compilers  Ambiguity
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号