The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
CatchStatement.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: CatchStatement.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // Encapsulates a Catch 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: 13-12-2006 //
16 
17 using System;
18 using System.Collections.Generic;
19 using System.Text;
20 using System.Collections;
21 using System.Collections.ObjectModel;
22 using System.Diagnostics;
23 using System.Reflection;
24 using Tools;
25 using ErrorManagement;
26 
27 namespace AST {
36  public class CatchStatement : Statement {
37  #region Fields
38 
42  private IdDeclaration exception;
43 
47  private Block statements;
48 
49  #endregion
50 
51  #region Properties
52 
57  get { return exception; }
58  }
59 
63  public Block Statements {
64  get { return statements; }
65  }
66 
67  #endregion
68 
69  #region Constructor
70 
80  : base(location) {
81  this.exception = param;
82  this.statements = stats;
83  }
84 
85  #endregion
86 
87  #region Accept()
88 
95  public override Object Accept(Visitor v, Object o) {
96  return v.Visit(this, o);
97  }
98 
99  #endregion
100  }
101 }
Encapsulates a block of statements.
Definition: Block.cs:34
Encapsulates a Catch statement of our programming languages.
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
IdDeclaration Exception
Gets the exception to catch
CatchStatement(IdDeclaration param, Block stats, Location location)
Constructor of CatchStatement
Encapsulates a declaration.
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.
Block Statements
Gets the block executed when the exception is caught.