The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
BinaryExpression.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: BinaryExpression.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // Encapsulates a binary expression of our programming language. //
9 // Inheritance: Expression. //
10 // Implements Composite pattern [Composite]. //
11 // Implements Visitor pattern [Concrete Element]. //
12 // -------------------------------------------------------------------------- //
13 // Create date: 05-12-2006 //
14 // Modification date: 25-04-2007 //
16 
17 using System;
18 using System.Collections.Generic;
19 using System.Text;
20 
21 using Tools;
22 using ErrorManagement;
23 namespace AST
24 {
33  public abstract class BinaryExpression : Expression
34  {
35  #region Fields
36 
40  private Expression operand1;
41 
45  private Expression operand2;
46 
47  #endregion
48 
49  #region Properties
50 
55  {
56  get { return operand1; }
57  set { operand1 = value; }
58  }
59 
64  {
65  get { return operand2; }
66  set { operand2 = value; }
67  }
68 
69  #endregion
70 
71  #region Constructor
72 
81  protected BinaryExpression(Expression operand1, Expression operand2, Location location)
82  : base(location)
83  {
84  this.operand1 = operand1;
85  this.operand2 = operand2;
86  }
87 
88  #endregion
89  }
90 }
Encapsulates a binary expression of our programming language.
Abstract class encapsulate a programming language expression.
Definition: Expression.cs:37
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
BinaryExpression(Expression operand1, Expression operand2, Location location)
Constructor of BinaryExpression
Expression SecondOperand
Gets the second operand of the binary expression
Location location
Location: Encapsulates in one object the line, column and filename
Definition: AstNode.cs:39
Expression FirstOperand
Gets the first operand of the binary expression