Axiom.Scripting.Compiler.ScriptCompiler._locateTarget C# (CSharp) Method

_locateTarget() private method

Returns the abstract nodes from the given tree which represent the target
private _locateTarget ( IList nodes, string target ) : List
nodes IList
target string
return List
		private List<AbstractNode> _locateTarget( IList<AbstractNode> nodes, string target )
		{
			AbstractNode iter = null;

			// Search for a top-level object node
			foreach ( AbstractNode node in nodes )
			{
				if ( node is ObjectAbstractNode )
				{
					ObjectAbstractNode impl = (ObjectAbstractNode)node;
					if ( impl.Name == target )
						iter = node;
				}
			}

			List<AbstractNode> newNodes = new List<AbstractNode>();
			if ( iter != null )
			{
				newNodes.Add( iter );
			}
			return newNodes;
		}