TY - JOUR
T1 - FliPpr
T2 - A System for Deriving Parsers from Pretty-Printers
AU - Matsuda, Kazutaka
AU - Wang, Meng
N1 - Funding Information:
This work was mainly done when the K. Matsuda was at University of Tokyo, and the M. Wang was at Chalmers University of Technology. We thank Nils Anders Danielsson for his critical yet constructive comments on an earlier version of this work, without which the surface language probably would not exist. We also thank Janis Voigtländer and Akimasa Morihata for their insightful comments on deforestation. This work was partially supported by JSPS KAKENHI Grant numbers 24700020, 15K15966, and 15H02681. Part of this research was done when the K. Matsuda was visiting Chalmers University of Technology supported by Study Program at the Overseas Universities by Graduate School of Information Science and Technology, the University of Tokyo.
Publisher Copyright:
© 2018, Ohmsha, Ltd. and Springer Japan KK, part of Springer Nature.
PY - 2018/7/1
Y1 - 2018/7/1
N2 - When implementing a programming language, we often write a parser and a pretty-printer. However, manually writing both programs is not only tedious but also error-prone; it may happen that a pretty-printed result is not correctly parsed. In this paper, we propose FliPpr, which is a program transformation system that uses program inversion to produce a CFG parser from a pretty-printer. This novel approach has the advantages of fine-grained control over pretty-printing, and easy reuse of existing efficient pretty-printer and parser implementations.
AB - When implementing a programming language, we often write a parser and a pretty-printer. However, manually writing both programs is not only tedious but also error-prone; it may happen that a pretty-printed result is not correctly parsed. In this paper, we propose FliPpr, which is a program transformation system that uses program inversion to produce a CFG parser from a pretty-printer. This novel approach has the advantages of fine-grained control over pretty-printing, and easy reuse of existing efficient pretty-printer and parser implementations.
KW - Domain specific language
KW - Language design
KW - Parsing
KW - Pretty-printing
KW - Program inversion
KW - Program transformation
UR - http://www.scopus.com/inward/record.url?scp=85052667235&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85052667235&partnerID=8YFLogxK
U2 - 10.1007/s00354-018-0033-7
DO - 10.1007/s00354-018-0033-7
M3 - Article
AN - SCOPUS:85052667235
SN - 0288-3635
VL - 36
SP - 173
EP - 202
JO - New Generation Computing
JF - New Generation Computing
IS - 3
ER -