Antlr4.Semantics.AttributeChecks.SetAttr C# (CSharp) Method

SetAttr() public method

public SetAttr ( string expr, Antlr.Runtime.IToken x, Antlr.Runtime.IToken rhs ) : void
expr string
x Antlr.Runtime.IToken
rhs Antlr.Runtime.IToken
return void
        public virtual void SetAttr(string expr, IToken x, IToken rhs)
        {
            if (g.IsLexer())
            {
                errMgr.GrammarError(ErrorType.ATTRIBUTE_IN_LEXER_ACTION,
                                    g.fileName, x, x.Text, expr);
                return;
            }
            if (node.resolver.ResolveToAttribute(x.Text, node) == null)
            {
                ErrorType errorType = ErrorType.UNKNOWN_SIMPLE_ATTRIBUTE;
                if (node.resolver.ResolvesToListLabel(x.Text, node))
                {
                    // $ids for ids+=ID etc...
                    errorType = ErrorType.ASSIGNMENT_TO_LIST_LABEL;
                }

                errMgr.GrammarError(errorType,
                                    g.fileName, x, x.Text, expr);
            }
            new AttributeChecks(g, r, alt, node, rhs).ExamineAction();
        }