public static Map<String, Integer> toMap(String[] keys) {
		Map<String, Integer> m = new HashMap<String, Integer>();
		for (int i=0; i<keys.length; i++) {
			m.put(keys[i], i);
		}
		return m;
	}
Convert array of strings to string&rarr;index map. Useful for
 converting rulenames to name&rarr;ruleindex map.
runtime/Java/src/org/antlr/v4/runtime/misc/Utils.java