The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
AssignmentExpression.cs
Go to the documentation of this file.
1 // -------------------------------------------------------------------------- //
3 // Project rROTOR //
4 // -------------------------------------------------------------------------- //
5 // File: AssignmentExpression.cs //
6 // Author: Cristina Gonzalez Muņoz - cristi.gm@gmail.com //
7 // Description: //
8 // Encapsulates assignment binary expressions. //
9 // Inheritance: BinaryExpression. //
10 // Implements Composite pattern [Composite]. //
11 // Implements Visitor pattern [Concrete Element]. //
12 // -------------------------------------------------------------------------- //
13 // Create date: 05-12-2006 //
14 // Modification date: 09-04-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 {
26  #region AssignmentOperator
27 
31  public enum AssignmentOperator
32  {
36  Assign = 1,
37 
41  PlusAssign,
42 
47 
51  MultAssign,
52 
56  DivAssign,
57 
61  ModAssign,
62 
67 
72 
77 
82 
87  }
88 
89  #endregion
90 
100  {
101  #region Fields
102 
106  private AssignmentOperator op;
107 
111  private MoveStatement moveStat;
112 
113  #endregion
114 
115  #region Properties
116 
121  {
122  get { return op; }
123  }
124 
128  public MoveStatement MoveStat
129  {
130  get { return this.moveStat; }
131  set { this.moveStat = value; }
132  }
133 
134  #endregion
135 
136  #region Constructor
137 
147  public AssignmentExpression(Expression operand1, Expression operand2, AssignmentOperator op, Location location) : base(operand1, operand2, location)
148  {
149  this.op = op;
150  }
151 
152  #endregion
153 
154  #region Accept()
155 
162  public override Object Accept(Visitor v, Object o)
163  {
164  return v.Visit(this, o);
165  }
166 
167  #endregion
168  }
169 }
Encapsulates a binary expression of our programming language.
Abstract class encapsulate a programming language expression.
Definition: Expression.cs:37
AssignmentOperator Operator
Gets the operator of the binary expression
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
MoveStatement MoveStat
Gets or sets a move statement associated to the assignment expression.
a >>= b
Encapsulates assignment binary expressions.
Location location
Location: Encapsulates in one object the line, column and filename
Definition: AstNode.cs:39
Encapsulates a Move instruction to use in SSA algorithm
a <<= b
AssignmentOperator
Assignment binary operators
AssignmentExpression(Expression operand1, Expression operand2, AssignmentOperator op, Location location)
Constructor de la clase AssignmentExpression
override Object Accept(Visitor v, Object o)
Accept method of a concrete visitor.