Antlr4.Tool.Grammar.DefineAction C# (CSharp) Méthode

DefineAction() public méthode

public DefineAction ( GrammarAST atAST ) : void
atAST Antlr4.Tool.Ast.GrammarAST
Résultat void
        public virtual void DefineAction(GrammarAST atAST)
        {
            if (atAST.ChildCount == 2)
            {
                string name = atAST.GetChild(0).Text;
                namedActions[name] = (ActionAST)atAST.GetChild(1);
            }
            else
            {
                string scope = atAST.GetChild(0).Text;
                string gtype = GetTypeString();
                if (scope.Equals(gtype) || (scope.Equals("parser") && gtype.Equals("combined")))
                {
                    string name = atAST.GetChild(1).Text;
                    namedActions[name] = (ActionAST)atAST.GetChild(2);
                }
            }
        }