The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
RelationalExpression.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: RelationalExpression.cs //
6 // Authors: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Francisco Ortin - francisco.ortin@gmail.com //
8 // Description: //
9 // Encapsulates a relational binary expression. //
10 // Inheritance: BinaryExpression. //
11 // Implements Composite pattern [Composite]. //
12 // Implements Visitor pattern [Concrete Element]. //
13 // -------------------------------------------------------------------------- //
14 // Create date: 05-12-2006 //
15 // Modification date: 06-04-2007 //
17 
18 using System;
19 using System.Collections.Generic;
20 using System.Text;
21 
22 using Tools;
23 using ErrorManagement;
24 
25 namespace AST
26 {
27  #region RelationalOperator
28 
32  public enum RelationalOperator
33  {
37  NotEqual,
38 
42  Equal,
43 
47  LessThan,
48 
53 
58 
63  }
64 
65  #endregion
66 
76  {
77  #region Fields
78 
82  private RelationalOperator op;
83 
84  #endregion
85 
86  #region Properties
87 
92  {
93  get { return op; }
94  }
95 
96  #endregion
97 
98  #region Constructor
99 
110  : base(operand1, operand2, location)
111  {
112  this.op = op;
113  }
114 
115  #endregion
116 
117  #region Accept()
118 
125  public override Object Accept(Visitor v, Object o)
126  {
127  return v.Visit(this, o);
128  }
129 
130  #endregion
131 
132 
133 #region ToString()
134  public override string ToString() {
135  return op.ToString();
136 }
137 
138  #endregion
139 
140  }
141 }
Encapsulates a binary expression of our programming language.
Abstract class encapsulate a programming language expression.
Definition: Expression.cs:37
a < b
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
RelationalOperator Operator
Gets the operator of the binary expression
a == b
RelationalOperator
Relational binary operators
Encapsulates a relational binary expression.
Location location
Location: Encapsulates in one object the line, column and filename
Definition: AstNode.cs:39
RelationalExpression(Expression operand1, Expression operand2, RelationalOperator op, Location location)
Constructor of RelationalExpression
override Object Accept(Visitor v, Object o)
Accept method of a concrete visitor.