// ALTERADA public void AcceptCase(CaseStatement stmt) { if (stmt.Label != null) { _tw.WriteLine(stmt.Label + ": "); } GenerateComments(stmt); if (stmt.Selector.ResultType.CILType.IsEnum || stmt.Selector.ResultType.CILType.Equals(typeof(int)) || stmt.Selector.ResultType.CILType.Equals(typeof(char))) { _tw.Write("switch("); _tw.Write(stmt.Selector.ToString(_SysCg)); _tw.WriteLine(") {"); _tw.Indent++; for (int i = 0; i < stmt.Cases.Count; i++) { _tw.Write("case "); _tw.Write(stmt.Cases[i].ToString(_SysCg)); _tw.WriteLine(" :"); _tw.Indent++; stmt.Branches[i].AcceptIfEnabled(this); if (!stmt.Branches[i].ToString().Contains("BREAK CASE")) _tw.WriteLine("break;"); _tw.Indent--; } if (stmt.Branches.Count > stmt.Cases.Count) { _tw.WriteLine("default: "); _tw.Indent++; stmt.Branches.Last().AcceptIfEnabled(this); _tw.Indent--; } _tw.Indent--; _tw.WriteLine("}"); } else { IfStatement aux = stmt.ConvertToIfStatement(); AcceptIf(aux); } }