The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
ConstructorDefinition.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: ConstructorDefinition.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // Encapsulates a definition of a concrete constructor. //
9 // Inheritance: MethodDefinition. //
10 // Implements Composite pattern [Composite]. //
11 // Implements Visitor pattern [Concrete Element]. //
12 // -------------------------------------------------------------------------- //
13 // Create date: 31-12-2006 //
14 // Modification date: 01-02-2007 //
16 
17 using System;
18 using System.Collections.Generic;
19 using System.Text;
20 
21 using Tools;
22 using TypeSystem;
23 using ErrorManagement;
24 
25 namespace AST
26 {
36  {
37  #region Fields
38 
42  private InvocationExpression initialization;
43 
44  #endregion
45 
46  #region Properties
47 
52  {
53  get { return this.initialization; }
54  }
55 
59  public string SetReturnType
60  {
61  set { this.ReturnTypeInfo = value; }
62  }
63 
64  #endregion
65 
66  #region Constructor
67 
78  public ConstructorDefinition(SingleIdentifierExpression id, List<Modifier> modifiers, List<Parameter> parameters, InvocationExpression init, Block stats, Location location)
79  : base(id, stats, null, parameters, modifiers, location)
80  {
81  this.initialization = init;
82  }
83 
84  #endregion
85 
86  #region Accept()
87 
94  public override Object Accept(Visitor v, Object o)
95  {
96  return v.Visit(this, o);
97  }
98 
99  #endregion
100  }
101 }
Encapsulates a definition of a concrete method.
Encapsulates a block of statements.
Definition: Block.cs:34
Encapsulates a invocation expression.
Abstract class to define different visits over the abstract syntax tree.
Definition: Visitor.cs:29
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
override Object Accept(Visitor v, Object o)
Accept method of a concrete visitor.
Encapsulates a identifier expression of our programming language.
string SetReturnType
Sets the nominal type of the return type
ConstructorDefinition(SingleIdentifierExpression id, List< Modifier > modifiers, List< Parameter > parameters, InvocationExpression init, Block stats, Location location)
Constructor of ConstructorDefinition.
Encapsulates a definition of a concrete constructor.
Location location
Location: Encapsulates in one object the line, column and filename
Definition: AstNode.cs:39
InvocationExpression Initialization
Gets the base or this initialization of the constructor definition