@Override
	public void nonLocalAttr(String expr, Token x, Token y) {
		Rule r = g.getRule(x.getText());
		if ( r==null ) {
			errMgr.grammarError(ErrorType.UNDEFINED_RULE_IN_NONLOCAL_REF,
								g.fileName, x, x.getText(), y.getText(), expr);
		}
		else if ( r.resolveToAttribute(y.getText(), null)==null ) {
			errMgr.grammarError(ErrorType.UNKNOWN_RULE_ATTRIBUTE,
								g.fileName, y, y.getText(), x.getText(), expr);

		}
	}
Trigger checks for various kinds of attribute expressions.
 no side-effects.
tool/src/org/antlr/v4/semantics/AttributeChecks.java