Skip to content

Commit

Permalink
Adding lots more tests for loop and conditional structures. Reworking…
Browse files Browse the repository at this point in the history
… the looping structuring from the ground up in order to resolve complex looping scenarios with multiple exits
  • Loading branch information
Frank Laub committed Feb 5, 2010
1 parent eff63f2 commit fdef61c
Show file tree
Hide file tree
Showing 47 changed files with 3,023 additions and 402 deletions.
38 changes: 38 additions & 0 deletions src/DotWeb.Decompiler/CodeModel/Statement/CodeBreakStatement.cs
@@ -0,0 +1,38 @@
// Copyright 2009, Frank Laub
//
// This file is part of DotWeb.
//
// DotWeb is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DotWeb is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DotWeb. If not, see <http://www.gnu.org/licenses/>.

using System;
using Mono.Cecil.Cil;

namespace DotWeb.Decompiler.CodeModel
{
public class CodeBreakStatement : CodeStatement
{
public CodeBreakStatement() {
}

#region Visitor Pattern
public override void Accept<V>(V visitor) {
((ICodeVisitor<CodeBreakStatement>)visitor).Visit(this);
}

public override R Accept<V, R>(V visitor) {
return ((ICodeVisitor<CodeBreakStatement, R>)visitor).VisitReturn(this);
}
#endregion
}
}
38 changes: 38 additions & 0 deletions src/DotWeb.Decompiler/CodeModel/Statement/CodeContinueStatement.cs
@@ -0,0 +1,38 @@
// Copyright 2009, Frank Laub
//
// This file is part of DotWeb.
//
// DotWeb is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DotWeb is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with DotWeb. If not, see <http://www.gnu.org/licenses/>.

using System;
using Mono.Cecil.Cil;

namespace DotWeb.Decompiler.CodeModel
{
public class CodeContinueStatement : CodeStatement
{
public CodeContinueStatement() {
}

#region Visitor Pattern
public override void Accept<V>(V visitor) {
((ICodeVisitor<CodeContinueStatement>)visitor).Visit(this);
}

public override R Accept<V, R>(V visitor) {
return ((ICodeVisitor<CodeContinueStatement, R>)visitor).VisitReturn(this);
}
#endregion
}
}
Expand Up @@ -33,6 +33,8 @@ public interface ICodeStatementVisitor
, ICodeVisitor<CodeThrowStatement>
, ICodeVisitor<CodeVariableDeclarationStatement>
, ICodeVisitor<CodeWhileStatement>
, ICodeVisitor<CodeBreakStatement>
, ICodeVisitor<CodeContinueStatement>
{
}

Expand All @@ -47,6 +49,8 @@ public interface ICodeStatementVisitor<Return>
, ICodeVisitor<CodeThrowStatement, Return>
, ICodeVisitor<CodeVariableDeclarationStatement, Return>
, ICodeVisitor<CodeWhileStatement, Return>
, ICodeVisitor<CodeBreakStatement, Return>
, ICodeVisitor<CodeContinueStatement, Return>
{
}
}

0 comments on commit fdef61c

Please sign in to comment.