当前位置: 首页>>代码示例>>C#>>正文


C# AstNode.SetParent方法代码示例

本文整理汇总了C#中AstNode.SetParent方法的典型用法代码示例。如果您正苦于以下问题:C# AstNode.SetParent方法的具体用法?C# AstNode.SetParent怎么用?C# AstNode.SetParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AstNode的用法示例。


在下文中一共展示了AstNode.SetParent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetBody

		/// <summary>Sets loop body.</summary>
		/// <remarks>
		/// Sets loop body.  Sets the parent of the body to this loop node,
		/// and updates its offset to be relative.  Extends the length of this
		/// node to include the body.
		/// </remarks>
		public virtual void SetBody(AstNode body)
		{
			this.body = body;
			int end = body.GetPosition() + body.GetLength();
			this.SetLength(end - this.GetPosition());
			body.SetParent(this);
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:13,代码来源:Loop.cs

示例2: SetValue

		/// <summary>Sets yielded expression, and sets its parent to this node.</summary>
		/// <remarks>Sets yielded expression, and sets its parent to this node.</remarks>
		/// <param name="expr">
		/// the value to yield. Can be
		/// <code>null</code>
		/// .
		/// </param>
		public virtual void SetValue(AstNode expr)
		{
			this.value = expr;
			if (expr != null)
			{
				expr.SetParent(this);
			}
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:15,代码来源:Yield.cs

示例3: SetReturnValue

		/// <summary>Sets return value expression, and sets its parent to this node.</summary>
		/// <remarks>
		/// Sets return value expression, and sets its parent to this node.
		/// Can be
		/// <code>null</code>
		/// .
		/// </remarks>
		public virtual void SetReturnValue(AstNode returnValue)
		{
			this.returnValue = returnValue;
			if (returnValue != null)
			{
				returnValue.SetParent(this);
			}
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:15,代码来源:ReturnStatement.cs

示例4: SetResult

		/// <summary>Sets result expression, and sets its parent to this node.</summary>
		/// <remarks>Sets result expression, and sets its parent to this node.</remarks>
		/// <exception cref="System.ArgumentException">
		/// if result is
		/// <code>null</code>
		/// </exception>
		public virtual void SetResult(AstNode result)
		{
			AssertNotNull(result);
			this.result = result;
			result.SetParent(this);
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:12,代码来源:ArrayComprehension.cs

示例5: SetTarget

		/// <summary>
		/// Sets the variable name or destructuring form, and sets
		/// its parent to this node.
		/// </summary>
		/// <remarks>
		/// Sets the variable name or destructuring form, and sets
		/// its parent to this node.
		/// </remarks>
		/// <exception cref="System.ArgumentException">
		/// if target is
		/// <code>null</code>
		/// </exception>
		public virtual void SetTarget(AstNode target)
		{
			// Don't throw exception if target is an "invalid" node type.
			// See mozilla/js/tests/js1_7/block/regress-350279.js
			if (target == null)
			{
				throw new ArgumentException("invalid target arg");
			}
			this.target = target;
			target.SetParent(this);
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:23,代码来源:VariableInitializer.cs

示例6: SetExpression

		/// <summary>
		/// Sets the switch discriminant expression, and sets its parent
		/// to this node.
		/// </summary>
		/// <remarks>
		/// Sets the switch discriminant expression, and sets its parent
		/// to this node.
		/// </remarks>
		/// <exception cref="System.ArgumentException">
		/// } if expression is
		/// <code>null</code>
		/// </exception>
		public virtual void SetExpression(AstNode expression)
		{
			AssertNotNull(expression);
			this.expression = expression;
			expression.SetParent(this);
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:18,代码来源:SwitchStatement.cs

示例7: SetMemberExprNode

		/// <summary>
		/// Rhino supports a nonstandard Ecma extension that allows you to
		/// say, for instance, function a.b.c(arg1, arg) {...}, and it will
		/// be rewritten at codegen time to:  a.b.c = function(arg1, arg2) {...}
		/// If we detect an expression other than a simple Name in the position
		/// where a function name was expected, we record that expression here.
		/// </summary>
		/// <remarks>
		/// Rhino supports a nonstandard Ecma extension that allows you to
		/// say, for instance, function a.b.c(arg1, arg) {...}, and it will
		/// be rewritten at codegen time to:  a.b.c = function(arg1, arg2) {...}
		/// If we detect an expression other than a simple Name in the position
		/// where a function name was expected, we record that expression here.
		/// <p>
		/// This extension is only available by setting the CompilerEnv option
		/// "isAllowMemberExprAsFunctionName" in the Parser.
		/// </remarks>
		public virtual void SetMemberExprNode(AstNode node)
		{
			memberExprNode = node;
			if (node != null)
			{
				node.SetParent(this);
			}
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:25,代码来源:FunctionNode.cs

示例8: AddParam

		/// <summary>Adds a parameter to the function parameter list.</summary>
		/// <remarks>
		/// Adds a parameter to the function parameter list.
		/// Sets the parent of the param node to this node.
		/// </remarks>
		/// <param name="param">the parameter</param>
		/// <exception cref="System.ArgumentException">
		/// if param is
		/// <code>null</code>
		/// </exception>
		public virtual void AddParam(AstNode param)
		{
			AssertNotNull(param);
			if (@params == null)
			{
				@params = new List<AstNode>();
			}
			@params.Add(param);
			param.SetParent(this);
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:20,代码来源:FunctionNode.cs

示例9: SetFinallyBlock

		/// <summary>Sets finally block, and sets its parent to this node.</summary>
		/// <remarks>
		/// Sets finally block, and sets its parent to this node.
		/// May be
		/// <code>null</code>
		/// .
		/// </remarks>
		public virtual void SetFinallyBlock(AstNode finallyBlock)
		{
			this.finallyBlock = finallyBlock;
			if (finallyBlock != null)
			{
				finallyBlock.SetParent(this);
			}
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:15,代码来源:TryStatement.cs

示例10: AddNode

 public void AddNode(AstNode node)
 {
     ChildNodes.Add(node);
     node.SetParent(this);
 }
开发者ID:cubean,项目名称:CG,代码行数:5,代码来源:AST.cs

示例11: SetOperand

		/// <summary>Sets the operand, and sets its parent to be this node.</summary>
		/// <remarks>Sets the operand, and sets its parent to be this node.</remarks>
		/// <exception cref="System.ArgumentException">
		/// } if
		/// <code>operand</code>
		/// is
		/// <code>null</code>
		/// </exception>
		public virtual void SetOperand(AstNode operand)
		{
			AssertNotNull(operand);
			this.operand = operand;
			operand.SetParent(this);
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:14,代码来源:UnaryExpression.cs

示例12: SetThenPart

		/// <summary>Sets statement to execute if condition is true</summary>
		/// <exception cref="System.ArgumentException">
		/// if thenPart is
		/// <code>null</code>
		/// </exception>
		public virtual void SetThenPart(AstNode thenPart)
		{
			AssertNotNull(thenPart);
			this.thenPart = thenPart;
			thenPart.SetParent(this);
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:11,代码来源:IfStatement.cs

示例13: SetElsePart

		/// <summary>Sets statement to execute if condition is false</summary>
		/// <param name="elsePart">
		/// statement to execute if condition is false.
		/// Can be
		/// <code>null</code>
		/// .
		/// </param>
		public virtual void SetElsePart(AstNode elsePart)
		{
			this.elsePart = elsePart;
			if (elsePart != null)
			{
				elsePart.SetParent(this);
			}
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:15,代码来源:IfStatement.cs

示例14: SetIteratedObject

		/// <summary>Sets object being iterated over, and sets its parent to this node.</summary>
		/// <remarks>Sets object being iterated over, and sets its parent to this node.</remarks>
		/// <exception cref="System.ArgumentException">
		/// if
		/// <code>object</code>
		/// is
		/// <code>null</code>
		/// </exception>
		public virtual void SetIteratedObject(AstNode @object)
		{
			AssertNotNull(@object);
			this.iteratedObject = @object;
			@object.SetParent(this);
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:14,代码来源:ForInLoop.cs

示例15: SetIterator

		/// <summary>Sets loop iterator expression:  the part before the "in" keyword.</summary>
		/// <remarks>
		/// Sets loop iterator expression:  the part before the "in" keyword.
		/// Also sets its parent to this node.
		/// </remarks>
		/// <exception cref="System.ArgumentException">
		/// if
		/// <code>iterator</code>
		/// is
		/// <code>null</code>
		/// </exception>
		public virtual void SetIterator(AstNode iterator)
		{
			AssertNotNull(iterator);
			this.iterator = iterator;
			iterator.SetParent(this);
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:17,代码来源:ForInLoop.cs


注:本文中的AstNode.SetParent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。