Domain Specific Languages and Their Type Systems

Total Page:16

File Type:pdf, Size:1020Kb

Domain Specific Languages and Their Type Systems Domain specific languages and their type systems Citation for published version (APA): Meer, van der, A. P. (2014). Domain specific languages and their type systems. Technische Universiteit Eindhoven. https://doi.org/10.6100/IR778421 DOI: 10.6100/IR778421 Document status and date: Published: 01/01/2014 Document Version: Publisher’s PDF, also known as Version of Record (includes final page, issue and volume numbers) Please check the document version of this publication: • A submitted manuscript is the version of the article upon submission and before peer-review. There can be important differences between the submitted version and the official published version of record. People interested in the research are advised to contact the author for the final version of the publication, or visit the DOI to the publisher's website. • The final author version and the galley proof are versions of the publication after peer review. • The final published version features the final layout of the paper including the volume, issue and page numbers. Link to publication General rights Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. • Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain • You may freely distribute the URL identifying the publication in the public portal. If the publication is distributed under the terms of Article 25fa of the Dutch Copyright Act, indicated by the “Taverne” license above, please follow below link for the End User Agreement: www.tue.nl/taverne Take down policy If you believe that this document breaches copyright please contact us at: [email protected] providing details and we will investigate your claim. Download date: 29. Sep. 2021 Domain Specific Languages and their Type Systems PROEFSCHRIFT ter verkrijging van de graad van doctor aan de Technische Universiteit Eindhoven, op gezag van de rector magnificus prof.dr.ir. C.J. van Duijn, voor een commissie aangewezen door het College voor Promoties, in het openbaar te verdedigen op maandag 10 november 2014 om 16:00 uur door Arjan Pieter van der Meer geboren te Voorburg Dit proefschrift is goedgekeurd door de promotoren en de samenstelling van de promotiecommissie is als volgt: voorzitter: prof.dr. E.H.L. Aarts 1e promotor: prof.dr. M.G.J. van den Brand 2e promotor: prof.dr.ir. J.F. Groote copromotor(en): dr. A. Serebrenik leden: dr. ir. J.P.M. Voeten prof. dr. P.D. Mosses(Swansea University) prof.dr. M. Mernik(University of Maribor) adviseur(s): prof. dr. ir. J.E. Rooda Domain Specific Languages and their Type Systems Arjan Pieter van der Meer The work in the thesis has been carried out under the auspices of the research school IPA (Institute for Programming research and Algorithmics) IPA dissertation series 2014-10. A catalogue record is available from the Eindhoven University of Technology Library ISBN: 978-90-386-3677-1 © A. P. van der Meer, 2013 Printed by the print service of the Eindhoven University of Technology Cover design based on Wirefox © Alexander Tibus, 2005 Acknowledgements During the writing and preparation of this thesis, I received the support of many people. I would like to thank in particular: • my first promotor, Mark van den Brand, for both the opportunity to do this PhD project and for the many discussions and comments through the years. • my daily supervisor and copromotor, Alexander Serebrenik, for all the advice and innumerable review comments. • our contact with the CIF developers, Albert Hofkamp, for the helpful discusions and contributions. • the second Jan Friso Groote, for agreeing to be a member of the PhD committee and for the many helpful comments on this thesis. • the other members of the PhD committee, Marian Mernik, Peter Mosses, Jeroen Voeten and Koos Rooda, for their helpful comments. • the fellow PhD students and officemates of the SET group through the years, in no particular order:1 Marcel van Amstel, Jeroen Arnoldus, John Businge, Yanja Dajsuren, Luc Engelen, Yapin Luo, Maarten Manders, Zvezdan Protic, Ulyana Tikhonova and Bogdan Vasilescu, for their con- tributions and comradeship. • my brother and sister, Stefan and Anne Marije, for agreeing to aid me as paranymphs during the defense, and for their support through the years. • and finally my parents, Jan and Anneke, for their unwavering support. 1Well, technically speaking with last names in alphabetical order, but that is still not a particularly significant order. i ii Contents 1 Introduction 1 1.1 Software Construction . .1 1.2 Implementation . .4 1.3 Problem statement . .9 1.4 Research questions . 10 1.5 Thesis outline . 11 2 Requirements of Type System Specifications 13 2.1 Introduction . 13 2.2 Systematic Literature Review of Existing DSL Type Systems . 14 2.3 Stakeholders . 35 2.4 Requirements . 37 2.5 Conclusions . 38 3 MSOS as Type System Definition Language 41 3.1 Introduction . 41 3.2 Preliminaries . 45 3.3 MSOS and MSDF: Specifying a Type Checker . 48 3.4 Evolution of numerical types in Chi . 51 3.5 Typechecking Chi in MSOS . 52 3.6 MMT Prototype Implementation . 59 3.7 ASF+SDF Prototype Implementation . 60 3.8 Related work . 65 3.9 Conclusion . 66 4 EMF/EMF-TL Introduction 69 4.1 Introduction . 69 4.2 EMF . 70 4.3 DSL for type system specification . 73 4.4 EMF-TL semantics . 85 4.5 Implementation of EMF-TL semantics . 105 4.6 Related work . 110 4.7 Conclusions . 113 iii 5 Case studies 115 5.1 Introduction . 115 5.2 Case Study: CIF expressions . 118 5.3 Case Study: WebDSL . 123 5.4 Case Study: mCRL2 . 130 5.5 Case Study: POOSL . 141 5.6 Conclusion . 153 6 Conclusions 157 6.1 Contributions . 157 6.2 Directions for future research . 161 A Type system for SLCO 175 B Type system for CIF 179 C Type system for WebDSL 207 D Type system for mCRL2 219 E Type system for POOSL 231 F Summary 247 G Samenvatting 251 iv Chapter 1 Introduction In order to make use of any computer, we need software to control its operation. One approach to constructing such software is Model Driven Engineering or MDE. In MDE, models created using Domain Specific Languages (DSLs) play a central role. Because they are domain-specific, a large number of DSLs are needed to cover all use cases. Each of these DSLs has its own definition, and needs a separate set of tools to implement it. In this thesis, we will investigate one part of a DSL definition, the type system, and its implementation, the type checker. Our goal is to identify a specification formalism that can be used define type systems in an elegant and clear way, and that can support evolution of both its design and the corresponding tools. 1.1 Software Construction In many disciplines, computers are used to do tasks that are too large, too complex or too repetitive for humans to perform efficiently. In order for a computer to perform a task, it needs a set of instructions that specify what the task is and how it should be completed. The descriptions of tasks are called programs, and a group of programs is collectively known as software. The larger the task, the more software is needed to describe it, and the more complex it becomes to construct that software. This increasing complexity means software gets both more expensive and more error-prone. This in turn has led to the development of tools and methodologies intended to reduce the complexity of software during design and development. Model Driven Engineering One such methodology for software construction is Model Driven Engineering1 or MDE [5,15]. The primary observation of MDE is that the larger the software 1While the definition of MDE does not necessarily exclude disciplines other than software engineering, that is the primary area where it is used. 1 system becomes, the more different areas of expertise, also known as domains, it involves. If we try to combine all these different domains into one artifact, the result is, unsurprisingly, large and hard to understand. MDE advocates separat- ing all domains into their own domain models. By clearly defining models and their relations, MDE aims to improve communication about software systems, reuse of components and increase the compatibility of software systems made by different companies or different development teams. To achieve this, MDE advocates the use of models in every step of the design and development of software. Initially, these models mainly consist of concepts from the domain of the problem that the software is intended to solve. During development, these models are refined by adding more and more concepts from the domain of the implementation, where the problem will be actually solved. In order to do this efficiently, software engineers can create model transfor- mations. Model transformations are automated operations that construct new models based on old ones. If we know, for example, how to represent concepts from a problem domain in an implementation domain, we can create a trans- formation to convert entire models from one domain to another without human intervention. In order to talk about relations between concepts in different domains, we first need to define those concepts. In particular, if we want to use model trans- formations, we need to know all concepts that a particular model might contain, in order to ensure that all the information of the model can be transferred to the new model.
Recommended publications
  • The Design & Implementation of an Abstract Semantic Graph For
    Clemson University TigerPrints All Dissertations Dissertations 12-2011 The esiD gn & Implementation of an Abstract Semantic Graph for Statement-Level Dynamic Analysis of C++ Applications Edward Duffy Clemson University, [email protected] Follow this and additional works at: https://tigerprints.clemson.edu/all_dissertations Part of the Computer Sciences Commons Recommended Citation Duffy, Edward, "The eD sign & Implementation of an Abstract Semantic Graph for Statement-Level Dynamic Analysis of C++ Applications" (2011). All Dissertations. 832. https://tigerprints.clemson.edu/all_dissertations/832 This Dissertation is brought to you for free and open access by the Dissertations at TigerPrints. It has been accepted for inclusion in All Dissertations by an authorized administrator of TigerPrints. For more information, please contact [email protected]. THE DESIGN &IMPLEMENTATION OF AN ABSTRACT SEMANTIC GRAPH FOR STATEMENT-LEVEL DYNAMIC ANALYSIS OF C++ APPLICATIONS A Dissertation Presented to the Graduate School of Clemson University In Partial Fulfillment of the Requirements for the Degree Doctor of Philosophy Computer Science by Edward B. Duffy December 2011 Accepted by: Dr. Brian A. Malloy, Committee Chair Dr. James B. von Oehsen Dr. Jason P. Hallstrom Dr. Pradip K. Srimani In this thesis, we describe our system, Hylian, for statement-level analysis, both static and dynamic, of a C++ application. We begin by extending the GNU gcc parser to generate parse trees in XML format for each of the compilation units in a C++ application. We then provide verification that the generated parse trees are structurally equivalent to the code in the original C++ application. We use the generated parse trees, together with an augmented version of the gcc test suite, to recover a grammar for the C++ dialect that we parse.
    [Show full text]
  • Application of Graph Databases for Static Code Analysis of Web-Applications
    Application of Graph Databases for Static Code Analysis of Web-Applications Daniil Sadyrin [0000-0001-5002-3639], Andrey Dergachev [0000-0002-1754-7120], Ivan Loginov [0000-0002-6254-6098], Iurii Korenkov [0000-0002-8948-2776], and Aglaya Ilina [0000-0003-1866-7914] ITMO University, Kronverkskiy prospekt, 49, St. Petersburg, 197101, Russia [email protected], [email protected], [email protected], [email protected], [email protected] Abstract. Graph databases offer a very flexible data model. We present the approach of static code analysis using graph databases. The main stage of the analysis algorithm is the construction of ASG (Abstract Source Graph), which represents relationships between AST (Abstract Syntax Tree) nodes. The ASG is saved to a graph database (like Neo4j) and queries to the database are made to get code properties for analysis. The approach is applied to detect and exploit Object Injection vulnerability in PHP web-applications. This vulnerability occurs when unsanitized user data enters PHP unserialize function. Successful exploitation of this vulnerability means building of “object chain”: a nested object, in the process of deserializing of it, a sequence of methods is being called leading to dangerous function call. In time of deserializing, some “magic” PHP methods (__wakeup or __destruct) are called on the object. To create the “object chain”, it’s necessary to analyze methods of classes declared in web-application, and find sequence of methods called from “magic” methods. The main idea of author’s approach is to save relationships between methods and functions in graph database and use queries to the database on Cypher language to find appropriate method calls.
    [Show full text]
  • Dense Semantic Graph and Its Application in Single Document Summarisation
    Dense Semantic Graph and its Application in Single Document Summarisation Monika Joshi1, Hui Wang1 and Sally McClean2 1 University of Ulster, Co. Antrim, BT37 0QB, UK [email protected] , [email protected] 2 University of Ulster, Co. Londonderry, BT52 1SA, UK [email protected] Abstract Semantic graph representation of text is an important part of natural language processing applications such as text summarisation. We have studied two ways of constructing the semantic graph of a document from dependency parsing of its sentences. The first graph is derived from the subject-object-verb representation of sentence, and the second graph is derived from considering more dependency relations in the sentence by a shortest distance dependency path calculation, resulting in a dense semantic graph. We have shown through experiments that dense semantic graphs gives better performance in semantic graph based unsupervised extractive text summarisation. 1 Introduction Information can be categorized into many forms -- numerical, visual, text, and audio. Text is abundantly present in online resources. Online blogs, Wikipedia knowledge base, patent documents and customer reviews are potential information sources for different user requirements. One of these requirements is to present a short summary of the originally larger document. The summary is expected to include important in- formation from the original text documents. This is usually achieved by keeping the informative parts of the document and reducing repetitive information. There are two types of text summarization: multiple document summarisation and single document summarization. The former is aimed at removing repetitive content in a collection of documents.
    [Show full text]
  • Autowig: Automatic Generation of Python Bindings for C++ Libraries
    AutoWIG: automatic generation of python bindings for C++ libraries Pierre Fernique and Christophe Pradal EPI Virtual Plants, Inria, Montpellier, France AGAP, CIRAD, INRA, Montpellier SupAgro, Univ Montpellier, Montpellier, France ABSTRACT Most of Python and R scientific packages incorporate compiled scientific libraries to speed up the code and reuse legacy libraries. While several semi-automatic solutions exist to wrap these compiled libraries, the process of wrapping a large library is cumbersome and time consuming. In this paper, we introduce AutoWIG, a Python package that wraps automatically compiled libraries into high-level languages using LLVM/Clang technologies and the Mako templating engine. Our approach is auto- matic, extensible, and applies to complex C++ libraries, composed of thousands of classes or incorporating modern meta-programming constructs. Subjects Data Science, Scientific Computing and Simulation, Programming Languages, Software Engineering Keywords C++, Python, Automatic bindings generation INTRODUCTION Many scientific libraries are written in low-level programming languages such as C and C++. Such libraries entail the usage of the traditional edit/compile/execute cycle in order to produce high-performance programs. This leads to lower computer processing time at the cost of high scientist coding time. At the opposite end of the spectrum, scripting languages such as MATLAB, Octave (John, David Bateman & Wehbring, 2014, Submitted 6 July 2017 Accepted 26 February 2018 for numerical work) Sage (The Sage Developers, 2015, for symbolic mathematics), R (R Published 2 April 2018 Core Team, 2014, for statistical analyses) or Python (Oliphant, 2007, for general purposes) Corresponding author provide an interactive framework that allows data scientists to explore their data, test new Pierre Fernique, [email protected] ideas, combine algorithmic approaches and evaluate their results on the fly.
    [Show full text]
  • DART@AI*IA 2013 Proceedings
    Cristian Lai, Giovanni Semeraro, Alessandro Giuliani (Eds.) Proceedings of the 7th International Workshop on Information Filtering and Retrieval Workshop of the XIII AI*IA Conference December 6, 2013 Turin, Italy http://aixia2013.i-learn.unito.it/course/view.php?id=26 i Preface The series of DART workshops provides an interactive and focused platform for researchers and practitioners for presenting and discussing new and emerging ideas. Focusing on research and study on new challenges in intelligent information filtering and retrieval, DART aims to investigate novel systems and tools to web scenarios and semantic computing. Therefore, DART contributes to discuss and compare suitable novel solutions based on intelligent techniques and applied in real-world applications. Information Retrieval attempts to address similar filtering and ranking problems for pieces of information such as links, pages, and documents. Information Retrieval systems generally focus on the development of global retrieval techniques, often neglecting individual user needs and preferences. Information Filtering has drastically changed the way information seekers find what they are searching for. In fact, they effectively prune large information spaces and help users in selecting items that best meet their needs, interests, preferences, and tastes. These systems rely strongly on the use of various machine learning tools and algorithms for learning how to rank items and predict user evaluation. Submitted proposals received two or three review reports from Program Committee members. Based on the recommendations of the reviewers, 7 full papers have been selected for publication and presentation at DART 2013. When organizing a scientific conference, one always has to count on the efforts of many volunteers.
    [Show full text]
  • Graph-Based Source Code Analysis of Javascript Repositories
    Budapest University of Technology and Economics Faculty of Electrical Engineering and Informatics Department of Measurement and Information Systems Graph-Based Source Code Analysis of JavaScript Repositories Master’s Thesis Author: Dániel Stein Supervisors: Gábor Szárnyas Ádám Lippai Dávid Honfi 2016 ii Contents Contents ii Kivonat v Abstract vi 1 Introduction1 1.1 Context.......................................... 1 1.2 Problem Statement................................... 2 1.3 Objectives and Contributions............................. 2 1.4 Structure of the Thesis................................. 3 2 Preliminaries4 2.1 JavaScript......................................... 4 2.1.1 From Glue Language to a Full-Fledged Language............ 4 2.1.2 ECMAScript .................................. 4 2.2 Static Analysis...................................... 5 2.2.1 Use Cases.................................... 6 2.2.2 Advantages and Disadvantages....................... 6 2.2.3 Source Code Processing and Analysis................... 7 2.3 Handling Large Interconnected Data ........................ 12 2.3.1 On Graph Computing............................. 12 2.3.2 Evaluating Queries on a Data Structure.................. 14 2.3.3 Graph Databases ............................... 15 2.4 Integrated Development Environment (IDE).................... 17 2.4.1 Visual Studio Code .............................. 17 2.4.2 Alternative IDEs................................ 18 3 Related Work 20 3.1 Static Analysis Frameworks.............................. 20 3.1.1 Tern......................................
    [Show full text]
  • CODE REFACTORING UNDER CONSTRAINTS by YAN LIANG
    CODE REFACTORING UNDER CONSTRAINTS by YAN LIANG NICHOLAS A. KRAFT, CO-CHAIR RANDY K. SMITH, CO-CHAIR JEFFREY C. CARVER ALLEN S. PARRISH UZMA RAJA A DISSERTATION Submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy in the Department of Computer Science in the Graduate School of The University of Alabama TUSCALOOSA, ALABAMA 2011 Copyright Yan Liang 2011 ALL RIGHTS RESERVED ABSTRACT Code refactoring is the process of changing the internal structure of the program without changing its external behaviors. Most refactoring tools ensure behavior preservation by enforcing preconditions that must hold for the refactoring to be valid. However, their approaches have three drawbacks that make the refactoring results far from satisfactory and reduce the utilization of refactoring tools in practice. Firstly, programmers are not sure how code will be changed by those tools due to the invisible refactoring rules hidden behind the interfaces of tools. Secondly, current refactoring tools have limited extensibility to accommodate new refactorings. Lastly, most refactoring tools lack mechanisms to allow programmer to specify their own preconditions to indicate as to which properties of a program are of interest. We consider refactoring a code change activity that, as with other constraints imposed on code during software development and maintenance such as naming rules, should be visible, easily extensible, and adaptable. It should also combine the developers’ opinions, implementation styles of existing code and other good coding practice. We propose a model- based approach to precondition specification and checking in which preconditions can be declared explicitly and dynamically against the designated program metamodel, and verified against concrete program models.
    [Show full text]
  • Final Thesis Jugraj Singh Vfinal
    Computational Augmentation of Model Based System Engineering Supporting Mechatronic System Model Development with AI Technologies Mechatronics Research Centre Faculty of Technology De Montfort University, United Kingdom This thesis is submitted in partial fulfilment of the requirements of De Montfort University for the award of Doctor of Philosophy December, 2019 By: Jugraj Singh Table of Contents Introduction .......................................................................................................................... 11 1.1. Introduction ................................................................................................................................ 11 1.2. Motivation and Background....................................................................................................... 12 1.2.1. Research Gap ...................................................................................................................... 15 1.3. Research Scope .......................................................................................................................... 18 1.4. Research Aims and Objectives .................................................................................................. 20 1.5. Chapters Overview ..................................................................................................................... 21 Literature review .................................................................................................................. 22 2.1. System Engineering and MBSE
    [Show full text]
  • Code Structure Visualization
    Eindhoven University of Technology MASTER Code structure visualization Lommerse, G.L.P.M. Award date: 2005 Link to publication Disclaimer This document contains a student thesis (bachelor's or master's), as authored by a student at Eindhoven University of Technology. Student theses are made available in the TU/e repository upon obtaining the required degree. The grade received is not published on the document as presented in the repository. The required complexity or quality of research of student theses may vary by program, and the required minimum study period may vary in duration. General rights Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. • Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain TECHNISCHE UNIVERSITEIT EINDHOVEN Department of Mathematics and Computer Science MASTER’S THESIS Code Structure Visualization by G.L.P.M. Lommerse Supervisor: Dr. Ir. A.C. Telea (TUE) Eindhoven, August 2005 Abstract This thesis describes a tool that helps programmers to get insight in software projects and also helps them to manage projects. The tool, called Code Structure Visualizer (CSV), visualizes the structure of source code by augmenting a textual representation of source code with a graphical representation of the structure.
    [Show full text]
  • Languages, Applications and Technologies
    IV Symposium on Languages, Applications and Technologies June 18th and 19th, 2015 Universidad Complutense de Madrid, Spain Editors: José-Luis Sierra-Rodríguez José Paulo Leal Alberto Simões ISBN: 978-84-606-8762-7 II Schedule and Table of Contents Thursday, 18th June Time Page 8h45 Registration 9h15 Opening Session 9h30 Keynote I chair: José Paulo Leal The role of ontologies in machine-machine communication. 1 Asunción Gómez 10h40 Coffee Break Session I: Document Processing chair: José João Almeida 11h00 Tree String Path Subsequences Automaton and Its Use for Indexing XML Documents ........................................................... 3 Eliška Šestáková and Jan Janousek 11h25 A structural approach to assess graph-based exercises ..................... 13 José Paulo Leal and Rúben Sousa 11h50 Automatic generation of CVs from Online Social Networks. 23 Sérgio Maia Dias, Alda Lopes Gançarski and Pedro Rangel Henriques 12h10 Knowledge Extraction from Requirements Specification................... 29 Eduardo Barra and Jorge Morato Session II: Domain-Specific Languages chair: Marjan Mernik 12h30 Domain Specific Languages for Data Mining: A Case Study for Educational Data Mining.......................................................... 35 Alfonso de la Vega, Diego García-Saiz, Marta Zorrilla and Pablo Sanchez 12h55 WSDLUD: A Metric to Measure the Understanding Degree of WSDL Descriptions.......................................................... 45 M. Berón, H. Bernardis, E. Miranda, D. Riesco, M. J. Varanda Pereira and P. Henriques 13h20 Towards the generation of graphical modelling environments aided by patterns 55 Antonio Garmendia, Ana Pescador, Esther Guerra and Juan De Lara 13h40 Lunch III Time Page Session III: Tools for Natural Language Speech and Text processing chair: Hugo Gonçalo Oliveira 15h00 Speech Features for Discriminating Stress Using Branch and Bound Wrapper Search...............................................................
    [Show full text]
  • Towards a Generic Framework for Trustworthy Program Refactoring∗
    Acta Cybernetica | online–first paper version | pages 1{27. Towards a Generic Framework for Trustworthy Program Refactoring∗ D´anielHorp´acsiab, Judit K}oszegi,b and D´avidJ. N´emethb Abstract Refactoring has to preserve the dynamics of the transformed program with respect to a particular definition of semantics and behavioural equivalence. In general, it is rather challenging to relate executable refactoring implemen- tations with the formal semantics of the transformed language. However, in order to make refactoring tools trustworthy, we may need to provide formal guarantees on correctness. In this paper, we propose high-level abstractions for refactoring definition and we outline a generic framework which is capable of verifying and executing refactoring specifications. By separating the var- ious concerns in the transformation process, our approach enables modular and language-parametric implementation. Keywords: refactoring, domain-specific language, refactoring methodology, formal verification 1 Introduction The idea of refactoring is as old as high-level programming. A program refac- toring [7] is typically meant to improve non-functional properties, such as the in- ternal structure or the appearance, of a program without changing its observable behaviour. Tool support is necessary for refactoring in large-scale: it has to be en- sured that program changes are complete and sound, the behaviour is intact and no bugs are introduced or eliminated by the transformations. Refactoring tools may carry out extensive modifications in large projects, which are hard to be performed or comprehended by humans. ∗The research has been supported by the European Union, co-financed by the European Social Fund (EFOP-3.6.2-16-2017-00013, Thematic Fundamental Research Collaborations Grounding Innovation in Informatics and Infocommunications).
    [Show full text]
  • Transformational Generation of Language Plug-Ins in the Harmonia Framework
    Transformational Generation of Language Plug-ins in the Harmonia Framework Andrew Begel Marat Boshernitsan Susan L. Graham Report No. UCB/CSD-05-1370 January 2005 Computer Science Division (EECS) University of California Berkeley, California 94720 Transformational Generation of Language Plug-ins in the Harmonia Framework Andrew Begel∗ Marat Boshernitsan Susan L. Graham Report No. UCB/CSD-05-1370 Computer Science Division, EECS University of California, Berkeley Berkeley, CA 94720-1776, USA abegel,maratb,graham @cs.berkeley.edu { } January 2005 Abstract The Harmonia framework provides an infrastructure for building language-aware interactive programming tools. Harmonia supports many languages through language plug-ins, which are dynamically-loadable system extensions generated from lexical, syntactic, and semantic descriptions. In this report, we describe our approach to generating Harmonia language plug-ins from a variety of domain-specific description languages. We present the process of configuring plug-in analysis components, the transformations for high-level syntactic and semantic descriptions, and the optimizations for generated code. This largely ad- hoc process makes our generation techniques expensive to create and difficult to maintain. We propose a new component-based architecture based on transformational generation, present its benefits, and outline several research directions that still need to be addressed by the generative programming community. ∗This work was supported in part by NSF Grant CCR-0098314 and by an IBM Eclipse Innovation Grant. Contents 1 Introduction 1 2 Language Plug-in Generation 2 2.1 Domain-specific Concepts in Programming Language Implementation . 2 2.2ConfigurationofPlug-InFeatures.................................. 2 2.2.1 LexerandParserConfiguration............................... 3 2.2.2 ConfigurationofRuntimeDataStructures......................... 3 2.3GrammarTransformation:EBNFtoBNF............................
    [Show full text]