SMIE: Weakness is Power!: Auto-indentation with incomplete information

06/04/2020
by   Stefan Monnier, et al.
0

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.

READ FULL TEXT

page 16

page 19

research
05/21/2021

Rule Augmented Unsupervised Constituency Parsing

Recently, unsupervised parsing of syntactic trees has gained considerabl...
research
03/16/2022

A Language-Independent Analysis Platform for Source Code

In this paper, we present the CPG analysis platform, which enables the t...
research
04/04/2023

Token-Level Fuzzing

Fuzzing has become a commonly used approach to identifying bugs in compl...
research
09/18/2019

Default Disambiguation for Online Parsers

Since composed grammars are often ambiguous, grammar composition require...
research
12/12/2018

Systematic Parsing of X.509: Eradicating Security Issues with a Parse Tree

X.509 certificate parsing and validation is a critical task which has sh...
research
11/20/2018

An empirical evaluation of AMR parsing for legal documents

Many approaches have been proposed to tackle the problem of Abstract Mea...
research
01/31/2018

Recognising and Generating Terms using Derivatives of Parsing Expression Grammars

Grammar-based sentence generation has been thoroughly explored for Conte...

Please sign up or login with your details

Forgot password? Click here to reset