See previous comments - this needs to be a visitor. It's not a big change - you'll just create a private static class here that keeps a List of all the NextSequenceValueParseNode it sees.