The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
ArgumentExpression.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: ArgumentExpression.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // Encapsulates a argument expression of our programming language. //
9 // Inheritance: Expression. //
10 // Implements Composite pattern [Composite]. //
11 // Implements Visitor pattern [Concrete Element]. //
12 // -------------------------------------------------------------------------- //
13 // Create date: 27-12-2006 //
14 // Modification date: 28-12-2006 //
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 {
27  #region ArgumentOptions // COMMENTED
28 
32  //public enum ArgumentOptions
33  //{
34  // /// <summary>
35  // /// The argument is neither reference nor output
36  // /// </summary>
37  // Default,
38 
39  // /// <summary>
40  // /// Reference argument
41  // /// </summary>
42  // Ref,
43 
44  // /// <summary>
45  // /// output argument
46  // /// </summary>
47  // Out
48  //}
49 
50  #endregion
51 
61  {
62  #region Fields
63 
67  private Expression argument;
68 
72  // private ArgumentOptions option;
73 
74  #endregion
75 
76  #region Properties
77 
81  public Expression Argument
82  {
83  get { return this.argument; }
84  set { this.argument = value; }
85  }
86 
90  public override TypeExpression ILTypeExpression
91  {
92  get { return this.argument.ILTypeExpression; }
93  }
94 
98  //public ArgumentOptions ArgType
99  //{
100  // get { return this.option; }
101  //}
102 
103  #endregion
104 
105  #region Constructor
106 
114  public ArgumentExpression(Expression arg, Location location) : base(location) {
115  this.argument = arg;
116  }
117 
118  #endregion
119 
120  #region Accept()
121 
128  public override Object Accept(Visitor v, Object o)
129  {
130  return v.Visit(this, o);
131  }
132 
133  #endregion
134 
135 
136  }
137 }
override Object Accept(Visitor v, Object o)
Accept method of a concrete visitor.
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
override TypeExpression ILTypeExpression
Gets the type expression used in code generation.
Abstract class that represents all different types.
ArgumentExpression(Expression arg, Location location)
Gets the option of the argument
Expression Argument
Represents the option of the argument
Encapsulates a argument expression of our programming language.
Location location
Location: Encapsulates in one object the line, column and filename
Definition: AstNode.cs:39