Niklas Fors
Lund University
Network
Latest external collaboration on country level. Dive into details by clicking on the dots.
Publication
Featured researches published by Niklas Fors.
Proceedings of the 14th International Conference on Modularity | 2015
Niklas Fors; Gustav Cedersjö; Görel Hedin
Reference attribute grammars (RAGs) is a powerful formalism for developing modular extensible compilers and program analysis tools. This paper presents JavaRAG, an implementation of RAGs as a Java library that is independent of the abstract syntax tree structure. This makes it possible to extend legacy compilers implemented in Java with RAG computations. We have evaluated the approach by integrating with EMF, ANTLR, and hand-built abstract syntax trees, and we compare performance and specification size with JastAdd and Kiama which are other RAG-based tools. Our JavaRAG library is open source and is used in a compiler for the dataflow language CAL.
symposium on visual languages and human-centric computing | 2014
Niklas Fors; Görel Hedin
Control systems are often built using visual dataflow-based languages, and supporting different variants may be challenging. We introduce the concept of connection interception based on inheritance. This mechanism allows a diagram to extend another diagram and intercept connections defined in the supertype, that is, to replace it by two other connections, in order to specialize the behavior. This can be used to create extensible libraries that support different variants.
acm conference on systems programming languages and applications software for humanity | 2013
Niklas Fors; Görel Hedin
In this paper we describe how techniques for refactoring can be used for visual editing of hybrid languages, that is, languages that have both a visual and a textual syntax. Textual languages have name rules that define how name uses are bound to name declarations. These bindings often correspond to connections in the visual language, and need to be taken into account in order to implement the visual edit operations correctly. We use inverse lookup functions, originally devised for renaming, for implementing visual editing operations for hybrid languages.
Electronic Communication of The European Association of Software Science and Technology | 2013
Niklas Fors; Görel Hedin
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.
symposium on visual languages and human-centric computing | 2012
Niklas Fors; Görel Hedin
We have implemented a prototype editor for a visual language where the semantics depends on layout. A high-level abstract syntax is defined, where these semantics can be captured without the need for storing concrete graphical coordinates. The model implementation is done in JastAdd, a metacompilation tool based on reference attribute grammars. This gives a modular architecture where the core compiler model can be reused for both the interactive editor and the batch compiler.
international workshop on real world domain specific languages | 2016
Niklas Fors; Görel Hedin
Block diagram languages are often used for physical modeling and automation, where end users are domain engineers that instantiate block types and wire them together. Abstraction mechanisms in these languages allow specialists to build advanced reusable domain-specific libraries. However, this brings a tension between supporting reusability and making the language simple to comprehend for domain engineers. We propose a technique for relieving this tension by supporting visual instance inlining and smart editing mechanisms based on instance specialization. The new technique allows end users to visually edit and comprehend diagrams in terms of domain blocks only, while the underlying program makes use of reusable library types.
Proceedings of the Second Workshop on Graphical Modeling Language Development | 2013
Niklas Fors; Görel Hedin
In editors for visual languages it is often useful to provide interactive feedback that depends on the static semantics of the edited program. In this paper we demonstrate how such feedback can be implemented using reference attribute grammars. Because the implementation is declarative, it is easy to modularize compiler and editor computations, reusing the compilers program model in the editor. Furthermore, the declarative approach makes it easy to keep the program model and view consistent during editing. The approach is illustrated using a function block diagram language, with visual feedback on, for example, type checking and cyclic data flow.
software language engineering | 2018
Johannes Mey; René Schöne; Görel Hedin; Emma Söderberg; Thomas Kühn; Niklas Fors; Jesper Öqvist; Uwe Aßmann
Just like current software systems, models are characterised by increasing complexity and rate of change. Yet, these models only become useful if they can be continuously evaluated and validated. To achieve sufficiently low response times for large models, incremental analysis is required. Reference Attribute Grammars (RAGs) offer mechanisms to perform an incremental analysis efficiently using dynamic dependency tracking. However, not all features used in conceptual modelling are directly available in RAGs. In particular, support for non-containment model relations is only available through manual implementation. We present an approach to directly model uni- and bidirectional non-containment relations in RAGs and provide efficient means for navigating and editing them. This approach is evaluated using a scalable benchmark for incremental model editing and the JastAdd RAG system. Our work demonstrates the suitability of RAGs for validating complex and continuously changing models of current software systems.
sigplan symposium on new ideas new paradigms and reflections on programming and software | 2016
Niklas Fors; Görel Hedin
Automation programming is typically done using blocks and dataflow connections, in diagram languages that support user-defined block types. Often, these types are intended to be instantiated and connected to other blocks in common patterns, corresponding to anticipated variability. We present the new language mechanisms of wirings and recommendations that allow these intentions to be encoded as features in libraries. A wiring describes how a given block is typically connected to other blocks, and a recommendation describes where such a wiring is typically applied as a feature. This allows feature-based wizards to be generated for user-defined libraries, making it easy to construct applications that make use of the encoded patterns.
Science of Computer Programming | 2015
Niklas Fors; Görel Hedin
We implemented an Oberon-0 compiler using reference attribute grammars in JastAdd.The work is part of a tool challenge aiming at comparing compiler construction tools.Oberon-0 is a small procedural language illustrating typical compilation problems.We could modularize the compiler according to the artifacts defined in the challenge.We demonstrate best practices for compiler development using JastAdd. As a part of the LDTA 2011 Tool Challenge, we implemented a compiler for the language Oberon-0 using the metacompilation tool JastAdd. In this paper, we report on this implementation, and reflect on aspects of it such as ease of use, modularity, and safety.