#develop (short for SharpDevelop) is a free IDE for .NET programming languages.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

40 lines
1.1 KiB

// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
using Boo.Lang.Compiler;
using Boo.Lang.Compiler.Ast;
using Boo.Lang.Compiler.Ast.Visitors;
namespace NRefactoryToBooConverter
{
public class ReplaceBreakStatementsVisitor : DepthFirstVisitor
{
string label;
public ReplaceBreakStatementsVisitor(string label)
{
this.label = label;
}
public override void OnGivenStatement(GivenStatement node) { }
public override void OnForStatement(ForStatement node) { }
public override void OnWhileStatement(WhileStatement node) { }
public override void OnUnlessStatement(UnlessStatement node) { }
public override void OnBreakStatement(BreakStatement node)
{
GotoStatement gotoStatement = new GotoStatement(node.LexicalInfo);
gotoStatement.Label = new ReferenceExpression(node.LexicalInfo, label);
node.ReplaceBy(gotoStatement);
}
}
}