148 research outputs found

    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

    Declarative Specification of Intraprocedural Control-flow and Dataflow Analysis

    Get PDF
    Static program analysis plays a crucial role in ensuring the quality and security of software applications by detecting and fixing bugs, and potential security vulnerabilities in the code. The use of declarative paradigms in dataflow analysis as part of static program analysis has become increasingly popular in recent years. This is due to its enhanced expressivity and modularity, allowing for a higher-level programming approach, resulting in easy and efficient development.The aim of this thesis is to explore the design and implementation of control-flow and dataflow analyses using the declarative Reference Attribute Grammars formalism. Specifically, we focus on the construction of analyses directly on the source code rather than on an intermediate representation.The main result of this thesis is our language-agnostic framework, called IntraCFG. IntraCFG enables efficient and effective dataflow analysis by allowing the construction of precise and source-level control-flow graphs. The framework superimposes control-flow graphs on top of the abstract syntax tree of the program. The effectiveness of IntraCFG is demonstrated through two case studies, IntraJ and IntraTeal. These case studies showcase the potential and flexibility of IntraCFG in diverse contexts, such as bug detection and education. IntraJ supports the Java programming language, while IntraTeal is a tool designed for teaching program analysis for an educational language, Teal.IntraJ has proven to be faster than and as precise as well-known industrial tools. The combination of precision, performance, and on-demand evaluation in IntraJ leads to low latency in querying the analysis results. This makes IntraJ a suitable tool for use in interactive tools. Preliminary experiments have also been conducted to demonstrate how IntraJ can be used to support interactive bug detection and fixing.Additionally, this thesis presents JFeature, a tool for automatically extracting and summarising the features of a Java corpus, including the use of different Java features (e.g., use of Lambda Expressions) across different Java versions. JFeature provides researchers and developers with a deeper understanding of the characteristics of corpora, enabling them to identify suitable benchmarks for the evaluation of their tools and methodologies

    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

    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

    A comparison of metacompilation approaches to implementing Modelica

    Get PDF

    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
    • 

    corecore