private IASTNode Expand() { var parameters = ParameterDetector.LocateParameters(_tree, new HashSet <string>(_map.Keys)); var nodeMapping = new Dictionary <IASTNode, IEnumerable <IASTNode> >(); foreach (IASTNode param in parameters) { var paramName = param.GetChild(0); var aliases = _map[paramName.Text]; var astAliases = new List <IASTNode>(); foreach (string alias in aliases) { IASTNode astAlias = param.DupNode(); IASTNode astAliasName = paramName.DupNode(); astAliasName.Text = alias; astAlias.AddChild(astAliasName); astAliases.Add(astAlias); } nodeMapping.Add(param, astAliases); } return(DuplicateTree(_tree, nodeMapping)); }
public static IList <IASTNode> LocateParameters(IASTNode tree, HashSet <string> parameterNames) { var detector = new ParameterDetector(tree, parameterNames); return(detector.LocateParameters()); }
public static IList<IASTNode> LocateParameters(IASTNode tree, HashSet<string> parameterNames) { var detector = new ParameterDetector(tree, parameterNames); return detector.LocateParameters(); }