19 using System.Collections.Generic;
24 using ErrorManagement;
46 private List<MoveStatement> afterCondition;
61 private List<ThetaStatement> thetaStats;
67 private IList<SingleIdentifierExpression> referencesUsedInTrueBranch =
new List<SingleIdentifierExpression>();
73 private IList<SingleIdentifierExpression> referencesUsedInFalseBranch =
new List<SingleIdentifierExpression>();
83 get {
return condition; }
84 set { this.condition = value; }
91 get {
return this.afterCondition; }
92 set { this.afterCondition = value; }
99 get {
return trueBranch; }
106 get {
return falseBranch; }
113 get {
return this.thetaStats; }
114 set { this.thetaStats = value; }
122 get {
return this.referencesUsedInTrueBranch; }
130 get {
return this.referencesUsedInFalseBranch; }
145 this.condition = exp;
146 this.afterCondition =
new List<MoveStatement>();
147 this.trueBranch = trueBranch;
148 this.falseBranch =
new Block(location);
149 this.thetaStats =
new List<ThetaStatement>();
163 this.condition = exp;
164 this.afterCondition =
new List<MoveStatement>();
165 this.trueBranch = trueBranch;
166 this.falseBranch = falseBranch;
167 this.thetaStats =
new List<ThetaStatement>();
172 #region HaveElseBlock
179 if ((this.falseBranch is
Block) && (((Block)this.falseBranch).StatementCount == 0))
195 return v.Visit(
this, o);
Abstract class encapsulate a programming language expression.
Encapsulates a block of statements.
bool HaveElseBlock()
Returns true if the statement has a else block. Otherwise, false.
override Object Accept(Visitor v, Object o)
Accept method of a concrete visitor.
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.
Abstract class represents a programming language statement.
IList< SingleIdentifierExpression > ReferencesUsedInFalseBranch
The set of references that are used in the else body. Used for SSA purposes.
Expression Condition
Gets the condition expression of If-Else statement.
Statement FalseBranch
Gets the block executed when the condition is false.
Statement TrueBranch
Gets the block executed when the condition is true.
IfElseStatement(Expression exp, Statement trueBranch, Location location)
Constructor of IfElseStatement
Encapsulates a If-Else statement of our programming language.
IfElseStatement(Expression exp, Statement trueBranch, Statement falseBranch, Location location)
Constructor of IfElseStatement
List< ThetaStatement > ThetaStatements
Gets or sets the theta funcion statements
List< MoveStatement > AfterCondition
Gets or sets the statements after condition.
Location location
Location: Encapsulates in one object the line, column and filename
IList< SingleIdentifierExpression > ReferencesUsedInTrueBranch
The set of references that are used in the if body. Used for SSA purposes.