4 using System.Collections.Generic;
7 namespace SiliconStudio.Shaders.Ast
14 #region Constructors and Destructors
36 #region Public Properties
44 public bool HasIndices
48 return Indices != null && Indices.Count > 0;
61 public List<Expression> Indices {
get; set; }
69 public bool IsSpecialReference {
get; set; }
77 public string Text {
get; set; }
81 #region Public Methods
94 if (ReferenceEquals(null, other))
98 if (ReferenceEquals(
this, other))
102 return Equals(other.
Text,
this.Text) && other.IsSpecialReference.Equals(this.IsSpecialReference);
108 if (ReferenceEquals(null, obj))
112 if (ReferenceEquals(
this, obj))
120 return Equals(other.Text, Text) && other.IsSpecialReference == IsSpecialReference;
128 int result = this.Text != null ? this.Text.GetHashCode() : 0;
129 result = (result * 397) ^ this.IsSpecialReference.GetHashCode();
143 var ranks =
new StringBuilder();
146 foreach (var expression
in Indices)
148 ranks.Append(
"[").Append(expression).Append(
"]");
152 return string.Format(IsSpecialReference ?
"<{0}{1}>" :
"{0}{1}", this.Text, ranks);
169 return Equals(left, right);
179 public static implicit
operator string(
Identifier identifier)
181 return identifier.ToString();
191 public static implicit
operator Identifier(
string identifierName)
206 return !Equals(left, right);
Identifier(string name)
Initializes a new instance of the Identifier class.
string Text
Gets or sets the name.
Identifier()
Initializes a new instance of the Identifier class.
bool Equals(Identifier other)
Equalses the specified other.
override int GetHashCode()
override string ToString()
Returns a System.String that represents this instance.
override bool Equals(object obj)