You'll use this visitor to traverse each expression in a SELECT statement:
- loop over each parse node in SELECT
- loop over parse node in WHERE
- loop over parse node in GROUP BY (I think this is an error case if they appear here)
- loop over parse node in HAVING (here too is an error - use separate, different class to catch this: UnsupportedNextSequenceParseNodeVisitor also derived from TraverseAllParseNodeVisitor, but that throws a SQLException instead of collecting the NEXT SEQUENCE parse node occurrences)
- loop over prase node in ORDER BY

You can reuse the same NextSequenceParseNodeVisitor for UPSERT VALUES. Nothing required for UPSERT SELECT, as it'll go through the above code path.