SyntaxNodeVisitor

interface SyntaxNodeVisitor<T>

Visitor for transforming or inspecting the typed concrete syntax tree.

Default dispatch methods route broad node categories to the most specific visit method. A visitor must implement theory nodes and the concrete term/operator leaves it intends to handle; visitClause and visitParenthesizedExpression discard only their syntactic wrapper by default.

Type Parameters

T

result type returned for every visited node

Functions

Link copied to clipboard
open fun visit(node: SyntaxNode): T

Dispatches node to its broad expression, clause, or theory category.

Link copied to clipboard
abstract fun visitBlock(node: BlockNode): T

Visits a non-empty brace block.

Link copied to clipboard
open fun visitClause(node: ClauseNode): T

Visits node's expression by default.

Link copied to clipboard

Dispatches node to a term or operator-expression visit method.

Link copied to clipboard
abstract fun visitList(node: ListNode): T

Visits a non-empty list.

Link copied to clipboard
abstract fun visitNumber(node: NumberNode): T

Visits a numeric literal.

Link copied to clipboard

Visits a resolved operator expression.

Link copied to clipboard

Visits the enclosed expression by default.

Link copied to clipboard
abstract fun visitStructure(node: StructureNode): T

Visits an atom or compound structure.

Link copied to clipboard
open fun visitTerm(node: TermNode): T

Dispatches node to its concrete term visit method.

Link copied to clipboard
abstract fun visitTheory(node: TheoryNode): T

Visits a complete theory node.

Link copied to clipboard
abstract fun visitVariable(node: VariableNode): T

Visits a variable.