The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
SynthesizedAttributes.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: SynthesizedAttributes.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // This class encapsulates several synthesized attributes used in code //
9 // generation process. //
10 // -------------------------------------------------------------------------- //
11 // Create date: 28-07-2007 //
12 // Modification date: 28-07-2007 //
14 
15 using AST;
16 
17 namespace CodeGeneration
18 {
24  {
25  #region Fields
26 
27  //SingleIdentifierExpression or ArrayAccessExpression
31  private Expression identifier;
32 
36  private IdentifierMode idMode;
37 
41  private bool createAuxiliarVar;
42 
43  #endregion
44 
45  #region Properties
46 
50  public Expression Identifier
51  {
52  get { return this.identifier; }
53  set { this.identifier = value; }
54  }
55 
60  {
61  get { return this.idMode; }
62  set { this.idMode = value; }
63  }
64 
68  public bool CreateAuxiliarVar
69  {
70  get { return this.createAuxiliarVar; }
71  set { this.createAuxiliarVar = value; }
72  }
73 
74  #endregion
75 
76  #region Constructor
77 
82  {
83  this.identifier = exp;
84  this.idMode = IdentifierMode.Instance;
85  if (exp is SingleIdentifierExpression)
86  this.idMode = ((SingleIdentifierExpression)exp).IdMode;
87  this.createAuxiliarVar = true;
88  }
89 
90  #endregion
91  }
92 }
Abstract class encapsulate a programming language expression.
Definition: Expression.cs:37
bool CreateAuxiliarVar
Gets or sets true if it is necessary to create an auxiliar variable. Otherwise, false.
Encapsulates a identifier expression of our programming language.
IdentifierMode
Represents how to use the identifier
IdentifierMode IdentifierExpressionMode
Gets or sets the identifier mode (Instance, UserType, Namespace)
Expression Identifier
Gets or sets the current expression to use in store instruction in assignment node.
This class encapsulates several inherited attributes used in code generation process.
SynthesizedAttributes(Expression exp)
Constructor of SynthesizedAttributes