Antlr4.Codegen.ParserFactory.Set C# (CSharp) Method

Set() public method

public Set ( GrammarAST setAST, GrammarAST labelAST, bool invert ) : IList
setAST Antlr4.Tool.Ast.GrammarAST
labelAST Antlr4.Tool.Ast.GrammarAST
invert bool
return IList
        public override IList<SrcOp> Set(GrammarAST setAST, GrammarAST labelAST, bool invert)
        {
            MatchSet matchOp;
            if (invert)
                matchOp = new MatchNotSet(this, setAST);
            else
                matchOp = new MatchSet(this, setAST);
            if (labelAST != null)
            {
                string label = labelAST.Text;
                RuleFunction rf = GetCurrentRuleFunction();
                if (labelAST.Parent.Type == ANTLRParser.PLUS_ASSIGN)
                {
                    DefineImplicitLabel(setAST, matchOp);
                    TokenListDecl l = GetTokenListLabelDecl(label);
                    rf.AddContextDecl(setAST.GetAltLabel(), l);
                }
                else
                {
                    Decl d = GetTokenLabelDecl(label);
                    matchOp.labels.Add(d);
                    rf.AddContextDecl(setAST.GetAltLabel(), d);
                }
            }
            if (controller.NeedsImplicitLabel(setAST, matchOp))
                DefineImplicitLabel(setAST, matchOp);
            AddToLabelList listLabelOp = GetAddToListOpIfListLabelPresent(matchOp, labelAST);
            return List(matchOp, listLabelOp);
        }