4 using System.Collections.Generic;
5 using System.Runtime.Serialization;
6 using System.Threading;
10 namespace SiliconStudio.Shaders.Ast
21 private List<Node> childrenList = null;
22 private Dictionary<object, object> tags;
40 public override bool Equals(
object against)
42 return base.Equals(against);
47 return base.GetHashCode();
50 public static bool operator ==(
Node left,
Node right)
52 return Equals(left, right);
55 public static bool operator !=(
Node left,
Node right)
57 return !Equals(left, right);
63 protected List<Node> ChildrenList
67 if (childrenList == null)
68 childrenList =
new List<Node>();
80 if (tags == null)
return null;
82 tags.TryGetValue(tagKey, out result);
94 if (tags == null)
return true;
95 return tags.Remove(tagKey);
107 if (tags == null)
return false;
108 return tags.ContainsKey(tagKey);
116 public void SetTag(
object tagKey,
object tagValue)
118 if (tags == null) tags =
new Dictionary<object, object>();
120 tags.Add(tagKey, tagValue);
135 return GetType().Name;
bool ContainsTag(object tagKey)
Determines whether the specified instance contains this tag.
virtual IEnumerable< Node > Childrens()
Gets the child nodes.
bool RemoveTag(object tagKey)
Gets a tag value associated to this node..
void SetTag(object tagKey, object tagValue)
Sets a tag value associated to this node.
SiliconStudio.Shaders.Ast.SourceSpan SourceSpan
Node()
Initializes a new instance of the Node class.
override string ToString()
override int GetHashCode()
override bool Equals(object against)
object GetTag(object tagKey)
Gets a tag value associated to this node..