Rhino.Ast.Scope.ReplaceWith C# (CSharp) Method

ReplaceWith() public method

Used by the parser; not intended for typical use.
Used by the parser; not intended for typical use. Changes the parent-scope links for this scope's child scopes to the specified new scope. Copies symbols from this scope into new scope.
public ReplaceWith ( Rhino newScope ) : void
newScope Rhino /// the scope that will replace this one on the /// scope stack. ///
return void
		public virtual void ReplaceWith(Rhino.Ast.Scope newScope)
		{
			if (childScopes != null)
			{
				foreach (Rhino.Ast.Scope kid in childScopes)
				{
					newScope.AddChildScope(kid);
				}
				// sets kid's parent
				childScopes.Clear();
				childScopes = null;
			}
			if (symbolTable != null && !symbolTable.IsEmpty())
			{
				JoinScopes(this, newScope);
			}
		}