121 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

    A comparison of metacompilation approaches to implementing Modelica

    Get PDF

    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

    Mungo and StMungo: tools for typechecking protocols in Java

    Get PDF
    We present two tools that support static typechecking of communica- tion protocols in Java. Mungo associates Java classes with typestate specifications, which are state machines defining permitted sequences of method calls. StMungo translates a communication protocol specified in the Scribble protocol description language into a typestate specification for each role in the protocol by following the message sequence. Role implementations can be typechecked by Mungo to ensure that they satisfy their protocols, and then compiled as usual with javac. We demonstrate the Scribble, StMungo and Mungo toolchain via a typechecked POP3 client that can communicate with a real-world POP3 server

    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

    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

    Languages and Tools for Optimization of Large-Scale Systems

    Get PDF
    Modeling and simulation are established techniques for solving design problems in a wide range of engineering disciplines today. Dedicated computer languages, such as Modelica, and efficient software tools are available. In this thesis, an extension of Modelica, Optimica, targeted at dynamic optimization of Modelica models is proposed. In order to demonstrate the Optimica extension, supporting software has been developed. This includes a modularly extensible Modelica compiler, the JModelica compiler, and an extension that supports also Optimica. A Modelica library for paper machine dryer section modeling, DryLib, has been developed. The classes in the library enable structured and hierarchical modeling of dryer sections at the application user level, while offering extensibility for the expert user. Based on DryLib, a parameter optimization problem, a model reduction problem, and an optimization-based control problem have been formulated and solved. A start-up optimization problem for a plate reactor has been formulated in Optimica, and solved by means of the Optimica compiler. In addition, the robustness properties of the start-up trajectories have been evaluated by means of Monte-Carlo simulation. In many control systems, it is necessary to consider interaction with a user. In this thesis, a manual control scheme for an unstable inverted pendulum system, where the inputs are bounded, is presented. The proposed controller is based on the notion of reachability sets and guarantees semi global stability for all references. An inverted pendulum on a two wheels robot has been developed. A distributed control system, including sensor processing algorithms and a stabilizing control scheme has been implemented on three on-board embedded processors
    • 

    corecore