The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
FieldDefinition.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: FieldDefinition.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // Encapsulates a definition of a concrete field. //
9 // Inheritance: FieldDeclaration. //
10 // Implements Composite pattern [Composite]. //
11 // Implements Visitor pattern [Concrete Element]. //
12 // -------------------------------------------------------------------------- //
13 // Create date: 28-01-2007 //
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 Expression initialization;
43 
44  #endregion
45 
46  #region Properties
47 
51  public Expression Init
52  {
53  get { return this.initialization; }
54  }
55 
56  #endregion
57 
58  #region Constructor
59 
70  public FieldDefinition(SingleIdentifierExpression id, Expression init, string type, List<Modifier> modifiers, Location location)
71  : base(id, type, modifiers, location)
72  {
73  this.initialization = init;
74  }
75 
76  #endregion
77 
78  #region Accept()
79 
86  public override Object Accept(Visitor v, Object o)
87  {
88  return v.Visit(this, o);
89  }
90 
91  #endregion
92  }
93 }
Abstract class encapsulate a programming language expression.
Definition: Expression.cs:37
Encapsulates a definition of a concrete field.
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
FieldDefinition(SingleIdentifierExpression id, Expression init, string type, List< Modifier > modifiers, Location location)
Constructor of FieldDefinition.
Encapsulates a identifier expression of our programming language.
Expression Init
Gets the initialization of the field
Location location
Location: Encapsulates in one object the line, column and filename
Definition: AstNode.cs:39
override Object Accept(Visitor v, Object o)
Accept method of a concrete visitor.
Encapsulates a declaration of a concrete field.