16 research outputs found

    Abstract-Syntax-Driven Development of Oberon-0 Using YAJCo

    Get PDF
    YAJCo is a tool for the development of software languages based on an annotated language model. The model is represented by Java classes with annotations defining their mapping to concrete syntax. This approach to language definition enables the abstract syntax to be central point of the development process, instead of concrete syntax. In this paper a case study of Oberon-0 programming language development is presented. The study is based on the LTDA Tool Challenge and showcases details of abstract and concrete syntax definition using YAJCo, as well as implementation of name resolution, type checking, model transformation and code generation. The language was implemented in modular fashion to demonstrate language extension mechanisms supported by YAJCo

    Industrial Experience Report on the Formal Specification of a Packet Filtering Language Using the K Framework

    Get PDF
    Many project-specific languages, including in particular filtering languages, are defined using nonformal specifications written in natural languages. This leads to ambiguities and errors in the specification of those languages. This paper reports on an industrial experiment on using a tool-supported language specification framework (K) for the formal specification of the syntax and semantics of a filtering language having a complexity similar to those of real-life projects. This experimentation aims at estimating, in a specific industrial setting, the difficulty and benefits of formally specifying a packet filtering language using a tool-supported formal approach

    Revisiting visitors for modular extension of executable DSMLs

    Get PDF
    Executable Domain-Specific Modeling Languages (xDSMLs) are typically defined by metamodels that specify their abstract syntax, and model interpreters or compilers that define their execution semantics. To face the proliferation of xDSMLs in many domains, it is important to provide language engineering facilities for opportunistic reuse, extension, and customization of existing xDSMLs to ease the definition of new ones. Current approaches to language reuse either require to anticipate reuse, make use of advanced features that are not widely available in programming languages, or are not directly applicable to metamodel-based xDSMLs. In this paper, we propose a new language implementation pattern, named Revisitor, that enables independent extensibility of the syntax and semantics of metamodel-based xDSMLs with incremental compilation and without anticipation. We seamlessly implement our approach alongside the compilation chain of the Eclipse Modeling Framework, thereby demonstrating that it is directly and broadly applicable in various modeling environments. We show how it can be employed to incrementally extend both the syntax and semantics of the fUML language without requiring anticipation or re-compilation of existing code, and with acceptable performance penalty compared to classical handmade visitors

    Happy-GLL: modular, reusable and complete top-down parsers for parameterized nonterminals

    Full text link
    Parser generators and parser combinator libraries are the most popular tools for producing parsers. Parser combinators use the host language to provide reusable components in the form of higher-order functions with parsers as parameters. Very few parser generators support this kind of reuse through abstraction and even fewer generate parsers that are as modular and reusable as the parts of the grammar for which they are produced. This paper presents a strategy for generating modular, reusable and complete top-down parsers from syntax descriptions with parameterized nonterminals, based on the FUN-GLL variant of the GLL algorithm. The strategy is discussed and demonstrated as a novel back-end for the Happy parser generator. Happy grammars can contain `parameterized nonterminals' in which parameters abstract over grammar symbols, granting an abstraction mechanism to define reusable grammar operators. However, the existing Happy back-ends do not deliver on the full potential of parameterized nonterminals as parameterized nonterminals cannot be reused across grammars. Moreover, the parser generation process may fail to terminate or may result in exponentially large parsers generated in an exponential amount of time. The GLL back-end presented in this paper implements parameterized nonterminals successfully by generating higher-order functions that resemble parser combinators, inheriting all the advantages of top-down parsing. The back-end is capable of generating parsers for the full class of context-free grammars, generates parsers in linear time and generates parsers that find all derivations of the input string. To our knowledge, the presented GLL back-end makes Happy the first parser generator that combines all these features. This paper describes the translation procedure of the GLL back-end and compares it to the LALR and GLR back-ends of Happy in several experiments.Comment: 15 page

    Verification of Program Transformations with Inductive Refinement Types

    Get PDF
    International audienceHigh-level transformation languages like Rascal include expressive features for manipulating large abstract syntax trees: first-class traversals, expressive pattern matching, backtracking, and generalized iterators. We present the design and implementation of an abstract interpretation tool, Rabit, for verifying inductive type and shape properties for transformations written in such languages. We describe how to perform abstract interpretation based on operational semantics, specifically focusing on the challenges arising when analyzing the expressive traversals and pattern matching. Finally, we evaluate Rabit on a series of transformations (normalization, desugaring, refactoring, code generators, type inference, etc.) showing that we can effectively verify stated properties

    Modular modeling and its applications in studies of grazing effects

    Get PDF
    2016 Summer.Includes bibliographical references.Grazing is an important ecosystem process that can affect the grazing system at different levels. Overall grazing effect can be a combination of various direct and indirect effects. It is difficult to study grazing with all of the effects considered. To have a better knowledge of grazing effects and animal-plant interactions, modeling is one important pathway to achieve this goal. People usually use a diversity of approaches when modeling grazing based on different objectives, which makes model evaluations and comparisons difficult. With modular modeling, where different model components are regarded as separate and standardized modules, this situation can be changed. An example model is developed using a modular approach. It included most of the grazing effects and switches that can turn these effects on and off. This model was designed to be capable for applications with different hypothesis and objectives. It is expected to be clearer for people who are not familiar to models to make comparisons and evaluations of grazing effects. To test the feasibility of the model, a theoretical experiment on compensatory behavior in grassland production and a realistic simulation on plant-animal interactions in Qinghai-Tibetan plateau, China, are conducted. The results of these two applications demonstrate the benefits of using modular modeling in studies of grazing effects

    A principled approach to REPL interpreters

    Get PDF
    Read-eval-print-loops (REPLs) allow programmers to test out snippets of code, explore APIs, or even incrementally construct code, and get immediate feedback on their actions. However, even though many languages provide a REPL, the relation between the language as is and what is accepted at the REPL prompt is not always well-defined. Furthermore, implementing a REPL for new languages, such as DSLs, may incur significant language engineering cost. In this paper we survey the domain of REPLs and investigate the (formal) principles underlying REPLs. We identify and define the class of sequential languages, which admit a sound REPL implementation based on a definitional interpreter, and present design guidelines for extending existing language implementations to support REPL-style interfaces (including computational notebooks). The obtained REPLs can then be generically turned into an exploring interpreter, to allow exploration of the user’s interaction.The approach is illustrated using three case studies, based on MiniJava, QL (a DSL for questionnaires), and eFLINT (a DSL for normative rules). We expect sequential languages, and the consequent design principles, to be stepping stones towards a better understanding of the essence of REPLs.</p

    Retour d'expérience sur l'utilisation du framework K pour la spécification formelle d'un langage de filtrage de trames

    Get PDF
    Many project-specific languages, including in particular filtering languages, are defined using non-formal specifications written in natural languages. This leads to ambiguities and errors in the specification of those languages. This paper reports on an experiment on using a tool-supported language specification framework (K) for the formal specification of the syntax and semantics of a filtering language having a complexity similar to those of real-life projects. In the context of this experimentation, the cost and benefits of formally specifying a language using a tool-supported framework in general (as well as the expressivity and ease of use of the K framework in particular) are evaluated.De nombreux langages spécifiques à un projet, entre autre les langages de filtrage, sont définis dans une spécification non-formelle écrite en langage naturel. Ces spécifications sont par conséquence souvent ambiguës et erronées. Ce rapport est un retour d'expérience sur l'utilisation d'un framework outillé de spécification de langage (le framework K) pour la spécification formelle de la syntaxe et sémantique d'un langage de filtrage de trames ayant une complexité similaire à celle rencontrée sur des projets réels. Dans le contexte de cette expérimentation, ce rapport évalue les coûts et bénéfices liés à une démarche de spécification formelle d'un langage en s'appuyant sur un framework outillé en général, et plus particuliÚrement dans le cas du framework K

    Efficient abstractions for visualization and interaction

    Get PDF
    Abstractions, such as functions and methods, are an essential tool for any programmer. Abstractions encapsulate the details of a computation: the programmer only needs to know what the abstraction achieves, not how it achieves it. However, using abstractions can come at a cost: the resulting program may be inefficient. This can lead to programmers not using some abstractions, instead writing the entire functionality from the ground up. In this thesis, we present several results that make this situation less likely when programming interactive visualizations. We present results that make abstractions more efficient in the areas of graphics, layout and events
    corecore