The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
SSAElement.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: SSAElement.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // This class stores the information to use in SSA map and allows to //
9 // create a new declarations. //
10 // -------------------------------------------------------------------------- //
11 // Create date: 11-04-2007 //
12 // Modification date: 30-04-2007 //
14 
15 using System;
16 using System.Collections.Generic;
17 using System.Text;
18 
19 using AST;
20 using ErrorManagement;
21 using TypeSystem;
22 
23 namespace Semantic.SSAAlgorithm
24 {
29  class SSAElement
30  {
31  #region Fields
32 
36  private string type;
37 
40  // the ocurrence of an intem in the text program
42  protected Location location;
43 
44 
45 
49  private int indexSSA;
50 
51  #endregion
52 
53  #region Properties
54 
55  public Location Location {
56  get { return this.location; }
57  }
61  public string TypeId
62  {
63  get { return type; }
64  }
65 
69 
70 
74  public int IndexSSA
75  {
76  get { return indexSSA; }
77  }
78 
79  #endregion
80 
81  #region Constructors
82 
90  public SSAElement(string type, Location location)
91  {
92  this.type = type;
93  this.location = location;
94  this.indexSSA = 0;
95  }
96 
97  #endregion
98 
99  #region UpdateIndexSSA
100 
105  public void UpdateIndexSSA(int value)
106  {
107  this.indexSSA = value;
108  }
109 
110  #endregion
111 
112  #region Clone()
113 
118  public SSAElement Clone()
119  {
120  SSAElement aux = new SSAElement(this.type, location.Clone());
121  aux.indexSSA = this.indexSSA;
122  return aux;
123  }
124 
125  #endregion
126  }
127 }
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.
Definition: Location.cs:24
Location location
Location: Encapsulates in one object the line, column and filename
Definition: SSAElement.cs:42
This class stores the information to use in SSA map and allows to create a new declarations.
Definition: SSAElement.cs:29
SSAElement(string type, Location location)
Constructor of SSAElement.
Definition: SSAElement.cs:90
void UpdateIndexSSA(int value)
Updates the value of index SSA
Definition: SSAElement.cs:105
SSAElement Clone()
Clones the current SSA element.
Definition: SSAElement.cs:118