@Override
	public void setAttr(String expr, Token x, Token rhs) {
		if ( g.isLexer() ) {
			errMgr.grammarError(ErrorType.ATTRIBUTE_IN_LEXER_ACTION,
								g.fileName, x, x.getText(), expr);
			return;
		}
		if ( node.resolver.resolveToAttribute(x.getText(), node)==null ) {
			ErrorType errorType = ErrorType.UNKNOWN_SIMPLE_ATTRIBUTE;
			if ( node.resolver.resolvesToListLabel(x.getText(), node) ) {
				// $ids for ids+=ID etc...
				errorType = ErrorType.ASSIGNMENT_TO_LIST_LABEL;
			}

			errMgr.grammarError(errorType,
								g.fileName, x, x.getText(), expr);
		}
		new AttributeChecks(g, r, alt, node, rhs).examineAction();
	}
Trigger checks for various kinds of attribute expressions.
 no side-effects.
tool/src/org/antlr/v4/semantics/AttributeChecks.java