• No results found

Generic traversal over typed source code representations - Contents

N/A
N/A
Protected

Academic year: 2021

Share "Generic traversal over typed source code representations - Contents"

Copied!
5
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

UvA-DARE is a service provided by the library of the University of Amsterdam (https://dare.uva.nl)

UvA-DARE (Digital Academic Repository)

Generic traversal over typed source code representations

Visser, J.M.W.

Publication date

2003

Link to publication

Citation for published version (APA):

Visser, J. M. W. (2003). Generic traversal over typed source code representations.

General rights

It is not permitted to download or to forward/distribute the text or part of it without the consent of the author(s) and/or copyright holder(s), other than for strictly personal, individual use, unless the work is under an open content license (like Creative Commons).

Disclaimer/Complaints regulations

If you believe that digital publication of certain material infringes any of your rights or (privacy) interests, please let the Library know, stating your reasons. In case of a legitimate complaint, the Library will make the material inaccessible and/or remove it from the website. Please Ask the Library: https://uba.uva.nl/en/contact, or a letter to: Library of the University of Amsterdam, Secretariat, Singel 425, 1012 WP Amsterdam, The Netherlands. You will be contacted as soon as possible.

(2)

Contents s

11 Introduction 1

1.11 Areas of language processing 2

1.22 The role of types 5 1.33 Traditional typeful approaches to traversal 7

1.44 Challenges 17 1.55 Limitations of novel typeful approaches 20

1.66 Research questions 21

1.77 Road map 23

22 Grammars as Contracts 27

2.11 Introduction 27 2.22 Concrete syntax definition and meta-tooling 29

2.2.11 Concrete syntax definition 30 2.2.22 Concrete meta-tooling 31 2.33 Abstract syntax definition and meta-tooling 32

2.3.11 Abstract syntax definition 33 2.3.22 Abstract syntax tree representation 33

2.3.33 Abstract from concrete syntax 34

2.44 Generating library code 35 2.4.11 Targeting C 36 2.4.22 Targeting Java 36 2.4.33 Targeting Stratego 36 2.4.44 Targeting Haskell 37 2.55 A comprehensive architecture 37

2.5.11 Grammar version management 38 2.5.22 Connecting components 39

2.66 Applications 39 2.77 Related work 40 2.88 Contributions 42

(3)

viiii CONTENTS 33 Dealing with Large Bananas 45

3.11 Introduction 45 3.22 Programming with folds 47

3.2.11 An example 47 3.2.22 Scalability problems 48

3.33 Programming with updatable fold algebras 49

3.3.11 Updating algebras 49 3.3.22 Type-preserving and type-unifying 50

3.3.33 Crushing 51 3.44 Merging monads and updatable folds 52

3.4.11 Monadic folds 52 3.4.22 Lifting fold algebras 52 3.4.33 Fold algebra composition 53

3.4.44 Carried monads 54 3.4.55 Casting weaved-in to carried monadic fold algebras . . . . 54

3.55 Generic bananas 55 3.5.11 Systems of datatypes 56 3.5.22 Fold algebras 56 3.5.33 Fold functions 57 3.5.44 Basic algebras 58 3.5.55 Algebra combinators 58 3.5.66 Extensions 59 3.66 Concluding remarks 61

44 Typed Combinators for Generic Traversal 63

4.11 Introduction 63 4.22 A strategy library 65

4.2.11 Strategy types and application 66

4.2.22 Strategy construction 67 4.2.33 Sequential composition 68 4.2.44 Partiality and non-determinism 68

4.2.55 Traversal combinators 69 4.2.66 Some defined combinators 70

4.33 Application: Refactoring 71 4.3.11 The extract method refactoring 71

4.3.22 Design 72 4.3.33 Implementation with strategies 72

4.44 Models of strategies 75 4.4.11 Strategies as functions on a universal term representation . 75

4.4.22 Strategies as rank-2 polymorphic functions with type case 77

4.4.33 Trade-offs and alternatives 78

(4)

CONTENTS S ix x

55 Visitor Combination and Traversal Control 81

5.11 Introduction 82 5.22 Sequential composition 84 5.33 Alternative composition 86 5.44 Traversal combinators 88 5.55 Syntax-independence 90 5.5.11 Lack of genericity 92 5.5.22 Visitor combinators in frameworks 92

5.5.33 Generic combinators 94 5.5.44 Towards libraries of generic algorithms 95

5.66 Support 98 5.6.11 JJTraveler 98

5.6.22 JJForester 98 5.6.33 Visitor combinators for ATerms 100

5.77 Concluding remarks 100 5.7.11 Evaluation 101 5.7.22 Generic traversal across paradigms 102

5.7.33 Related work 102 5.7.44 Future work 104

66 Object-oriented Tree Traversal with JJForester 105

6.11 Introduction 105 6.22 JJForester 107

6.2.11 Overview 107

6.2.22 SDF 109

6.2.33 Code generation I l l 6.2.44 Programming against the generated code 113

6.2.55 Assessment of expressiveness 115

6.2.66 Limitations 117

6.33 JJTraveler 118 6.3.11 The architecture of JJTraveler 118

6.3.22 Generic visitor combinators 119 6.3.33 Building visitors from combinators 120

6.3.44 Evaluation 122 6.44 Case study 122

6.4.11 The Problem 123 6.4.22 T-scripts explained 124 6.4.33 Analysis using JJForester 126

6.55 Concluding remarks 135 6.5.11 Contributions 135 6.5.22 Related Work 135 6.5.33 Future Work 136

(5)

xx CONTENTS 77 Building Program Understanding Tools Using Visitor Combinators 139

7.11 Introduction 139 7.22 Visitor Combinators 141

7.2.11 The architecture of JJTraveler 141 7.2.22 A library of generic visitor combinators 143

7.33 Cobol Control Flow 145 7.3.11 Cobol Procedures 145 7.3.22 Analysis and visualization 146

7.44 ControlCruiser Architecture 147 7.4.11 Initial Representation 147 7.4.22 Graph Representation 147 7.4.33 Graph Construction 149 7.4.44 Graph Analysis 149 7.55 ControlCruiser Implementation 150 7.5.11 CCG Refinement 154 7.5.22 CCG visualization 155 7.66 Evaluation 157 7.6.11 Development techniques 157

7.6.22 Benefits and risks 158 7.77 Concluding Remarks 159

88 Conclusions 161 8.11 Typed generic traversal 161

8.22 Mainstream programming 163 8.33 Integrated language tool development 163

8.44 Available software 164 8.55 Perspectives 167

Bibliographyy 169 Summaryy 183 Samenvattingg 185

Referenties

GERELATEERDE DOCUMENTEN

In my position as Science Librarian, I have been responsible for faculty liaison, collection development, reference and research and library instruction for my subject areas

If the number of surface species increases to three, for example CO(ads), OH(ads) and either free Pt sites or O(ads), two adsorption relaxations are needed, circuit 2L, in order

Against this complex contemporary social and cultural context, Tal-choom, as Korea’s popular theatre, exem­ plifies its current place and the future possibilities

But, above all, Bildung’s ideological force remains invisible (Gadamer’s "atmosphere breathed”) so that individuals fieely consent to its demands; its subjects, that is,

Once the combined sets containing only good data points are identified, classical estimation methods such as the least-squares method and the maximum likelihood method can be applied

This thesis reduces the paucity of Canadian research on sexual minorities by showing lesbian and bisexual women (among a sample of residential treatment clients) use certain drugs

The smoking ban policy of provincial health authorities was designed to address two issues: firstly, smoking within workplaces in DSRs in mental health and long term care continued

Following this direction, in order to develop a practical algorithm to construct suffix trees for input strings of any size, we need three essential steps to be efficient from an