Traversing complex Abstract Syntax Trees (ASTs) typically requires large amounts of tedious boilerplate code. For many operations most of the code simply walks the structure, and only a small portion of the code imple...
详细信息
ISBN:
(纸本)9781450336895
Traversing complex Abstract Syntax Trees (ASTs) typically requires large amounts of tedious boilerplate code. For many operations most of the code simply walks the structure, and only a small portion of the code implements the functionality that motivated the traversal in the first place. This paper presents a type-safe Java framework called Shy that removes much of this boilerplate code. In Shy object Algebras are used to describe complex and extensible AST structures. Using Java annotations Shy generates generic boilerplate code for various types of traversals. For a concrete traversal, users of Shy can then inherit from the generated code and override only the interesting cases. Consequently, the amount of code that users need to write is significantly smaller. Moreover, traversals using the Shy framework are also much more structure shy, becoming more adaptive to future changes or extensions to the AST structure. To prove the effectiveness of the approach, we applied Shy in the implementation of a domain-specific questionnaire language. Our results show that for a large number of traversals there was a significant reduction in the amount of user-defined code.
This paper describes a general abstraction mechanism called a constraint pattern, with which an objectoriented language can be built. In such a language, constraint patterns play the roles of code and data abstractio...
详细信息
ISBN:
(纸本)0897915399
This paper describes a general abstraction mechanism called a constraint pattern, with which an objectoriented language can be built. In such a language, constraint patterns play the roles of code and data abstractions, and subsume classes, instance variables, methods and control structures. Constraint patterns, a conceptual blend and extension of BETA's patterns and Bertrand's augmented term rewriting rules, use equation solving for constraint satisfaction, method generation, and compilation. Basing a language on this abstraction makes simple equational constraints available as a fundamental language feature, integrated with the semantics.
Pointers or references can be identified as the root cause of many fundamental problems in current programming languages, typically resulting in unspecified object dependencies and missing hierarchical encapsulation. ...
详细信息
ISBN:
(纸本)9781595938657
Pointers or references can be identified as the root cause of many fundamental problems in current programming languages, typically resulting in unspecified object dependencies and missing hierarchical encapsulation. We therefore propose to abandon references from the language and to use expressive program relations instead. For this purpose, we have developed a programming language which is only based on hierarchical composition and interface connections.
暂无评论