Visitor topic

Classes that implement the visitor pattern for traversing the Sass AST. Callers can either implement interfaces like StatementVisitor from scratch to handle all Sass node types, or extend helper classes like RecursiveStatementVisitor which traverse the entire AST to handle only specific nodes.

Classes

ExpressionVisitor<T> Visitor
An interface for visitors that traverse SassScript expressions.
SelectorVisitor<T> Visitor
An interface for visitors that traverse selectors.
StatementVisitor<T> Visitor
An interface for visitors that traverse Sass statements.

Mixins

AstSearchVisitor<T> Visitor
A visitor that recursively traverses each statement and expression in a Sass AST whose visit* methods default to returning null, but which returns the first non-null value returned by any method.
RecursiveAstVisitor Visitor
A visitor that recursively traverses each statement and expression in a Sass AST.
RecursiveSelectorVisitor Visitor
A visitor that recursively traverses each component of a Selector AST.
RecursiveStatementVisitor Visitor
A visitor that recursively traverses each statement in a Sass AST.
ReplaceExpressionVisitor Visitor
A visitor that recursively traverses each expression in a SassScript AST and replaces its contents with the values returned by nested recursion.
SelectorSearchVisitor<T> Visitor
A SelectorVisitor whose visit* methods default to returning null, but which returns the first non-null value returned by any method.
StatementSearchVisitor<T> Visitor
A StatementVisitor whose visit* methods default to returning null, but which returns the first non-null value returned by any method.