本文整理汇总了C#中WhileStatementSyntax类的典型用法代码示例。如果您正苦于以下问题:C# WhileStatementSyntax类的具体用法?C# WhileStatementSyntax怎么用?C# WhileStatementSyntax使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WhileStatementSyntax类属于命名空间,在下文中一共展示了WhileStatementSyntax类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddBraces
public static WhileStatementSyntax AddBraces(WhileStatementSyntax whileStatement)
{
Debug.Assert(whileStatement != null && NeedsBraces(whileStatement));
return whileStatement
.WithStatement(SyntaxFactory.Block(whileStatement.Statement))
.WithAdditionalAnnotations(Formatter.Annotation);
}
示例2: BindWhile
public BoundWhileStatement BindWhile(WhileStatementSyntax node)
{
Debug.Assert(node != null);
var condition = BindBooleanExpression(node.Condition);
var loopContext = this.containingMethod.BlockMap.GetValueOrDefault(node);
Debug.Assert(loopContext != null);
var analyzer = new SemanticAnalyzer(this.containingMethod, loopContext, this.diagnostics);
var body = analyzer.BindStatement(node.Statement);
return new BoundWhileStatement(node, condition, body, loopContext.GetBreakLabel(), loopContext.GetContinueLabel());
}
示例3: Go
public static void Go(OutputWriter writer, WhileStatementSyntax whileStatement)
{
var info = new LoopInfo(whileStatement);
writer.WriteIndent();
writer.Write("while (");
Core.Write(writer, whileStatement.Condition);
writer.Write(")\r\n");
writer.OpenBrace();
Core.WriteStatementAsBlock(writer, whileStatement.Statement, false);
writer.CloseBrace();
}
示例4: VisitWhileStatement
public virtual void VisitWhileStatement(WhileStatementSyntax node)
{
DefaultVisit(node);
}
示例5: VisitWhileStatement
public override void VisitWhileStatement(WhileStatementSyntax node)
{
Visit(node.Condition);
}
示例6: AreEquivalentActiveStatements
private static bool AreEquivalentActiveStatements(WhileStatementSyntax oldNode, WhileStatementSyntax newNode)
{
// only check the condition, edits in the body are allowed:
return AreEquivalentIgnoringLambdaBodies(oldNode.Condition, newNode.Condition);
}
示例7: VisitWhileStatement
public override void VisitWhileStatement(WhileStatementSyntax node)
{
this.VisitWhileStatementDeclarations(node);
base.VisitWhileStatement(node);
}
示例8: VisitWhileStatement
public override SyntaxNode VisitWhileStatement(WhileStatementSyntax node)
{
_output.Write(node.WhileKeyword, "while (");
this.VisitExpression(node.Condition);
_output.TrivialWriteLine(") {");
_output.IncreaseIndent();
this.Visit(node.Statement);
this.AppendCompensateSemicolon(node.Statement);
_output.DecreaseIndent();
_output.TrivialWrite('}');
return node;
}
示例9: VisitWhileStatement
protected override SyntaxNode VisitWhileStatement(WhileStatementSyntax node)
{
node = node.Update (node.WhileKeyword, node.OpenParenToken, node.Condition, node.CloseParenToken,
GetLoopBlock (node.Statement));
return base.VisitWhileStatement ((WhileStatementSyntax)node.WithAdditionalAnnotations (this.isLoop));
}
示例10: VisitWhileStatement
public override void VisitWhileStatement(WhileStatementSyntax node)
{
base.VisitWhileStatement(node);
_counter++;
}
示例11: BindWhile
private BoundStatement BindWhile(WhileStatementSyntax node, DiagnosticBag diagnostics)
{
Debug.Assert(node != null);
var loopBinder = this.GetBinder(node);
Debug.Assert(loopBinder != null);
return loopBinder.WrapWithVariablesIfAny(node, loopBinder.BindWhileParts(diagnostics, loopBinder));
}
示例12: BindWhile
public BoundWhileStatement BindWhile(WhileStatementSyntax node, DiagnosticBag diagnostics)
{
Debug.Assert(node != null);
var condition = BindBooleanExpression(node.Condition, diagnostics);
var loopBinder = this.GetBinder(node);
Debug.Assert(loopBinder != null);
var body = loopBinder.BindPossibleEmbeddedStatement(node.Statement, diagnostics);
return new BoundWhileStatement(node, condition, body, loopBinder.BreakLabel, loopBinder.ContinueLabel);
}
示例13: VisitWhileStatement
public override void VisitWhileStatement(WhileStatementSyntax node)
{
Emit("while ({0})", node.Condition.ToString());
using (IndentedBracketScope(node.Statement))
Visit(node.Statement);
}
示例14: VisitWhileStatement
public override SyntaxNode VisitWhileStatement(WhileStatementSyntax node)
{
this.loopLevel++;
var statement = base.VisitWhileStatement (node
.WithStatement (GetLoopBlock (node.Statement)))
.WithAdditionalAnnotations (this.isLoop);
this.loopLevel--;
return statement;
}
示例15: VisitWhileStatement
public override void VisitWhileStatement(WhileStatementSyntax node)
{
if (!YieldChecker.HasSpecialStatement(node))
{
currentState.Add(StateMachineThisFixer.Fix(node));
}
else
{
MaybeCreateNewState();
var nextState = GetNextState(node);
var iterationState = currentState;
iterationState.NextState = nextState;
iterationState.BreakState = nextState;
node = node.WithStatement(SyntaxFactory.Block(CaptureState(node.Statement, iterationState, nextState)));
iterationState.Statements.Add(node);
Close(iterationState);
currentState = nextState;
}
}