public void visit_(ATNState s, Set<Integer> visited) {
		if ( !visited.add(s.stateNumber) ) return;
		visited.add(s.stateNumber);

		visitState(s);
		int n = s.getNumberOfTransitions();
		for (int i=0; i<n; i++) {
			Transition t = s.transition(i);
			visit_(t.target, visited);
		}
	}
A simple visitor that walks everywhere it can go starting from s,
 without going into an infinite cycle. Override and implement
 visitState() to provide functionality.
tool/src/org/antlr/v4/automata/ATNVisitor.java