120 research outputs found

    Memory Optimization in the JastAdd Metacompiler

    Get PDF
    JastAdd is a tool for generating programming language compilers. These compilers generally use more memory than other compilers for the same language. In this thesis we have categorized the memory use of two JastAdd-generated compilers, to identify opportunities to reduce their memory use. We present several optimizations for reducing the memory use of these compilers. These include changes to the runtime representation of the AST and memoization in the code generated by JastAdd. We have implemented the optimizations in JastAdd and benchmarked their performance with respect to memory use and execution time. We see an overall reduction of the optimizable memory use for the two compilers of approximately 5% and 24%.Detta arbete undersöker och utvÀrderar nya metoder för att minska minnesanvÀnd- ningen i kompilatorer genererade med metakompilatorsystemet JastAdd

    Contributions to the Construction of Extensible Semantic Editors

    Get PDF
    This dissertation addresses the need for easier construction and extension of language tools. Specifically, the construction and extension of so-called semantic editors is considered, that is, editors providing semantic services for code comprehension and manipulation. Editors like these are typically found in state-of-the-art development environments, where they have been developed by hand. The list of programming languages available today is extensive and, with the lively creation of new programming languages and the evolution of old languages, it keeps growing. Many of these languages would benefit from proper tool support. Unfortunately, the development of a semantic editor can be a time-consuming and error-prone endeavor, and too large an effort for most language communities. Given the complex nature of programming, and the huge benefits of good tool support, this lack of tools is problematic. In this dissertation, an attempt is made at narrowing the gap between generative solutions and how state-of-the-art editors are constructed today. A generative alternative for construction of textual semantic editors is explored with focus on how to specify extensible semantic editor services. Specifically, this dissertation shows how semantic services can be specified using a semantic formalism called refer- ence attribute grammars (RAGs), and how these services can be made responsive enough for editing, and be provided also when the text in an editor is erroneous. Results presented in this dissertation have been found useful, both in industry and in academia, suggesting that the explored approach may help to reduce the effort of editor construction

    Reusing Semantics in Visual Editors: A Case for Reference Attribute Grammars

    Get PDF
    The semantic formalism reference attribute grammars (RAGs) allows graphs to be superimposed on abstract syntax trees. This paper investigates how RAGs can be used to model visual languages, with a case study of a control language that also has a textual syntax. The language contains blocks on which a total execution order is defined based on connections and layout information. One strength of RAGs is reusability, and we demonstrate this by reusing the definition of the execution order in the visual editor to provide semantic feedback to the user

    Creating a readable language for checking XML

    Get PDF
    Today sharing data is done everywhere. Doctors might want to share patient journal information. Patient journals may contain sensitive information that doctors do not want to share. The journals needs to be checked before they are shared. In this thesis, data and journals are coded in XML and checking journals and data is the same as validating XML. Validating XML documents is usually done by following rules from a validator. A validator processes XML documents and checks that the XML documents follows the validation rules. The issue with most validators today is that they cannot compare arbitrary elements in the XML document with each other and there are no mathematical operations to supply these comparisons. Sometimes there is a need to verify the validation rules. This might be done by someone who has little programming skills. The validator has to be readable so that this someone can verify that the validator matches the requirements. This thesis attempts to solve the issue with existing solutions by creating a readable language for validating XML documents. The solution is done in three steps: investigating similar solutions, implementing a validator, and testing the readability of the validator with a usability test.Idag delar man mycket information med varandra och ibland behöver vi se till att rÀtt sorts information delas. TÀnk om man t. ex rÄkar skicka sitt personnummer istÀllet för telefonnummer till nÄgon? Detta examensarbetet handlar om att utveckla ett enkelt verktyg som bekrÀftar att information som delas Àr rÀtt formad. Eftersom det blir viktigare att vara sÀker pÄ att information som delas Àr formad pÄ rÀtt sÀtt sÄ kommer fler mÀnniskor att komma i kontakt med att bekrÀfta information innan de delar den. Det finns en del verktyg som kan bekrÀfta information Ät dig men i vissa fall rÀcker inte dessa verktyg. Ett tillÀmpningsomrÄde Àr sjukhusjournaler. En lÀkare kanske vill dela med sig av ett specifikt fall, i t. ex utbildningssyfte, genom att skicka en patientjournal till en kollega. En patientjournal innehÄller mycket information om en patient som en lÀkare kanske inte kan eller vill dela, exempelvis patientens identitet. AlltsÄ anvÀnder lÀkaren ett program genererat med verktyget frÄn detta examensarbetet för att bekrÀfta att all privat (och annan potentiellt onödig) information inte finns med i journalen som lÀkaren tÀnker skicka. Företaget som examensarbetet utfördes pÄ, Advenica, har ett testfall som krÀver mer komplexa berÀkningar Àn vad dagens verktyg klarar av. Om det Àr viktigt att information bekrÀftas pÄ ett sÀkert sÀtt Àr det viktigt att nÄgon ser pÄ verktyget sÄ att det gör det som den verkligen ska göra. Idag Àr de flesta verktygen svÄrlÀsliga vilket gör det svÄrt att förstÄ om det som verktyget gör Àr korrekt. Examensarbetet resulterade i ett verktyg som skapar program som bekrÀftar om information som ska delas Àr formad pÄ rÀtt sÀtt. Verktyget anvÀnds genom att nÄgon, en programmerare med kunskap i Àmnet, skriver regler som sen anvÀnds för att generera ett program som bekrÀftar information. Reglerna Àr gjorda för att vara lÀttlÀsliga sÄ mÀnniskor utan programmeringsbakgrund kan förstÄ och kontrollera att reglerna Àr korrekt skrivna. De behöver inte skriva reglerna sjÀlva, det gör programmeraren. Programmen som genereras tar informationen och sÀger till anvÀndaren om informationen Àr formad pÄ rÀtt sÀtt. Om informationen inte Àr formad pÄ rÀtt sÀtt mÄste anvÀndaren Àndra informationen tills programmet accepterar informationen. Verktyget som utvecklas har tvÄ egenskaper som inte andra verktyg har: komplexa matematiska berÀkningar, nÀr man bekrÀftar information, samt att reglerna som verktyget tar Àr lÀttlÀsliga. Med hjÀlp av matematiska berÀkningar kan man se att informationen stÀmmer överens med mer komplexa krav. Exempelvis kan man berÀkna strÀckan mellan tvÄ koordinater pÄ jorden med hjÀlp av de matematiska berÀkningarna. Eftersom verktygets regler Àr lÀtta att kontrollera sÄ Àr det enkelt att lÄta en utomstÄende person se pÄ reglerna och sÀga om det Àr rÀtt regler för rÀtt syfte

    The Design and Implementation of Bloqqi - A Feature-Based Diagram Programming Language

    Get PDF
    This dissertation presents the design and implementation of a new block diagram programming language, Bloqqi, for building control systems with focus on variability. The language has been developed in collaboration with industry with the goal of reducing engineering time and improving reuse of functionality.When building a control system for a plant, there are typically different variants of the same base functionality. A plant may have several variants of a tank, for example, one variant with heating and another one without. This dissertation presents novel language mechanisms for describing this kind of variability, based on diagram inheritance. For instance, Bloqqi supports specifying what features, like heating, the base functionality can have. These specifications are then used to automatically derive smart-editing support in the form of a feature-based wizard. In this wizard, the user can select what features the base functionality should have, and code is generated corresponding to these features. The new language mechanisms allow feature-based libraries to be created and extended in a modular way.This dissertation presents techniques for implementing rich graphical editors with smart editing support based on semantic analysis. A prototype compiler and graphical editor have been implemented for the language, using the semantic formalism reference attribute grammars (RAGs). RAGs allow tools to share the semantic specifications, which makes it possible to modularly extend the compiler with support for advanced semantic feedback to the user of the graphical editor

    Towards the Humanisation of Programming Tool Interactions

    Get PDF
    Program analysis tools, from simple static semantic analysis by a compiler, to complex dynamic analyses of data flow and security, have become commonplace in modern day programming. Many of the simpler analyses, such as the afore- mentioned compiler checking or linters designed to enforce code style, may even go unnoticed or unconsidered by most users, ubiquitous as they are. Despite this, and despite the obvious utility that such programming tools can provide, many warnings provided by them go unheeded by programmers most of the time.There are several reasons for this phenomenon: the propensity to produce false positives undermines confidence in the validity of warnings, the tools do not in- tegrate well into the normal workflow of the developer, sometimes the warning message is simply too esoteric for most users to understand, and so on. A com- mon theme can be drawn from these reasons for ignoring the often-times very useful information given by a programming tool: the tool itself is difficult to use.In this thesis, we consider ways in which we can bridge this gap between users and tools. To do this, we draw from observations about the way in which we interact with each other in the most basic human-to-human context. Applying these lessons to a human-tool interaction allow us to examine ways in which tools may be deficient, and investigate methods for making the interaction more natural and human-like.We explore this issue by framing the interaction as a "conversation" between a human and their development environment. We then present a new programming tool, Progger, built using design principles driven by the "conversational lens" which we use to look at these interactions. After this, we present a user study using a novel low-cost methodology, aimed at evaluating the efficacy of the Progger tool. From the results of this user study, we present a new, more streamlined version of Progger, and finally investigate the way in which it can be used to direct the users attention when conducting a code comprehension exercise

    Designing a flexible compilation framework for cal language

    Get PDF
    The CAL, created as a part of the Ptolemy II project, is an open source actor-based data-flow language. Some of its contributors are Xilinx, Ericsson research, and the MPEG-consortium. More information about CAL can be found at opendf.org. Today there exist several back ends for CAL, all share a common front end, which translates the CAL language to an intermediate format called XLIM. The back end then translates XLIM to the target language, i.e., VHDL, C, and ARM (C code and run-time environment). The existing tool chains are based on XML and XML transformations (XSLT), but the expressiveness of the XSLT language limits which transformations can be carried out. Furthermore, some parts of the existing front end are note
    • 

    corecore