Please use this identifier to cite or link to this item:
https://hdl.handle.net/20.500.11851/9859
Title: | Indentation-Sensitive Parsing for Parsec (article) | Authors: | Adams, M.D. A?acan, O.S. |
Keywords: | indentation sensitivity layout offside rule parsec parsing Context free grammars Formal methods Syntactics Ad-hoc techniques Context-free grammars Formal foundation Haskell Indentation sensitivity Layout Offside rule Parsec Parsing Simple++ Semantics |
Publisher: | Association for Computing Machinery | Abstract: | Several popular languages including Haskell and Python use the indentation and layout of code as an essential part of their syntax. In the past, implementations of these languages used ad hoc techniques to implement layout. Recent work has shown that a simple extension to context-free grammars can replace these ad hoc techniques and provide both formal foundations and efficient parsing algorithms for indentation sensitivity. However, that previous work is limited to bottom-up, LR(k) parsing, and many combinator-based parsing frameworks including Parsec use top-down algorithms that are outside its scope. This paper remedies this by showing how to add indentation sensitivity to parsing frameworks like Parsec. It explores both the formal semantics of and efficient algorithms for indentation sensitivity. It derives a Parsec-based library for indentation-sensitive parsing and presents benchmarks on a real-world language that show its efficiency and practicality. © 2014 ACM. | URI: | https://doi.org/10.1145/2633357.2633369 https://hdl.handle.net/20.500.11851/9859 |
ISSN: | 1523-2867 |
Appears in Collections: | Scopus İndeksli Yayınlar Koleksiyonu / Scopus Indexed Publications Collection |
Show full item record
CORE Recommender
Items in GCRIS Repository are protected by copyright, with all rights reserved, unless otherwise indicated.