The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
ArrayAccessExpression.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: ArrayAccessExpression.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // Encapsulates the array expression to access the concrete position. //
9 // Inheritance: BinaryExpression. //
10 // Implements Composite pattern [Composite]. //
11 // Implements Visitor pattern [Concrete Element]. //
12 // -------------------------------------------------------------------------- //
13 // Create date: 07-12-2006 //
14 // Modification date: 14-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 {
26  #region ArrayOperator
27 
31  public enum ArrayOperator
32  {
36  Indexer,
37  }
38 
39  #endregion
40 
50  {
51  #region Fields
52 
56  private ArrayOperator op;
57 
58  #endregion
59 
60  #region Properties
61 
65  public ArrayOperator Operator
66  {
67  get { return op; }
68  }
69 
70  #endregion
71 
72  #region Constructor
73 
83  : base(id, index, location)
84  {
85  this.op = ArrayOperator.Indexer;
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 binary expression of our programming language.
Abstract class encapsulate a programming language expression.
Definition: Expression.cs:37
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
ArrayOperator
Array operators
ArrayAccessExpression(Expression id, Expression index, Location location)
Constructor of ArrayAccessExpression
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 the array expression to access the concrete position.
ArrayOperator Operator
Gets the operator of the array expression