public abstract static class Visitors.DispatchIrVisitor extends java.lang.Object implements GoloIrVisitor, java.util.function.BiFunction<java.lang.Object,GoloElement<?>,java.lang.Object>
The visitor will apply a given function to elements in the IR tree, accumulating returned values.
Three kinds of functions are valid:
null
.
protected abstract FunctionReference dispatchFunction(GoloElement<?> elt)
public java.lang.Object accumulator()
public Visitors.DispatchIrVisitor accumulator(java.lang.Object acc)
public java.lang.Object apply(java.lang.Object acc, GoloElement<?> elt)
Initialize the accumulator with the given value, visit the given element, and returns the final value of the accumulator.
apply
in interface java.util.function.BiFunction<java.lang.Object,GoloElement<?>,java.lang.Object>
acc
- the initial value for the accumulatorelt
- the IR element to visitpublic void visitModule(GoloModule elt)
visitModule
in interface GoloIrVisitor
public void visitModuleImport(ModuleImport elt)
visitModuleImport
in interface GoloIrVisitor
public void visitStruct(Struct elt)
visitStruct
in interface GoloIrVisitor
public void visitUnion(Union elt)
visitUnion
in interface GoloIrVisitor
public void visitUnionValue(UnionValue elt)
visitUnionValue
in interface GoloIrVisitor
public void visitAugmentation(Augmentation elt)
visitAugmentation
in interface GoloIrVisitor
public void visitNamedAugmentation(NamedAugmentation elt)
visitNamedAugmentation
in interface GoloIrVisitor
public void visitFunction(GoloFunction elt)
visitFunction
in interface GoloIrVisitor
public void visitDecorator(Decorator elt)
visitDecorator
in interface GoloIrVisitor
public void visitBlock(Block elt)
visitBlock
in interface GoloIrVisitor
public void visitConstantStatement(ConstantStatement elt)
visitConstantStatement
in interface GoloIrVisitor
public void visitReturnStatement(ReturnStatement elt)
visitReturnStatement
in interface GoloIrVisitor
public void visitFunctionInvocation(FunctionInvocation elt)
visitFunctionInvocation
in interface GoloIrVisitor
public void visitMethodInvocation(MethodInvocation elt)
visitMethodInvocation
in interface GoloIrVisitor
public void visitAssignmentStatement(AssignmentStatement elt)
visitAssignmentStatement
in interface GoloIrVisitor
public void visitDestructuringAssignment(DestructuringAssignment elt)
visitDestructuringAssignment
in interface GoloIrVisitor
public void visitReferenceLookup(ReferenceLookup elt)
visitReferenceLookup
in interface GoloIrVisitor
public void visitConditionalBranching(ConditionalBranching elt)
visitConditionalBranching
in interface GoloIrVisitor
public void visitBinaryOperation(BinaryOperation elt)
visitBinaryOperation
in interface GoloIrVisitor
public void visitUnaryOperation(UnaryOperation elt)
visitUnaryOperation
in interface GoloIrVisitor
public void visitLoopStatement(LoopStatement elt)
visitLoopStatement
in interface GoloIrVisitor
public void visitForEachLoopStatement(ForEachLoopStatement elt)
visitForEachLoopStatement
in interface GoloIrVisitor
public void visitCaseStatement(CaseStatement elt)
visitCaseStatement
in interface GoloIrVisitor
public void visitMatchExpression(MatchExpression elt)
visitMatchExpression
in interface GoloIrVisitor
public void visitWhenClause(WhenClause<?> elt)
visitWhenClause
in interface GoloIrVisitor
public void visitThrowStatement(ThrowStatement elt)
visitThrowStatement
in interface GoloIrVisitor
public void visitTryCatchFinally(TryCatchFinally elt)
visitTryCatchFinally
in interface GoloIrVisitor
public void visitClosureReference(ClosureReference elt)
visitClosureReference
in interface GoloIrVisitor
public void visitLoopBreakFlowStatement(LoopBreakFlowStatement elt)
visitLoopBreakFlowStatement
in interface GoloIrVisitor
public void visitCollectionLiteral(CollectionLiteral elt)
visitCollectionLiteral
in interface GoloIrVisitor
public void visitCollectionComprehension(CollectionComprehension elt)
visitCollectionComprehension
in interface GoloIrVisitor
public void visitNamedArgument(NamedArgument elt)
visitNamedArgument
in interface GoloIrVisitor
public void visitLocalReference(LocalReference elt)
visitLocalReference
in interface GoloIrVisitor
public void visitMember(Member elt)
visitMember
in interface GoloIrVisitor
public void visitMacroInvocation(MacroInvocation elt)
visitMacroInvocation
in interface GoloIrVisitor
public void visitNoop(Noop elt)
visitNoop
in interface GoloIrVisitor
public void visitToplevelElements(ToplevelElements elt)
visitToplevelElements
in interface GoloIrVisitor