AST node for a simple name.
AST node for a simple name. A simple name is an identifier that is not a keyword. Node type is Rhino.Token.NAME .

This node type is also used to represent certain non-identifier names that are part of the language syntax. It's used for the "get" and "set" pseudo-keywords for object-initializer getter/setter properties, and it's also used for the "*" wildcard in E4X XML namespace and name expressions.

Inheritance: AstNode
Beispiel #1
0
		public ContinueStatement(Name label)
		{
			{
				type = Token.CONTINUE;
			}
			SetLabel(label);
		}
Beispiel #2
0
		/// <summary>Sets the intended label of this break statement, e.g.</summary>
		/// <remarks>
		/// Sets the intended label of this break statement, e.g.  'foo'
		/// in "break foo". Also sets the parent of the label to this node.
		/// </remarks>
		/// <param name="label">
		/// the break label, or
		/// <code>null</code>
		/// if the statement is
		/// just the "break" keyword by itself.
		/// </param>
		public virtual void SetBreakLabel(Name label)
		{
			breakLabel = label;
			if (label != null)
			{
				label.SetParent(this);
			}
		}
Beispiel #3
0
		public PropertyGet(AstNode target, Name property, int dotPosition) : base(Token.GETPROP, target, property, dotPosition)
		{
			{
				type = Token.GETPROP;
			}
		}
Beispiel #4
0
		/// <summary>Constructor.</summary>
		/// <remarks>
		/// Constructor.  Updates bounds to include left (
		/// <code>target</code>
		/// ) and
		/// right (
		/// <code>property</code>
		/// ) nodes.
		/// </remarks>
		public PropertyGet(AstNode target, Name property) : base(target, property)
		{
			{
				type = Token.GETPROP;
			}
		}
Beispiel #5
0
		public PropertyGet(int pos, int len, AstNode target, Name property) : base(pos, len, target, property)
		{
			{
				type = Token.GETPROP;
			}
		}
Beispiel #6
0
		/// <summary>Sets the property being accessed, and sets its parent to this node.</summary>
		/// <remarks>Sets the property being accessed, and sets its parent to this node.</remarks>
		/// <exception cref="System.ArgumentException">
		/// } if
		/// <code>property</code>
		/// is
		/// <code>null</code>
		/// </exception>
		public virtual void SetProperty(Name property)
		{
			SetRight(property);
		}
Beispiel #7
0
		/// <summary>Sets function name, and sets its parent to this node.</summary>
		/// <remarks>Sets function name, and sets its parent to this node.</remarks>
		/// <param name="name">
		/// function name,
		/// <code>null</code>
		/// for anonymous functions
		/// </param>
		public virtual void SetFunctionName(Name name)
		{
			functionName = name;
			if (name != null)
			{
				name.SetParent(this);
			}
		}
Beispiel #8
0
		public FunctionNode(int pos, Name name) : base(pos)
		{
			{
				type = Token.FUNCTION;
			}
			SetFunctionName(name);
		}
Beispiel #9
0
		/// <summary>Sets catch variable node, and sets its parent to this node.</summary>
		/// <remarks>Sets catch variable node, and sets its parent to this node.</remarks>
		/// <param name="varName">catch variable</param>
		/// <exception cref="System.ArgumentException">
		/// if varName is
		/// <code>null</code>
		/// </exception>
		public virtual void SetVarName(Name varName)
		{
			AssertNotNull(varName);
			this.varName = varName;
			varName.SetParent(this);
		}
Beispiel #10
0
		/// <summary>Sets namespace, and sets its parent to this node.</summary>
		/// <remarks>
		/// Sets namespace, and sets its parent to this node.
		/// Can be
		/// <code>null</code>
		/// .
		/// </remarks>
		public virtual void SetNamespace(Name @namespace)
		{
			this.@namespace = @namespace;
			if (@namespace != null)
			{
				@namespace.SetParent(this);
			}
		}
Beispiel #11
0
		private Node TransformName(Name node)
		{
			decompiler.AddName(node.GetIdentifier());
			return node;
		}
Beispiel #12
0
		/// <summary>Sets property name, and sets its parent to this node.</summary>
		/// <remarks>Sets property name, and sets its parent to this node.</remarks>
		/// <exception cref="System.ArgumentException">
		/// if
		/// <code>propName</code>
		/// is
		/// <code>null</code>
		/// </exception>
		public virtual void SetPropName(Name propName)
		{
			AssertNotNull(propName);
			this.propName = propName;
			propName.SetParent(this);
		}
Beispiel #13
0
		public ContinueStatement(int pos, int len, Name label) : this(pos, len)
		{
			SetLabel(label);
		}
Beispiel #14
0
		/// <summary>Sets the intended label of this continue statement.</summary>
		/// <remarks>
		/// Sets the intended label of this continue statement.
		/// Only applies if the statement was of the form "continue &lt;label&gt;".
		/// </remarks>
		/// <param name="label">
		/// the continue label, or
		/// <code>null</code>
		/// if not present.
		/// </param>
		public virtual void SetLabel(Name label)
		{
			this.label = label;
			if (label != null)
			{
				label.SetParent(this);
			}
		}