19 using System.Collections.Generic;
25 using ErrorManagement;
27 using TypeSystem.Operations;
31 #region enum IdentifierMode
68 private int indexOfSSA;
73 private string ilName =
"";
84 set { this.idMode = value; }
85 get {
return this.idMode; }
92 get {
return this.symbol; }
93 set { this.symbol = value; }
100 get {
return this.indexOfSSA; }
101 set { this.indexOfSSA = value; }
110 get {
return this.frozenTypeExpression; }
111 set { this.frozenTypeExpression = value; }
123 if (!this.ilName.Equals(
""))
128 if (this.indexOfSSA != -1)
131 this.ilName = this.ilReservedWords.MakeILComplaint(this.Identifier);
139 private void SSARename() {
141 aux.AppendFormat(
"{0}__{1}", this.Identifier, this.indexOfSSA);
142 this.ilName = aux.ToString();
161 this.Identifier = idenfifier;
162 this.idMode = IdentifierMode.Instance;
163 this.indexOfSSA = -1;
178 return v.Visit(
this, o);
182 #region Dispatcher AstOperation
191 return op.Exec(
this, arg);
196 #region Equals&GetHashCode
197 public override bool Equals(
object obj) {
201 if (singleId == null)
203 return this.Identifier.Equals(singleId.Identifier) && this.indexOfSSA == singleId.indexOfSSA;
206 return this.Identifier.GetHashCode() * this.indexOfSSA;
override int GetHashCode()
Encapsulates a name expression of our programming language.
This class encapsulates a location in a specific file. Implements an Inmutable pattern. So it can be used in any context, that is his internal fields never change.
This class represent the entry wnen sending a message to an operation object. derived from AstNode ...
Abstract class that represents all different types.
System.Text.StringBuilder StringBuilder
This class represents a symbol associated with its identifier.
Encapsulates a identifier expression of our programming language.
IdentifierMode
Represents how to use the identifier
SingleIdentifierExpression(string idenfifier, Location location)
Constructor of SingleIdentifierExpression
int IndexOfSSA
Gets or sets the index associated with SSA algorithm
string ILName
Gets the IL name associated to the declaration identifier.
Location location
Location: Encapsulates in one object the line, column and filename
Symbol IdSymbol
Gets or sets the symbol of the identifier.
IdentifierMode IdMode
Gets the mode to use de identifier.
override object AcceptOperation(AstOperation op, object arg)
Dispatches expressions to the operation passed as argument. It provokes the execution of op...
TypeExpression FrozenTypeExpression
WriteType variable may change its type's substitution (e.g., field type variables) This attribute sav...
override bool Equals(object obj)
override Object Accept(Visitor v, Object o)
Accept method of a concrete visitor.