Results 1 -
9 of
9
Forwarding in attribute grammars for modular language design
- In Proc. 11th Intl. Conf. on Compiler Construction, volume 2304 of LNCS
, 2002
"... Abstract. Forwarding is a technique for providing default attribute definitions in attribute grammars that is helpful in the modular implementation of programming languages. It complements existing techniques such as default copy rules. This paper introduces forwarding, and shows how it is but a sma ..."
Abstract
-
Cited by 30 (11 self)
- Add to MetaCart
Abstract. Forwarding is a technique for providing default attribute definitions in attribute grammars that is helpful in the modular implementation of programming languages. It complements existing techniques such as default copy rules. This paper introduces forwarding, and shows how it is but a small extension of standard higher-order attribute grammars. The usual tools for manipulating higher-order attribute grammars, including the circularity check (which tests for cyclic dependencies between attribute values), carry over without modification. The closure test (which checks that each attribute has a defining equation) needs modification, however, because the resulting higher-order attribute grammars may contain spurious attributes that are never evaluated, and indeed that need not be defined. 1
Dealing with Large Bananas
- Universiteit Utrecht
, 2000
"... Abstract. Many problems call for a mixture of generic and speci c programming techniques. We propose a polytypic programming approach based on generalised (monadic) folds where a separation is made between basic fold algebras that model generic behaviour and updates on these algebras that model spec ..."
Abstract
-
Cited by 26 (11 self)
- Add to MetaCart
Abstract. Many problems call for a mixture of generic and speci c programming techniques. We propose a polytypic programming approach based on generalised (monadic) folds where a separation is made between basic fold algebras that model generic behaviour and updates on these algebras that model speci c behaviour. We identify particular basic algebras as well as some algebra combinators, and we show how these facilitate structured programming with updatable fold algebras. This blend of genericity and speci city allows programming with folds to scale up to applications involving large systems of mutually recursive datatypes. Finally, we address the possibility of providing generic de nitions for the functions, algebras, and combinators that we propose. 1
First-class Attribute Grammars
- Informatica
, 2000
"... This paper is a contribution to the ongoing quest for modular descriptions of language processors, with the specific aim of rapidly prototyping domain-specific languages [21]. Some might argue that this problem was solved in the eighties, with the development of a proliferation of language processor ..."
Abstract
-
Cited by 13 (6 self)
- Add to MetaCart
This paper is a contribution to the ongoing quest for modular descriptions of language processors, with the specific aim of rapidly prototyping domain-specific languages [21]. Some might argue that this problem was solved in the eighties, with the development of a proliferation of language processors based on attribute grammars [11, 15, 22]. Others might argue that functional programming languages such as ML are adequate for the purpose, without any further extensions. We believe that functional programming languages do not o#er enough specialised support for implementing compilers. However, attribute grammars are not in widespread use, despite their many advantages. This may be due to restrictions imposed by attribute definition languages, which are often less flexible than general purpose functional programming languages. Such general languages tend to yield descriptions that are compact, but they lack the dedicated structuring mechanisms of attribute grammars.
A Two-Dimensional Separation of Concerns for Compiler Construction
- IN PROC. ACM SYMPOSIUM ON APPLIED COMPUTING (SAC
, 2005
"... During language evolution, compiler construction is usually performed along two dimensions: defining new abstract syntax tree (AST) classes, or adding new operations. In order to facilitate such changes, two software design patterns (i.e., the inheritance pattern and the visitor pattern) are widely ..."
Abstract
-
Cited by 7 (3 self)
- Add to MetaCart
During language evolution, compiler construction is usually performed along two dimensions: defining new abstract syntax tree (AST) classes, or adding new operations. In order to facilitate such changes, two software design patterns (i.e., the inheritance pattern and the visitor pattern) are widely used to help modularize the language constructs. However, as each design pattern is only suitable for one dimension of extension, neither of these two patterns can independently fulfill the evolution needs during the compiler construction process. In this paper, we analyze two dimensions of concerns in compiler construction and develop a paradigm allowing compiler evolution across these two dimensions using both object-orientation and aspect-orientation. Moreover, this approach provides an ability to perform pattern transformation based on pluggable aspects. A simple implementation of an expression language and its possible extension is demonstrated using Java and AspectJ.
JastAdd--an aspect-oriented compiler construction system
- Science of Computer Programming
, 2003
"... centered around an object-oriented representation of the abstract syntax tree where reference variables can be used to link together different parts of the tree. JastAdd supports the combination of declarative techniques (using Reference Attributed Grammars) and imperative techniques (using ordinary ..."
Abstract
-
Cited by 5 (0 self)
- Add to MetaCart
centered around an object-oriented representation of the abstract syntax tree where reference variables can be used to link together different parts of the tree. JastAdd supports the combination of declarative techniques (using Reference Attributed Grammars) and imperative techniques (using ordinary Java code) in implementing the compiler. The behavior can be modularized into different aspects, e.g. name analysis, type checking, code generation, etc., that are woven together into classes using aspect-oriented programming techniques, providing a safer and more powerful alternative to the Visitor pattern. The JastAdd system is independent of the underlying parsing technology and supports any non-circular dependencies between computations, thereby allowing general multi-pass compilation. The attribute evaluator (optimal recursive evaluation) is implemented very conveniently using Java classes, interfaces, and virtual methods. Key words: reference attributed grammars, aspect-oriented programming, compiler construction, visitor pattern, Java 1
Separation of concerns in compiler development using aspect-orientation
- In Applied computing 2006: proceedings of the 2006 ACM symposium on applied computing
, 2006
"... A major difficulty in compiler development regards the proper modularization of concerns among the various compiler phases. The traditional object-oriented development paradigm has difficulty in providing an optimal solution towards modularizing the analysis phases of compiler development, because i ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
A major difficulty in compiler development regards the proper modularization of concerns among the various compiler phases. The traditional object-oriented development paradigm has difficulty in providing an optimal solution towards modularizing the analysis phases of compiler development, because implementation of each phase often crosscuts the class hierarchy defined by language syntax constructs. Object-oriented design patterns, such as the Visitor pattern, also cannot solve the crosscutting problem adequately because an object is not a natural representation of a collection of operations. This paper demonstrates the benefits of applying aspect-oriented programming languages (e.g., AspectJ) and principles to compiler design and implementation. The experience result shows that the various language constructs in AspectJ (e.g., intertype declaration, pointcut-advice model, static aspect members and aspect inheritance) fit well with the various computation needs of compiler development, which results in a compiler implementation with improved modularity and better separation of concerns. The ideas utilized in this paper can also be generalized to other software systems with a tree-like structure.
Comonadic functional attribute evaluation
- Trends in Functional Programming
"... We have previously demonstrated that dataflow computation is comonadic. Here we argue that attribute evaluation has a lot in common with dataflow computation and admits a similar analysis. We claim that this yields a new, modular way to organize both attribute evaluation programs written directly in ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
We have previously demonstrated that dataflow computation is comonadic. Here we argue that attribute evaluation has a lot in common with dataflow computation and admits a similar analysis. We claim that this yields a new, modular way to organize both attribute evaluation programs written directly in a functional language as well as attribute grammar processors.
Domain-Specific Embedded Languages
, 2002
"... A domain-specific embedded language (DSEL) is a domain-specific programming language with no concrete syntax of its own. Defined as a set of combinators encapsulated in a module, it borrows the syntax and tools (such as type-checkers and compilers) of its host language; hence it is economical to des ..."
Abstract
- Add to MetaCart
A domain-specific embedded language (DSEL) is a domain-specific programming language with no concrete syntax of its own. Defined as a set of combinators encapsulated in a module, it borrows the syntax and tools (such as type-checkers and compilers) of its host language; hence it is economical to design, introduce, and maintain. Unfortunately, this economy is counterbalanced by a lack of room for growth. DSELs cannot match sophisticated domain-specific languages that offer tools for domainspecific error-checking and optimisation. These tools are usually based on syntactic analyses, so they do not work on DSELs. Abstract interpretation is a technique ideally suited to the analysis of DSELs, due to its semantic, rather than syntactic, approach. It is based upon the observation that analysing a program is equivalent to evaluating it over an abstract semantic domain. The mathematical properties of the abstract domain are such that evaluation reduces to solving a mutually recursive set of equations. This thesis shows how abstract interpretation can be applied to a DSEL by replacing it with an abstract implementation
First-Class
, 2011
"... The Utrecht University Attribute Grammar Compiler (UUAGC) takes attribute grammar declarations from multiple source files and generates an attribute grammar evaluator consisting of a single Haskell source text. A problem with this generative approach is that, once the code is generated and compiled, ..."
Abstract
- Add to MetaCart
The Utrecht University Attribute Grammar Compiler (UUAGC) takes attribute grammar declarations from multiple source files and generates an attribute grammar evaluator consisting of a single Haskell source text. A problem with this generative approach is that, once the code is generated and compiled, neither new attributes can be introduced nor existing ones can be modified without providing access to all the source code and without having to regenerate and recompile the entire program. In contrast to this textual approach we recently constructed the Haskell combinator library AspectAG with which one can construct attribute grammar fragments as a Haskell value. Such descriptions can be individually type-checked, compiled, distributed and composed to construct a compiler. This method however results in rather inefficient compilers, due to the cost of composition. In this paper we show how we can combine the two approaches by generating the AspectAG code fragments from original UUAGC sources, making it possible to trade between efficiency and flexibility. This both enables a couple of optimizations for AspectAG resulting in a considerable speed improvement and makes that existing UUAGC code can be reused in a flexible environment. 1

