The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
FieldDeclaration.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: FieldDeclaration.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // Encapsulates a declaration of a concrete field. //
9 // Inheritance: IdDeclaration. //
10 // Implements Composite pattern [Composite]. //
11 // Implements Visitor pattern [Concrete Element]. //
12 // -------------------------------------------------------------------------- //
13 // Create date: 28-01-2007 //
14 // Modification date: 11-04-2007 //
16 
17 using System;
18 using System.Collections.Generic;
19 using System.Text;
20 
21 using Symbols;
22 using Tools;
23 using TypeSystem;
24 using ErrorManagement;
25 
26 namespace AST
27 {
37  {
38  #region Fields
39 
43  private List<Modifier> modifiersInfo;
44 
48  private string fieldType;
49 
53  private Symbol symbol;
54 
55  #endregion
56 
57  #region Properties
58 
62  public List<Modifier> ModifiersInfo
63  {
64  get { return this.modifiersInfo; }
65  }
66 
70  public string TypeInfo
71  {
72  get { return this.fieldType; }
73  }
74 
78  public Symbol FieldSymbol
79  {
80  get { return this.symbol; }
81  set { this.symbol = value; }
82  }
83 
84  #endregion
85 
86  #region Constructor
87 
97  public FieldDeclaration(SingleIdentifierExpression id, string type, List<Modifier> modifiers, Location location)
98  : base(id, -1, null, location)
99  {
100  this.modifiersInfo = modifiers;
101  this.fieldType = type;
102  }
103 
104  #endregion
105 
106  #region Accept()
107 
114  public override Object Accept(Visitor v, Object o)
115  {
116  return v.Visit(this, o);
117  }
118 
119  #endregion
120  }
121 }
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
string TypeInfo
Gets the field type string
FieldDeclaration(SingleIdentifierExpression id, string type, List< Modifier > modifiers, Location location)
Constructor of FieldDeclaration.
This class represents a symbol associated with its identifier.
Definition: Symbol.cs:26
Encapsulates a identifier expression of our programming language.
override Object Accept(Visitor v, Object o)
Accept method of a concrete visitor.
Encapsulates a declaration.
Location location
Location: Encapsulates in one object the line, column and filename
Definition: AstNode.cs:39
Encapsulates a declaration of a concrete field.
Symbol FieldSymbol
Gets or sets the field symbol
List< Modifier > ModifiersInfo
Gets the modifiers information used to obtain its type