In order to allow many different tools (editors, pretty printers,
semantics tools) to manipulate a common abstract syntax tree, we usually
manage the tree with a Centaur variable structure. The variable
has several roles:
- Allow tree edition.
- Keep track of paths that memorize information about the tree.
Within a variable, a path is encapsulated within a selection. A
selection's type determines how that path is updated according to tree
modifications.
- Keep track of modification histories for incremental tools.
Tools that maintain their own representation of the abstract syntax
tree may update this representation incrementally with the
modification information provided by the variable.
- Keep track of undo information.