The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
FieldDeclarationSet.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: FieldDeclarationSet.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // Encapsulates a set of field declarations. //
9 // Inheritance: Declaration. //
10 // Implements Composite pattern [Composite]. //
11 // Implements Visitor pattern [Concrete Element]. //
12 // -------------------------------------------------------------------------- //
13 // Create date: 29-01-2007 //
14 // Modification date: 29-01-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 List<FieldDeclaration> declarations;
43 
44  #endregion
45 
46  #region Properties
47 
51  public int Count
52  {
53  get { return this.declarations.Count; }
54  }
55 
56  #endregion
57 
58  #region Constructor
59 
68  public FieldDeclarationSet(string type, List<FieldDeclaration> decls, Location location)
69  : base(type, location)
70  {
71  this.declarations = decls;
72  }
73 
74  #endregion
75 
76  #region GetDeclarationElement()
77 
84  {
85  return this.declarations[index];
86  }
87 
88  #endregion
89 
90  #region Accept()
91 
98  public override Object Accept(Visitor v, Object o)
99  {
100  return v.Visit(this, o);
101  }
102 
103  #endregion
104  }
105 }
FieldDeclaration GetDeclarationElement(int index)
Gets the element stored in the specified index.
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
int Count
Gets the number of declarations
FieldDeclarationSet(string type, List< FieldDeclaration > decls, Location location)
Constructor of FieldDeclarationSet
Encapsulates a declaration of a concrete type.
Definition: Declaration.cs:34
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 set of field declarations.
Encapsulates a declaration of a concrete field.