public static HashSet <string> GetVarsUsed(Absy node) { var vu = new VarsUsed(); vu.Visit(node); return(vu.varsUsed); }
public static HashSet <Variable> GetVariables(Absy node) { var vu = new VarsUsed(); vu.Visit(node); return(vu.Vars); }
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); }