class CustomTreeVisitor extends AbstractParseTreeVisitor implements ParseTreeItemVisitor {

    @Override
    public Object visit(final ParseTree tree) {

        final int n = tree.getChildCount();

        for (int i = 0; i < n; i++) {
            final ParseTree c = tree.getChild(i);
            visit(c);
        }
        for (final ParseTreeItemVisitor visitor : this.visitors) {
            visitor.apply(tree);
        }

        return null;
    }

    public  CustomTreeVisitor(final ParseTreeItemVisitor... visitors);

}