private List<String> getSingleTokenValues(Rule rule)
	{
		List<String> values = new ArrayList<>();
		for (Alternative alt : rule.alt) {
			if (alt != null) {
				// select first alt if token has a command
				Tree rootNode = alt.ast.getChildCount() == 2 &&
						alt.ast.getChild(0) instanceof AltAST && alt.ast.getChild(1) instanceof GrammarAST
						? alt.ast.getChild(0)
						: alt.ast;

				if (rootNode.getTokenStartIndex() == -1) {
					continue; // ignore autogenerated tokens from combined grammars that start with T__
				}

				// Ignore alt if contains not only string literals (repetition, optional)
				boolean ignore = false;
				StringBuilder currentValue = new StringBuilder();
				for (int i = 0; i < rootNode.getChildCount(); i++) {
					Tree child = rootNode.getChild(i);
					if (!(child instanceof TerminalAST)) {
						ignore = true;
						break;
					}

					TerminalAST terminalAST = (TerminalAST)child;
					if (terminalAST.token.getType() != ANTLRLexer.STRING_LITERAL) {
						ignore = true;
						break;
					}
					else {
						String text = terminalAST.token.getText();
						currentValue.append(text.substring(1, text.length() - 1));
					}
				}

				if (!ignore) {
					values.add(currentValue.toString());
				}
			}
		}
		return values;
	}
{@return} list of simple string literals for rule {@param rule}
tool/src/org/antlr/v4/semantics/SymbolChecks.java