The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
IntLiteralExpression.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: IntLiteralExpression.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // Encapsulates a integer literal expression. //
9 // Inheritance: Expression. //
10 // Implements Composite pattern [Leaf]. //
11 // Implements Visitor pattern [Concrete Element]. //
12 // -------------------------------------------------------------------------- //
13 // Create date: 05-12-2006 //
14 // Modification date: 12-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 {
35  {
36  #region Fields
37 
41  private int intValue;
42 
43  #endregion
44 
45  #region Properties
46 
50  public int IntValue
51  {
52  get { return intValue; }
53  }
54 
58  public string ILValue
59  {
60  get { return this.intValue.ToString(); }
61  }
62 
63  #endregion
64 
65  #region Constructor
66 
74  public IntLiteralExpression(int intLiteral, Location location) : base(location)
75  {
76  this.intValue = intLiteral;
77  }
78 
79  #endregion
80 
81  #region Accept()
82 
89  public override Object Accept(Visitor v, Object o)
90  {
91  return v.Visit(this, o);
92  }
93 
94  #endregion
95  }
96 }
Abstract class encapsulate a programming language expression.
Definition: Expression.cs:37
IntLiteralExpression(int intLiteral, Location location)
Constructor of IntLiteralExpression
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
string ILValue
Gets the int value in string form
int IntValue
Gets the int value
Location location
Location: Encapsulates in one object the line, column and filename
Definition: AstNode.cs:39
Encapsulates a integer literal expression.
override Object Accept(Visitor v, Object o)
Accept method of a concrete visitor.