The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
AssertStatement.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: AssertStatement.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // Encapsulates a Assert statement of our programming languages. //
9 // Inheritance: Statement. //
10 // Implements Composite pattern [Composite]. //
11 // Implements Visitor pattern [Concrete Element]. //
12 // -------------------------------------------------------------------------- //
13 // Create date: 05-12-2006 //
14 // Modification date: 05-12-2006 //
16 
17 using System;
18 using System.Collections.Generic;
19 using System.Text;
20 
21 using Tools;
22 using ErrorManagement;
23 
24 namespace AST
25 {
34  public class AssertStatement : Statement
35  {
36  #region Fields
37 
41  private Expression condition;
42 
46  private Expression opExp;
47 
48  #endregion
49 
50  #region Properties
51 
55  public Expression Condition
56  {
57  get { return condition; }
58  }
59 
63  public Expression Expression
64  {
65  get { return opExp; }
66  }
67 
68  #endregion
69 
70  #region Constructor
71 
79  public AssertStatement(Expression cond, Expression exp, Location location): base(location)
80  {
81  this.condition = cond;
82  this.opExp = exp;
83  }
84 
85  #endregion
86 
87  #region Accept()
88 
95  public override Object Accept(Visitor v, Object o)
96  {
97  return v.Visit(this, o);
98  }
99 
100  #endregion
101  }
102 }
Abstract class encapsulate a programming language expression.
Definition: Expression.cs:37
Expression Condition
Gets the condition expression associated to the Assert statement.
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
Abstract class represents a programming language statement.
Definition: Statement.cs:30
AssertStatement(Expression cond, Expression exp, Location location)
Constructor of AssertStatement
Encapsulates a Assert statement of our programming languages.
Location location
Location: Encapsulates in one object the line, column and filename
Definition: AstNode.cs:39
override Object Accept(Visitor v, Object o)
Accept method of a concrete visitor.