本文整理汇总了C#中DoStatementSyntax类的典型用法代码示例。如果您正苦于以下问题:C# DoStatementSyntax类的具体用法?C# DoStatementSyntax怎么用?C# DoStatementSyntax使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DoStatementSyntax类属于命名空间,在下文中一共展示了DoStatementSyntax类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: VisitDoStatement
public override void VisitDoStatement(DoStatementSyntax node)
{
var token = CreateBlock($"while ({node.Condition})", SDNodeRole.DoWhileLoop);
_tokenList.Add(token);
VisitChildren(token.Statements, node.Statement);
}
开发者ID:Geaz,项目名称:sharpDox,代码行数:7,代码来源:CSharpMethodVisitor.cs
示例2: BindDoStatement
private BoundStatement BindDoStatement(DoStatementSyntax syntax, Symbol parent)
{
BindAttributes(syntax.Attributes);
return new BoundDoStatement(
Bind(syntax.Condition, BindExpression),
Bind(syntax.Statement, x => BindStatement(x, parent)));
}
开发者ID:Samana,项目名称:HlslTools,代码行数:8,代码来源:Binder.Statements.cs
示例3: AddBraces
public static DoStatementSyntax AddBraces(DoStatementSyntax doStatement)
{
Debug.Assert(doStatement != null && NeedsBraces(doStatement));
return doStatement
.WithStatement(SyntaxFactory.Block(doStatement.Statement))
.WithAdditionalAnnotations(Formatter.Annotation);
}
开发者ID:modulexcite,项目名称:StylishCode,代码行数:8,代码来源:StyleHelpers.cs
示例4: BindDo
public BoundDoStatement BindDo(DoStatementSyntax node)
{
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 BoundDoStatement(node, condition, body, loopContext.GetBreakLabel(), loopContext.GetContinueLabel());
}
开发者ID:EkardNT,项目名称:Roslyn,代码行数:9,代码来源:Loops.cs
示例5: VisitDoStatement
protected override SyntaxNode VisitDoStatement(DoStatementSyntax node)
{
if (!node.DescendentNodes().OfType<BlockSyntax>().Any())
{
node = node.Update (node.DoKeyword, Syntax.Block (statements: node.Statement), node.WhileKeyword,
node.OpenParenToken, node.Condition, node.CloseParenToken, node.SemicolonToken);
}
return base.VisitDoStatement (node);
}
开发者ID:Auxon,项目名称:Instant,代码行数:10,代码来源:FixingRewriter.cs
示例6: VisitDoStatement
public override SyntaxNode VisitDoStatement(DoStatementSyntax node)
{
node = (DoStatementSyntax)base.VisitDoStatement(node);
if (!node.Statement.IsKind(SyntaxKind.Block))
{
this.addedAnnotations = true;
node = node.WithStatement(SyntaxFactory.Block(node.Statement));
}
return node;
}
开发者ID:OliverKurowski,项目名称:StylecopCodeFormatter,代码行数:12,代码来源:SA1503_IfNeedsBlockStatement.cs
示例7: Go
public static void Go(OutputWriter writer, DoStatementSyntax statement)
{
var info = new LoopInfo(statement);
writer.WriteLine("do");
writer.OpenBrace();
Core.WriteStatementAsBlock(writer, statement.Statement, false);
writer.CloseBrace();
writer.WriteIndent();
writer.Write("while (");
Core.Write(writer, statement.Condition);
writer.Write(");\r\n");
}
开发者ID:mortezabarzkar,项目名称:SharpNative,代码行数:14,代码来源:WriteDoStatement.cs
示例8: VisitDoStatement
public override SyntaxNode VisitDoStatement(DoStatementSyntax node)
{
node = (DoStatementSyntax)base.VisitDoStatement(node);
if (!node.CloseParenToken.IsMissing && node.Statement.Kind != SyntaxKind.Block)
{
return CodeAnnotations.Formatting.AddAnnotationTo(
Syntax.DoStatement(
node.DoKeyword,
WrapStatementWithBlock(node.Statement),
node.WhileKeyword,
node.OpenParenToken,
node.Condition,
node.CloseParenToken,
node.SemicolonToken));
}
else
{
return node;
}
}
开发者ID:grokys,项目名称:StyleCopMagic,代码行数:21,代码来源:SA1503.cs
示例9: VisitDoStatement
public virtual void VisitDoStatement(DoStatementSyntax node)
{
DefaultVisit(node);
}
开发者ID:pminiszewski,项目名称:HlslTools,代码行数:4,代码来源:SyntaxVisitor.cs
示例10: VisitDoStatement
public override void VisitDoStatement(DoStatementSyntax node) => CheckNesting(node.DoKeyword, () => base.VisitDoStatement(node));
开发者ID:dbolkensteyn,项目名称:sonarlint-vs,代码行数:1,代码来源:FunctionNestingDepth.cs
示例11: AreEquivalentActiveStatements
private static bool AreEquivalentActiveStatements(DoStatementSyntax oldNode, DoStatementSyntax newNode)
{
// only check the condition, edits in the body are allowed:
return AreEquivalentIgnoringLambdaBodies(oldNode.Condition, newNode.Condition);
}
开发者ID:GeertVL,项目名称:roslyn,代码行数:5,代码来源:CSharpEditAndContinueAnalyzer.cs
示例12: VisitDoStatement
public override void VisitDoStatement(DoStatementSyntax node)
{
if (!YieldChecker.HasSpecialStatement(node))
{
currentState.Add(StateMachineThisFixer.Fix(node));
}
else
{
MaybeCreateNewState();
var nextState = GetNextState(node);
var conditionState = new State(this) { BreakState = nextState };
var iterationState = currentState;
conditionState.Add(Cs.If(StateMachineThisFixer.Fix(node.Condition), ChangeState(iterationState), ChangeState(nextState)));
conditionState.Add(GotoTop());
SetClosed(conditionState);
iterationState.NextState = conditionState;
node.Statement.Accept(this);
if (currentState != nextState)
{
Close(currentState);
}
currentState = nextState;
}
}
开发者ID:mortezabarzkar,项目名称:SharpNative,代码行数:30,代码来源:YieldStateGenerator.cs
示例13: BindDo
public BoundDoStatement BindDo(DoStatementSyntax node, DiagnosticBag diagnostics)
{
var loopBinder = this.GetBinder(node);
Debug.Assert(loopBinder != null);
return loopBinder.BindDoParts(diagnostics, loopBinder);
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:6,代码来源:Binder_Statements.cs
示例14: InferTypeInDoStatement
private IEnumerable<ITypeSymbol> InferTypeInDoStatement(DoStatementSyntax doStatement, SyntaxToken? previousToken = null)
{
// If we have a position, we need to be after "do { } while("
if (previousToken.HasValue && previousToken.Value != doStatement.OpenParenToken)
{
return SpecializedCollections.EmptyEnumerable<ITypeSymbol>();
}
return SpecializedCollections.SingletonEnumerable(this.Compilation.GetSpecialType(SpecialType.System_Boolean));
}
开发者ID:jerriclynsjohn,项目名称:roslyn,代码行数:10,代码来源:CSharpTypeInferenceService.TypeInferrer.cs
示例15: HandleDoStatement
/// <summary>
/// Handles the given do statement.
/// </summary>
/// <param name="stmt">Statement</param>
/// <param name="successor">Successor</param>
private void HandleDoStatement(DoStatementSyntax stmt, ControlFlowGraphNode successor)
{
this.SyntaxNodes.Add(stmt.Condition);
this.IsLoopHeadNode = true;
if (successor != null)
{
this.ISuccessors.Add(successor);
successor.IPredecessors.Add(this);
this.LoopExitNode = successor;
}
var doNode = new ControlFlowGraphNode(this.Summary);
this.ISuccessors.Add(doNode);
doNode.IPredecessors.Add(this);
if (stmt.Statement is BlockSyntax)
{
doNode.Construct((stmt.Statement as BlockSyntax).Statements, 0, false, this);
}
else
{
doNode.Construct(new SyntaxList<StatementSyntax> { stmt.Statement }, 0, false, this);
}
}
开发者ID:jerickmsft,项目名称:PSharp,代码行数:30,代码来源:ControlFlowGraphNode.cs
示例16: VisitDoStatement
public override void VisitDoStatement(DoStatementSyntax node)
{
Visit(node.Condition);
}
开发者ID:tvsonar,项目名称:roslyn,代码行数:4,代码来源:ExpressionVariableFinder.cs
示例17: VisitDoStatement
/// <summary>
///
/// </summary>
/// <param name="node"></param>
/// <remarks>
/// Statements will cause an AST walker to be created, thus we don't need to go further deeper in the
/// tree by visiting the node.
/// </remarks>
public override void VisitDoStatement(DoStatementSyntax node)
{
this.VisitStatement(node);
}
开发者ID:andry-tino,项目名称:Rosetta,代码行数:12,代码来源:ConstructorASTWalker.cs
示例18: VisitDoStatement
protected override SyntaxNode VisitDoStatement(DoStatementSyntax node)
{
node = node.Update (node.DoKeyword, GetLoopBlock (node.Statement), node.WhileKeyword,
node.OpenParenToken, node.Condition, node.CloseParenToken, node.SemicolonToken);
this.loopLevel++;
var statement = base.VisitDoStatement ((DoStatementSyntax) node.WithAdditionalAnnotations (this.isLoop));
this.loopLevel--;
return statement;
}
开发者ID:Auxon,项目名称:Instant,代码行数:10,代码来源:LoggingRewriter.cs
示例19: VisitDoStatement
public override void VisitDoStatement(DoStatementSyntax node)
{
Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda);
var patternBinder = new PatternVariableBinder(node, _enclosing);
var whileBinder = new WhileBinder(patternBinder, node);
AddToMap(node, whileBinder);
Visit(node.Condition, whileBinder);
VisitPossibleEmbeddedStatement(node.Statement, whileBinder);
}
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:10,代码来源:LocalBinderFactory.cs
示例20: VisitDoStatement
public override SyntaxNode VisitDoStatement(DoStatementSyntax node)
{
this.loopLevel++;
var statement = base.VisitDoStatement (node
.WithStatement (GetLoopBlock (node.Statement)))
.WithAdditionalAnnotations (this.isLoop);
this.loopLevel--;
return statement;
}
开发者ID:ermau,项目名称:Instant,代码行数:12,代码来源:IdentifyingVisitor.cs
注:本文中的DoStatementSyntax类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论