Compiler Front End Fusion: Undo Desugaring in Language Processing Tools

  • A. Poor Faculty of Informatics, Eötvös Loránd University, Budapest, Hungary
  • T. Kozsik Faculty of Informatics, Eötvös Loránd University, Budapest, Hungary
  • M. Toth Faculty of Informatics, Eötvös Loránd University, Budapest, Hungary
  • I. Bozo Faculty of Informatics, Eötvös Loránd University, Budapest, Hungary

Abstract

Compiler front ends often perform desugaring on the source code while constructing the abstract syntax tree (AST). A programming language processing tool (such as a refactoring tool) working with the desugared AST perceives the code at this abstract level, and loses information on the rich syntax used in the actual source code. This paper discusses the concept of front end fusion, a technique which may help language processing tools to retain the syntactic sugar information on the source code in the presence of desugaring compiler front ends. We propose a hybrid front end created from two separate front ends: one provided by the compiler, which offers type information, and another one, which provides the details of the concrete syntax used in the source code. Specifically, we show how to construct a hybrid front end in a language processing tool for the Scala programming language.

Published
2018-06-19
How to Cite
POOR, A. et al. Compiler Front End Fusion: Undo Desugaring in Language Processing Tools. Studia Universitatis Babeș-Bolyai Informatica, [S.l.], v. 63, n. 2, p. 5-20, june 2018. ISSN 2065-9601. Available at: <https://www.cs.ubbcluj.ro/~studia-i/journal/journal/article/view/25>. Date accessed: 26 apr. 2024. doi: https://doi.org/10.24193/subbi.2018.2.01.
Section
Articles