def METHOD_NAME(self, ctx):
    # from RuleContext
    self.parentCtx = ctx.parentCtx
    self.invokingState = ctx.invokingState
    self.children = None
    self.start = ctx.start
    self.stop = ctx.stop
    # copy any error nodes to alt label node
    if ctx.children is not None:
        self.children = []
        # reset parent pointer for any error nodes
        for child in ctx.children:
            if isinstance(child, ErrorNodeImpl):
                self.children.append(child)
                child.parentCtx = self