The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
InheritedAttributes.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: InheritedAttributes.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // This class encapsulates several inherited attributes used in code //
9 // generation process. //
10 // -------------------------------------------------------------------------- //
11 // Create date: 27-07-2007 //
12 // Modification date: 28-07-2007 //
14 
15 using AST;
16 using TypeSystem;
17 
18 namespace CodeGeneration
19 {
25  {
26  #region Fields
27 
31  private MethodDefinition node;
32 
36  private bool assignment;
37 
41  private Expression reference;
42 
46  private bool arrayAccess;
47 
51  private MethodType actualMethodCalled;
52 
56  private bool isParentNodeAnInvocation;
57 
63  private AstNode parentNode;
64  #endregion
65 
66  #region Properties
67 
71  public bool Assignment
72  {
73  get { return assignment; }
74  set { assignment = value; }
75  }
76 
77 
78  private bool isIntrospectiveInvocation;
82  public bool IsIntrospectiveInvocation
83  {
84  get { return isIntrospectiveInvocation; }
85  set { isIntrospectiveInvocation = value; }
86  }
87 
91  public bool ArrayAccessFound
92  {
93  get { return arrayAccess; }
94  set { arrayAccess = value; }
95  }
96 
101  {
102  get { return this.node; }
103  set { this.node = value; }
104  }
105 
109  public Expression Reference
110  {
111  get { return this.reference; }
112  set { this.reference = value; }
113  }
114 
119  {
120  get { return this.actualMethodCalled; }
121  set { this.actualMethodCalled = value; }
122  }
123 
127  public bool IsParentNodeAnInvocation
128  {
129  get { return this.isParentNodeAnInvocation; }
130  set { this.isParentNodeAnInvocation = value; }
131  }
132 
139  get { return this.parentNode; }
140  }
144  private bool messagePassed;
145 
146  public bool MessagePassed {
147  get { return this.messagePassed; }
148 
149  set { this.messagePassed = value; }
150  }
151 
152  #endregion
153 
154  #region Constructor
155  // <summary>
158  public InheritedAttributes(MethodDefinition methodInfo, bool assignmentFound, Expression idReference, bool arrayAccessFound, MethodType methodTypeExpression, bool invocationParentNode, AstNode parentNode, bool messagePassed) {
159  this.node = methodInfo;
160  this.assignment = assignmentFound;
161  this.reference = idReference;
162  this.arrayAccess = arrayAccessFound;
163  this.actualMethodCalled = methodTypeExpression;
164  this.isParentNodeAnInvocation = invocationParentNode;
165  this.parentNode = parentNode;
166  this.messagePassed = messagePassed;
167  this.isIntrospectiveInvocation = false;
168  }
169  public InheritedAttributes(MethodDefinition methodInfo, bool assignmentFound, Expression idReference, bool arrayAccessFound, MethodType methodTypeExpression, bool invocationParentNode)
170  : this(methodInfo, assignmentFound, idReference, arrayAccessFound, methodTypeExpression, invocationParentNode, null, false)
171  { }
172 
173  #endregion
174  }
175 }
Encapsulates a definition of a concrete method.
Abstract class encapsulate a programming language expression.
Definition: Expression.cs:37
bool IsParentNodeAnInvocation
Gets or sets true if the parent node is an InvocationExpression. Otherwise, false.
MethodType ActualMethodCalled
Gets or sets the type expression of the current invocation expression. If not exists, their value is null.
bool ArrayAccessFound
Gets or sets true if array access expression found. Otherwise, gets or sets false.
MethodDefinition CurrentMethod
Gets or sets the current method definition node.
Expression Reference
Gets or sets the reference of a concrete identifier.
InheritedAttributes(MethodDefinition methodInfo, bool assignmentFound, Expression idReference, bool arrayAccessFound, MethodType methodTypeExpression, bool invocationParentNode, AstNode parentNode, bool messagePassed)
Abstract class for all nodes that compounds the abstract syntax tree.
Definition: AstNode.cs:33
This class encapsulates several inherited attributes used in code generation process.
bool Assignment
Gets or sets true if assignment expression found. Otherwise, gets or sets false.
Representa a method type.
Definition: MethodType.cs:37
bool IsIntrospectiveInvocation
Gets or sets true the node is an Introspective Invocation. Otherwise, gets or sets false...
AstNode ParentNode
When suitable, the parent node of the node that is being visited. It is very important for the Single...
InheritedAttributes(MethodDefinition methodInfo, bool assignmentFound, Expression idReference, bool arrayAccessFound, MethodType methodTypeExpression, bool invocationParentNode)