Documentation ¶
Index ¶
- type VisitorAdapter
- func (v *VisitorAdapter) GetVisitor() interface{}
- func (v *VisitorAdapter) VisitAnnotatedNode(node *ast.AnnotatedNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitAnyNode(node ast.Node) (ast.Node, error)
- func (v *VisitorAdapter) VisitAssignmentNode(assignment *ast.AssignmentNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitBoolOp(node *ast.BoolOp) (ast.Node, error)
- func (v *VisitorAdapter) VisitComparison(node *ast.Comparison) (ast.Node, error)
- func (v *VisitorAdapter) VisitConstant(node *ast.Constant) (ast.Node, error)
- func (v *VisitorAdapter) VisitContinueNode(node *ast.ContinueNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitDeclNode(node *ast.DeclNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitDecoratorNode(node *ast.DecoratorNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitDotNode(node *ast.DotNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitExtendsNode(extends *ast.ExtendsNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitFunctionCallNode(node *ast.FunctionCallNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitFunctionDefinitionNode(node *ast.FunctionDefinitionNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitHandleCaseNode(node *ast.HandleCaseNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitIfNode(node *ast.IfNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitImplementsNode(implementsNode *ast.ImplementsNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitImportNode(node *ast.ImportNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitIndexNode(node *ast.IndexNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitInstantiateNode(node *ast.InstantiateNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitInternalNode(node *ast.InternalNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitMatchNode(node *ast.MatchNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitMathOpNode(node *ast.MathOpNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitMethodDefinition(node *ast.MethodDefinition) (ast.Node, error)
- func (v *VisitorAdapter) VisitPackage(node *ast.Package) (ast.Node, error)
- func (v *VisitorAdapter) VisitPipeNode(node *ast.PipeNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitProgram(block *ast.Program) (ast.Node, error)
- func (v *VisitorAdapter) VisitReturnNode(node *ast.ReturnNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitShapeNode(node *ast.ShapeNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitSignalNode(node *ast.SignalNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitSliceNode(node *ast.SliceNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitTryNode(node *ast.TryNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitTypeNode(node *ast.TypeNode) (ast.Node, error)
- func (v *VisitorAdapter) VisitVarName(node *ast.VarName) (ast.Node, error)
- func (v *VisitorAdapter) VisitWhenNode(node *ast.WhenNode) (ast.Node, error)
- type VisitorHider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type VisitorAdapter ¶
type VisitorAdapter struct { Visitor VisitorHider // visitor implements a visitor interface ShouldCallVisitor bool }
VisitorAdapter represents a top level VisitorAdapter that walks the tree but does nothing. Useful for doing analysis on the AST by other visitors For example, if I want to collect all of the function definitions of an arbor file, I would define a struct that is composed of this visitor and implements the VisitFunctionDefinitionNode function.
func (*VisitorAdapter) GetVisitor ¶
func (v *VisitorAdapter) GetVisitor() interface{}
GetVisitor gets the underlying visitor
func (*VisitorAdapter) VisitAnnotatedNode ¶
func (v *VisitorAdapter) VisitAnnotatedNode(node *ast.AnnotatedNode) (ast.Node, error)
func (*VisitorAdapter) VisitAnyNode ¶
func (*VisitorAdapter) VisitAssignmentNode ¶
func (v *VisitorAdapter) VisitAssignmentNode(assignment *ast.AssignmentNode) (ast.Node, error)
VisitAssignment visits an assignment node
func (*VisitorAdapter) VisitBoolOp ¶
VisitBoolOp visits a boolean node
func (*VisitorAdapter) VisitComparison ¶
func (v *VisitorAdapter) VisitComparison(node *ast.Comparison) (ast.Node, error)
VisitComparison Visits a comparison node
func (*VisitorAdapter) VisitConstant ¶
VisitConstant visits the constant object
func (*VisitorAdapter) VisitContinueNode ¶
func (v *VisitorAdapter) VisitContinueNode(node *ast.ContinueNode) (ast.Node, error)
func (*VisitorAdapter) VisitDeclNode ¶
VisitDeclNode visits the decl Node
func (*VisitorAdapter) VisitDecoratorNode ¶
func (v *VisitorAdapter) VisitDecoratorNode(node *ast.DecoratorNode) (ast.Node, error)
VisitSliceNode visits a slice node
func (*VisitorAdapter) VisitDotNode ¶
func (*VisitorAdapter) VisitExtendsNode ¶
func (v *VisitorAdapter) VisitExtendsNode(extends *ast.ExtendsNode) (ast.Node, error)
func (*VisitorAdapter) VisitFunctionCallNode ¶
func (v *VisitorAdapter) VisitFunctionCallNode(node *ast.FunctionCallNode) (ast.Node, error)
VisitFunctionCallNode visits a function call node
func (*VisitorAdapter) VisitFunctionDefinitionNode ¶
func (v *VisitorAdapter) VisitFunctionDefinitionNode(node *ast.FunctionDefinitionNode) (ast.Node, error)
VisitFunctionDefinitionNode visits a function definition ndde
func (*VisitorAdapter) VisitHandleCaseNode ¶
func (v *VisitorAdapter) VisitHandleCaseNode(node *ast.HandleCaseNode) (ast.Node, error)
func (*VisitorAdapter) VisitIfNode ¶
VisitIfNode visits an if node
func (*VisitorAdapter) VisitImplementsNode ¶
func (v *VisitorAdapter) VisitImplementsNode(implementsNode *ast.ImplementsNode) (ast.Node, error)
func (*VisitorAdapter) VisitImportNode ¶
func (v *VisitorAdapter) VisitImportNode(node *ast.ImportNode) (ast.Node, error)
VisitImportNode visits an import node
func (*VisitorAdapter) VisitIndexNode ¶
VisitIndexNode visits an index node
func (*VisitorAdapter) VisitInstantiateNode ¶
func (v *VisitorAdapter) VisitInstantiateNode(node *ast.InstantiateNode) (ast.Node, error)
func (*VisitorAdapter) VisitInternalNode ¶
func (v *VisitorAdapter) VisitInternalNode(node *ast.InternalNode) (ast.Node, error)
func (*VisitorAdapter) VisitMatchNode ¶
func (*VisitorAdapter) VisitMathOpNode ¶
func (v *VisitorAdapter) VisitMathOpNode(node *ast.MathOpNode) (ast.Node, error)
VisitMathOpNode Visits a math op node
func (*VisitorAdapter) VisitMethodDefinition ¶
func (v *VisitorAdapter) VisitMethodDefinition(node *ast.MethodDefinition) (ast.Node, error)
func (*VisitorAdapter) VisitPackage ¶
func (*VisitorAdapter) VisitPipeNode ¶
VisitPipeNode visits the pipe node
func (*VisitorAdapter) VisitProgram ¶
VisitProgram visits a compiler block
func (*VisitorAdapter) VisitReturnNode ¶
func (v *VisitorAdapter) VisitReturnNode(node *ast.ReturnNode) (ast.Node, error)
VisitReturnNode visits a return node
func (*VisitorAdapter) VisitShapeNode ¶
func (*VisitorAdapter) VisitSignalNode ¶
func (v *VisitorAdapter) VisitSignalNode(node *ast.SignalNode) (ast.Node, error)
func (*VisitorAdapter) VisitSliceNode ¶
VisitSliceNode visits a slice node
func (*VisitorAdapter) VisitTryNode ¶
func (*VisitorAdapter) VisitTypeNode ¶
VisitTypeNode visits a type node
func (*VisitorAdapter) VisitVarName ¶
VisitVarName visits a varname node
func (*VisitorAdapter) VisitWhenNode ¶
type VisitorHider ¶
type VisitorHider interface { SetVisitor(v *VisitorAdapter) GetSymbolTable() *scope.SymbolTable }
VisitorHider is a simple way to set and hide the visitor