The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
BaseCallExpression.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: BaseCallExpression.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // Encapsulates a invocation expression to base class. //
9 // Inheritance: Expression. //
10 // Implements Composite pattern [Composite]. //
11 // Implements Visitor pattern [Concrete Element]. //
12 // -------------------------------------------------------------------------- //
13 // Create date: 07-12-2006 //
14 // Modification date: 27-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 using TypeSystem.Operations;
25 using AST.Operations;
26 
27 namespace AST
28 {
37  public class BaseCallExpression : Expression {
38  #region Fields
39 
43  private CompoundExpression arguments;
44 
48  private TypeExpression baseType;
49 
53  private TypeExpression actualMethodCalled;
54  #endregion
55 
56  #region Properties
57 
62  get { return this.arguments; }
63  }
64 
69  get { return baseType; }
70  set { baseType = value; }
71  }
72 
77  get { return this.actualMethodCalled; }
78  set { this.actualMethodCalled = value; }
79  }
80  #endregion
81 
82  #region Constructor
83 
92  : base(location) {
93  if (arguments != null)
94  this.arguments = arguments;
95  else
96  this.arguments = new CompoundExpression(location);
97  }
98 
99  #endregion
100 
101  #region Accept()
102 
109  public override Object Accept(Visitor v, Object o) {
110  return v.Visit(this, o);
111  }
112 
113  #endregion
114 
115  #region Dispatcher AstOperation
116  public override object AcceptOperation(AstOperation op, object arg) {
124  return op.Exec(this, arg);
125  }
126 
127  #endregion
128  }
129 
130 }
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
This class represent the entry wnen sending a message to an operation object. derived from AstNode ...
Abstract class that represents all different types.
TypeExpression ActualMethodCalled
The actual method called once overload has been solved.
Encapsulates a set of expressions.
override Object Accept(Visitor v, Object o)
Accept method of a concrete visitor.
CompoundExpression Arguments
Gets the arguments to invoke in the expression
BaseCallExpression(CompoundExpression arguments, Location location)
Constructor of BaseCallExpression
Location location
Location: Encapsulates in one object the line, column and filename
Definition: AstNode.cs:39
override object AcceptOperation(AstOperation op, object arg)
Dispatches expressions to the operation passed as argument. It provokes the execution of op...
Encapsulates a invocation expression to base class.
TypeExpression BaseType
The type of the base reference