private List<GrammarAST> getRuleTokens(List<GrammarAST> refs) {
		List<GrammarAST> result = new ArrayList<>(refs.size());
		for (GrammarAST ref : refs) {
			CommonTree r = ref;

			boolean ignore = false;
			while (r != null) {
				// Ignore string literals in predicates
				if (r instanceof PredAST) {
					ignore = true;
					break;
				}
				r = r.parent;
			}

			if (!ignore) {
				result.add(ref);
			}
		}

		return result;
	}
for all alts, find which ref X or r needs List
	   Must see across alts. If any alt needs X or r as list, then
	   define as list.
tool/src/org/antlr/v4/codegen/model/RuleFunction.java