2017
DOI: 10.1145/3110272
|View full text |Cite
|
Sign up to set email alerts
|

Visitors unchained

Abstract: Traversing and transforming abstract syntax trees that involve name binding is notoriously difficult to do in a correct, concise, modular, customizable manner. We address this problem in the setting of OCaml, a functional programming language equipped with powerful object-oriented features. We use visitor classes as partial, composable descriptions of the operations that we wish to perform on abstract syntax trees. We introduce visitors, a simple type-directed facility for generating visitor classes that have … Show more

Help me understand this report

Search citation statements

Order By: Relevance

Paper Sections

Select...
1
1
1
1

Citation Types

0
4
0

Year Published

2019
2019
2023
2023

Publication Types

Select...
3
1
1

Relationship

0
5

Authors

Journals

citations
Cited by 5 publications
(4 citation statements)
references
References 37 publications
(33 reference statements)
0
4
0
Order By: Relevance
“…OCaml's abstract syntax data type contains source code location information, which we used to produce accurate patches describing how to apply the renaming. We also relied on the recently developed visitors library [35] to automatically generate boilerplate code for traversing and processing the abstract syntax trees. This library provides similar functionality to that found in Haskell's SYB [18] and Strafunski [19] libraries, or the Stratego/XT framework [10].…”
Section: Methodsmentioning
confidence: 99%
“…OCaml's abstract syntax data type contains source code location information, which we used to produce accurate patches describing how to apply the renaming. We also relied on the recently developed visitors library [35] to automatically generate boilerplate code for traversing and processing the abstract syntax trees. This library provides similar functionality to that found in Haskell's SYB [18] and Strafunski [19] libraries, or the Stratego/XT framework [10].…”
Section: Methodsmentioning
confidence: 99%
“…In the API, six classes of visitors are provided: iter to traverse a CST, map to transform a CST into another CST, reduce to compute a value by a bottom-up recursive computation on a CST, as well as iter2, map2 and reduce2 which traverse two input CSTs of similar shapes at the same time. These visitors come for free as we use a preprocessor [20] which automatically generates visitors classes out of type definitions.…”
Section: Shell Parsing Toolkitmentioning
confidence: 99%
“…The core of ROTOR's operation involves performing various kinds of traversals over the program's abstract syntax trees. For this, we have made use of the recently developed visitors syntax extension for OCaml [9]. This automatically generates classes whose methods perform a bottom-up traversal of values of a given set of datatypes.…”
Section: Use Of Visitor Classesmentioning
confidence: 99%