11 research outputs found

    Author index of Volume 68

    Get PDF

    Embedding attribute grammars and their extensions using functional zippers

    Get PDF
    Attribute grammars are a suitable formalism to express complex software language analysis and manipulation algorithms, which rely on multiple traversals of the underlying syntax tree. Attribute grammars have been extended with mechanisms such as reference, higher order and circular attributes. Such extensions provide a powerful modular mechanism and allow the specification of complex computations. This paper studies an elegant and simple, zipper-based embedding of attribute grammars and their extensions as first class citizens. In this setting, language specifications are defined as a set of independent, off-the-shelf components that can easily be composed into a powerful, executable language processor. Techniques to describe automatic bidirectional transformations between grammars in this setting are also described. Several real examples of language specification and processing programs have been implemented. (C) 2016 Elsevier B.V. All rights reserved.This author is supported by ERDF - European Regional Development Fund through the COMPETE Programme (operational programme for competitiveness) and by National Funds through the FCT - Fundacao para a Ciencia e a Tecnologia (Portuguese Foundation for Science and Technology) within project ON.2 IC&DT Programa Integrado "BEST CASE - Better Science Through Cooperative Advanced Synergetic Efforts (Ref. BIM-2013_BestCase_RL3.2_UMINHO) and project FATBIT - Foundations, Applications and Tools for Bidirectional Transformation (Ref. FCOMP-01-0124-FEDER-020532).This author is partially supported by NSF Award #1047961

    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

    Generalising tree traversals and tree transformations to DAGs:Exploiting sharing without the pain

    Get PDF
    We present a recursion scheme based on attribute grammars that can be transparently applied to trees and acyclic graphs. Our recursion scheme allows the programmer to implement a tree traversal or a tree transformation and then apply it to compact graph representations of trees instead. The resulting graph traversal or graph transformation avoids recomputation of intermediate results for shared nodes – even if intermediate results are used in different contexts. Consequently, this approach leads to asymptotic speedup proportional to the compression provided by the graph representation. In general, however, this sharing of intermediate results is not sound. Therefore, we complement our implementation of the recursion scheme with a number of correspondence theorems that ensure soundness for various classes of traversals. We illustrate the practical applicability of the implementation as well as the complementing theory with a number of examples

    Circular Reference Attributed Grammars - their Evaluation and Applications

    No full text
    This paper presents a combination of Reference Attributed Grammars (RAGs) and Circular Attribute Grammars (CAGs). While RAGs allow the direct and easy specification of non-locally dependent information, CAGs allow iterative fixed-point computations to be expressed directly using recursive (circular) equations. We demonstrate how the combined formalism, Circular Reference Attributed Grammars (CRAGs), can take advantage of both these strengths, making it possible to express solutions to many problems in an easy way. We exemplify with the specification and computation of the nullable, first, and follow sets used in parser construction, a problem which is highly recursive and normally programmed by hand using an iterative algorithm. We also present a general demand-driven evaluation algorithm for CRAGs and some optimizations of it. The approach has been implemented and experimental results include computations on a series of grammars including that of Java 1.2. We also revisit some of the classical examples of CAGs and show how their solutions are facilitated by CRAGs

    Circular Reference Attributed Grammars - Their Evaluation and Applications

    No full text
    This paper presents a combination of Reference Attributed Grammars (RAGs) and Circular Attribute Grammars (CAGs). While RAGs allow the direct and easy specification of non-locally dependent information, CAGs allow iterative fixed-point computations to be expressed directly using recursive (circular) equations. We demonstrate how the combined formalism, Circular Reference Attributed Grammars (CRAGs), can take advantage of both these strengths, making it possible to express solutions to many problems in an easy way. We exemplify with the specification and computation of the nullable, first, andfollow sets used in parser construction, aproblemwhichishighly recursive and normally programmed by hand using an iterative algorithm. We also present a general demand-driven evaluation algorithm for CRAGs and some optimizations of it. The approach has been implemented and experimental results include computations on a series of grammars including that of Java 1.2. We also revisit some of the classical examples of CAGs and show how their solutions are facilitated by CRAGs.

    Herramientas educativas para facilitar la adopción de la ingeniería de lenguajes software entre los desarrolladores informáticos

    Get PDF
    Históricamente, la materia de construcción de compiladores y procesadores de lenguaje es considerada por los estudiantes de ingeniería en informática como una materia difícil. Esto es debido, por una parte, a la naturaleza formal de las herramientas de especificación y diseño utilizadas, y, por otra, a la aplicación adecuada de diferentes técnicas sistemáticas de desarrollo para obtener los procesadores finales a partir de sus especificaciones. En esta tesis se aborda esta problemática en el caso particular de las gramáticas de atributos como formalismo básico de especificación. La tesis aborda, primeramente la concepción de una estrategia para facilitar la comprensión de los aspectos básicos de las especificaciones basadas en gramáticas de atributos, así como el soporte software de dicha estrategia. La estrategia propone un enfoque dirigido por problemas, en los que el alumno debe emular el proceso de evaluación semántica sobre distintos supuestos de procesamiento de frases de acuerdo con gramáticas de atributos. Para soportar dicha estrategia, se ha desarrollado un sistema denominado Evaluators, que, tomando como entrada baterías de ejercicios sobre evaluación semántica, produce automáticamente simuladores interactivos que los estudiantes pueden utilizar para resolver dichos ejercicios. El sistema proporciona, así mismo, una herramienta de autoría, que puede ser utilizada por los docentes para proporcionar los ejercicios, así como una herramienta de análisis, que permite trazar el comportamiento de los estudiantes durante la resolución de los mismos en los simuladores generados. Respecto a dichos simuladores, la herramienta es capaz de generar simulaciones de dos tipos: simuladores basados en juegos serios, y simulaciones interactivas basadas en las representaciones abstractas convencionales utilizadas en la materia. La tesis presenta, así mismo, diversos resultados de evaluación de la herramienta, tanto con estudiantes como con docentes, que evidencian la utilidad práctica de la misma. Por último, la tesis abstrae también el modelo de proceso utilizado en la construcción de la misma..
    corecore