Example #1
0
        public static HashSet <string> GetVarsUsed(Absy node)
        {
            var vu = new VarsUsed();

            vu.Visit(node);
            return(vu.varsUsed);
        }
Example #2
0
        public static HashSet <Variable> GetVariables(Absy node)
        {
            var vu = new VarsUsed();

            vu.Visit(node);
            return(vu.Vars);
        }
Example #3
0
        private QKeyValue Remove(QKeyValue attr, HashSet <string> vars)
        {
            if (attr == null)
            {
                return(null);
            }
            var vu = new VarsUsed();

            attr.Params.Where(e => e is Expr).Iter(e => vu.VisitExpr(e as Expr));
            if (!vu.varsUsed.IsSubsetOf(vars))
            {
                return(attr.Next);
            }
            attr.Next = Remove(attr.Next, vars);
            return(attr);
        }