The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
BaseExpression.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: BaseExpression.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // Encapsulates a 'base' expression. //
9 // Inheritance: Expression. //
10 // Implements Composite pattern [Leaf]. //
11 // Implements Visitor pattern [Concrete Element]. //
12 // -------------------------------------------------------------------------- //
13 // Create date: 02-01-2007 //
14 // Modification date: 02-01-2007 //
16 
17 using System;
18 using System.Collections.Generic;
19 using System.Text;
20 using ErrorManagement;
21 using Tools;
22 using AST.Operations;
23 
24 namespace AST
25 {
34  public class BaseExpression : Expression
35  {
36  #region Constructor
37 
44  public BaseExpression(Location location): base(location)
45  {
46  }
47 
48  #endregion
49 
50  #region Accept()
51 
58  public override Object Accept(Visitor v, Object o)
59  {
60  return v.Visit(this, o);
61  }
62 
63  #endregion
64 
65  #region Dispatcher AstOperation
66  public override object AcceptOperation(AstOperation op, object arg) {
74  return op.Exec(this, arg);
75  }
76 
77  #endregion
78 
79 
80  }
81 }
Encapsulates a 'base' expression.
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 ...
override object AcceptOperation(AstOperation op, object arg)
Dispatches expressions to the operation passed as argument. It provokes the execution of op...
BaseExpression(Location location)
Constructor of BaseExpression
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