论文标题
smie:弱点是力量!:自动限制,带有不完整的信息
SMIE: Weakness is Power!: Auto-indentation with incomplete information
论文作者
论文摘要
源代码的自动凹痕从根本上是解析代码,然后应用有关各种构造相对缩进的语言和风格的规则的简单问题。 但是,实际上,由于语言的怪癖,或者由于代码在句法上不正确,或者是由于语法不完整或损坏的语法,因此全面解析并不总是是一种选择。 我介绍了Emacs简单的凹痕引擎(SMIE)的设计,该引擎从基础解析技术的弱点中获得了力量。 它可以进行本地解析,因此不受周围代码无关的影响。 面对不完整,错误或只是普通的有问题信息,这提供了一种优美的退化形式。
Automatic indentation of source code is fundamentally a simple matter of parsing the code and then applying language- and style-specific rules about relative indentation of the various constructs. Yet, in practice, full parsing is not always an option, either because of quirks of the language, or because the code is temporarily syntactically incorrect, or because of an incomplete or broken grammar. I present the design of Emacs's Simple-Minded Indentation Engine (SMIE), which gets its power from the weakness of the underlying parsing technique. It makes it possible to perform local parsing, which is hence unaffected by irrelevant surrounding code. This provides a form of graceful degradation in the face of incomplete, erroneous, or just plain problematic information.