Exemple #1
0
        public override bool test(CSsemi.CSemiExp semi)
        {
            Display.displayRules(actionDelegate, "rule   DetectFunction");
            if (semi[semi.count - 1] != "{")
            {
                return(false);
            }

            int index = semi.FindFirst("(");

            if (index > 0 && !isSpecialToken(semi[index - 1]))
            {
                CSsemi.CSemiExp local = new CSsemi.CSemiExp();
                local.Add("function").Add(semi[index - 1]);

                //search for all arguments in the function and add to local
                for (int i = index; i < semi.count; i++)
                {
                    if (UserType.userDefinedSet.Contains(semi[i]))
                    {
                        local.Add(semi[i]);
                    }
                }

                doActions(local);
                return(true);
            }
            return(false);
        }
        public override bool test(CSsemi.CSemiExp semi)
        {
            Display.displayRules(actionDelegate, "rule   DetectFunction");
            if (semi[semi.count - 1] != "{")
            {
                return(false);
            }

            int index = semi.FindFirst("(");

            if (index > 0 && !isSpecialToken(semi[index - 1]))
            {
                CSsemi.CSemiExp local = new CSsemi.CSemiExp();
                local.Add("function").Add(semi[index - 1]);
                doActions(local);
                return(true);
            }
            return(false);
        }