The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
QualifiedIdentifierExpression.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: QualifiedIdentifierExpression.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // Encapsulates the qualified identifier expression. //
9 // Inheritance: Expression. //
10 // Implements Composite pattern [Composite]. //
11 // Implements Visitor pattern [Concrete Element]. //
12 // -------------------------------------------------------------------------- //
13 // Create date: 26-12-2006 //
14 // Modification date: 26-12-2006 //
16 
17 using System;
18 using System.Collections.Generic;
19 using System.Text;
20 
21 using Tools;
22 using ErrorManagement;
23 
24 namespace AST
25 {
35  {
36  #region Fields
37 
41  private IdentifierExpression expression;
42 
46  private SingleIdentifierExpression idName;
47 
48  #endregion
49 
50  #region Properties
51 
56  {
57  get { return this.expression; }
58  }
59 
64  {
65  get { return this.idName; }
66  }
67 
68  #endregion
69 
70  #region Constructor
71 
81  : base(location)
82  {
83  this.expression = exp;
84  this.idName = name;
85  this.Identifier = name.Identifier + "." + exp.Identifier;
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 }
Encapsulates a name expression of our programming language.
Encapsulates the qualified name 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
SingleIdentifierExpression IdName
Gets the first name to the expression.
Encapsulates a identifier expression of our programming language.
QualifiedIdentifierExpression(SingleIdentifierExpression name, IdentifierExpression exp, Location location)
Constructor of QualifiedIdentifierExpression
override Object Accept(Visitor v, Object o)
Accept method of a concrete visitor.
Location location
Location: Encapsulates in one object the line, column and filename
Definition: AstNode.cs:39
IdentifierExpression IdExpression
Gets the expression to compose the name.