19 using System.Collections.Generic;
23 using ErrorManagement;
47 private List<SwitchSection> switchBlock;
52 private List<MoveStatement> afterCondition;
57 private List<ThetaStatement> thetaStats;
63 private IDictionary<Block, IList<SingleIdentifierExpression>> referencesUsedCases =
new Dictionary<Block, IList<SingleIdentifierExpression>>();
68 private int labels = -1;
79 get {
return condition; }
80 set { condition = value; }
88 get {
return this.switchBlock.Count; }
96 get {
return this.afterCondition; }
97 set { this.afterCondition = value; }
105 get {
return this.thetaStats; }
106 set { this.thetaStats = value; }
114 get {
return this.referencesUsedCases; }
131 this.condition = cond;
132 this.switchBlock = sections;
133 this.afterCondition =
new List<MoveStatement>();
134 this.thetaStats =
new List<ThetaStatement>();
147 if (this.labels == -1)
150 for (
int i = 0; i < this.switchBlock.Count; i++)
151 this.labels += this.switchBlock[i].
LabelCount;
158 #region GetSwitchSectionElement()
167 return this.switchBlock[index];
182 return v.Visit(
this, o);
int SwitchBlockCount
Gets the number of cases used in Switch statement.
IDictionary< Block, IList< SingleIdentifierExpression > > ReferencesUsedCases
The set of references used in each case body, including the default section. Used for SSA purposes...
Abstract class encapsulate a programming language expression.
Encapsulates a Case statement of our programming languages.
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.
SwitchSection GetSwitchSectionElement(int index)
Gets the element stored in the specified index.
List< ThetaStatement > ThetaStatements
Gets or sets the theta funcion statements
SwitchStatement(Expression cond, List< SwitchSection > sections, Location location)
Constructor of SwitchStatement
Location location
Location: Encapsulates in one object the line, column and filename
int LabelCount()
Gets the number of labels the switch statement has.
Expression Condition
Gets the condition expression of Switch Statement.
List< MoveStatement > AfterCondition
override Object Accept(Visitor v, Object o)
Accept method of a concrete visitor.
Encapsulates a Switch statement of our programming languages.