Abstract
When looking for solutions to automatically translate from high-level source to target code in heterogeneous programming environments and under budgetary restrictions, one often encounters the problem that affordable compilers with front-end support for a particular source language don’t map to the desired target-language. The goal of this paper is to present an approach for adapting existing compilers in a non-intrusive way that keeps the front-end intact and replaces the back-end with a component that supports the translation into any language with a context-free text-based syntax. This is achieved by introducing a domain-specific language for code generation to the compiler pipeline that offers a programmable interface to access internal representations of parsed source code in its programs. We formulate a set of requirements for this language and show how compiler developers can use the supplied interface in combination with the domain-specific language to adapt the textual output to their needs.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Arnoldus, B.J.: An illumination of the template enigma: software code generation with templates. Ph.D. thesis, Technische Universiteit Eindhoven (2010)
Bettini, L.: Implementing Domain-Specific Languages with Xtext and Xtend. Packt Publishing, Birmingham (2013)
Efftinge, S., Völter, M.: oAW xText: a framework for textual DSLs. In: Workshop on Modeling Symposium at Eclipse Summit, vol. 32, p. 118 (2006)
Garlan, D., Shaw, M.: An introduction to software architecture. Adv. Softw. Eng. Knowl. Eng. 1(3.4), 24 (1993)
Lattner, C., Adve, V.: LLVM: a compilation framework for lifelong program analysis & transformation. In: International Symposium on Code Generation and Optimization, CGO 2004, pp. 75–86. IEEE (2004)
Parr, T.J.: String template. http://www.stringtemplate.org/
Parr, T.J.: Enforcing strict model-view separation in template engines. In: Proceedings of the 13th International Conference on World Wide Web, pp. 224–233. ACM (2004)
Walkins, L.: asn1c. http://lionet.info/asn1c/
ASN.1: Specification of basic notation. International Standard X.680, ITU-T (2008)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing AG
About this paper
Cite this paper
Weber, D., Scheidgen, M., Fischer, J. (2016). Exchanging the Target-Language in Existing, Non-Metamodel-Based Compilers. In: Grabowski , J., Herbold, S. (eds) System Analysis and Modeling. Technology-Specific Aspects of Models . SAM 2016. Lecture Notes in Computer Science(), vol 9959. Springer, Cham. https://doi.org/10.1007/978-3-319-46613-2_13
Download citation
DOI: https://doi.org/10.1007/978-3-319-46613-2_13
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-46612-5
Online ISBN: 978-3-319-46613-2
eBook Packages: Computer ScienceComputer Science (R0)