Namespace Sawmill
Classes
AutoRewriter<T>
An experimental implementation of IRewriter<T> using reflection.
AutoRewriter<T> looks for the subtype's constructor, and gets/sets
the T
-children in the order that they appear in the constructor.
Cursor<T>
A Cursor<T> is a mutable view of a location in a T
-structure,
allowing efficient access to (and editing of) a node and its parent, siblings, and immediate children.
You can think of a Cursor<T> as being focused on a particular node. After zooming in on a node, you can efficiently go up to the node's parent, down to the node's first child, or left or right to the node's immediate siblings.
Cursor<T> is generally not as efficient or useful as the SelfAndDescendantsInContext<T>(IRewriter<T>, T) family for replacing single nodes, but it efficiently supports longer sequences of edits to a location and its neighbours.
Rewritable
Extension methods for IRewritable<T> implementations.
RewritableRewriter<T>
An implementation of IRewriter<T> for T
s which implement IRewritable<T>.
Rewriter
Extension methods for IRewriter<T> implementations.
RewriterBuilder
Tools for building rewriters.
RewriterBuilder<T>
Tools for building rewriters.
RewriterBuilderCase
Tools for building rewriters for a single subclass of a base type.
RewriterBuilderCase<TArgs, TBase, TSub>
Tools for building rewriters for a single subclass of a base type.
Interfaces
IRewritable<T>
A object is rewriterable if it knows how to access its immediate children.
Implementations should ensure that you always get the children you just set
(rewritable.SetChildren(children).GetChildren() == children
),
and that successive sets overwrite the earlier operation
(rewritable.SetChildren(children1).SetChildren(children2) == rewritable.SetChildren(children2)
).
IRewriter<T>
A rewriter is an object which knows how to access the immediate children of a value of type T
.
Implementations should ensure that you always get the children you just set
(rewriter.GetChildren(rewriter.SetChildren(children, expr)) == children
),
and that successive sets overwrite the earlier operation
(rewriter.SetChildren(children2, rewriter.SetChildren(children1, expr)) == rewriter.SetChildren(children2, expr)
).
Enums
Direction
Represents a direction that a Cursor<T> can move in
Delegates
SpanFunc<T, U, R>
A Func<T1,T2,TResult> whose first argument is a Span<T>.