public void checkForQualifiedRuleIssues(Grammar g, List<GrammarAST> qualifiedRuleRefs) {
		for (GrammarAST dot : qualifiedRuleRefs) {
			GrammarAST grammar = (GrammarAST)dot.getChild(0);
			GrammarAST rule = (GrammarAST)dot.getChild(1);
			g.tool.log("semantics", grammar.getText()+"."+rule.getText());
			Grammar delegate = g.getImportedGrammar(grammar.getText());
			if ( delegate==null ) {
				errMgr.grammarError(ErrorType.NO_SUCH_GRAMMAR_SCOPE,
						g.fileName, grammar.token, grammar.getText(),
						rule.getText());
			}
			else {
				if ( g.getRule(grammar.getText(), rule.getText())==null ) {
					errMgr.grammarError(ErrorType.NO_SUCH_RULE_IN_SCOPE,
							g.fileName, rule.token, grammar.getText(),
							rule.getText());
				}
			}
		}
	}
For same rule compare values from next index:
TOKEN_WITH_SAME_VALUES: 'asdf' | 'asdf';
For different rules compare from start value:
TOKEN1: 'asdf';
TOKEN2: 'asdf';
tool/src/org/antlr/v4/semantics/SymbolChecks.java