当前位置: 首页>>代码示例>>C#>>正文


C# WhileStatementSyntax类代码示例

本文整理汇总了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);
        }
开发者ID:modulexcite,项目名称:StylishCode,代码行数:8,代码来源:StyleHelpers.cs

示例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());
        }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:11,代码来源:Loops.cs

示例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();
        }
开发者ID:mortezabarzkar,项目名称:SharpNative,代码行数:14,代码来源:WriteWhileStatement.cs

示例4: VisitWhileStatement

 public virtual void VisitWhileStatement(WhileStatementSyntax node)
 {
     DefaultVisit(node);
 }
开发者ID:pminiszewski,项目名称:HlslTools,代码行数:4,代码来源:SyntaxVisitor.cs

示例5: VisitWhileStatement

 public override void VisitWhileStatement(WhileStatementSyntax node)
 {
     Visit(node.Condition);
 }
开发者ID:tvsonar,项目名称:roslyn,代码行数:4,代码来源:ExpressionVariableFinder.cs

示例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);
 }
开发者ID:GeertVL,项目名称:roslyn,代码行数:5,代码来源:CSharpEditAndContinueAnalyzer.cs

示例7: VisitWhileStatement

 public override void VisitWhileStatement(WhileStatementSyntax node)
 {
     this.VisitWhileStatementDeclarations(node);
     base.VisitWhileStatement(node);
 }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:5,代码来源:CSharpDefinitionMap.LocalVisitors.cs

示例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;
        }
开发者ID:rexzh,项目名称:SharpJs,代码行数:14,代码来源:Rewriter_BasicStructure.cs

示例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));
        }
开发者ID:Auxon,项目名称:Instant,代码行数:7,代码来源:LoggingRewriter.cs

示例10: VisitWhileStatement

			public override void VisitWhileStatement(WhileStatementSyntax node)
			{
				base.VisitWhileStatement(node);
				_counter++;
			}
开发者ID:jjrdk,项目名称:ArchiMetrics,代码行数:5,代码来源:LinesOfCodeCalculator.cs

示例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));
        }
开发者ID:abock,项目名称:roslyn,代码行数:8,代码来源:Binder_Statements.cs

示例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);
        }
开发者ID:riversky,项目名称:roslyn,代码行数:10,代码来源:Binder_Statements.cs

示例13: VisitWhileStatement

 public override void VisitWhileStatement(WhileStatementSyntax node)
 {
     Emit("while ({0})", node.Condition.ToString());
     using (IndentedBracketScope(node.Statement))
         Visit(node.Statement);
 }
开发者ID:benlaan,项目名称:cs2ts,代码行数:6,代码来源:Transpiler.cs

示例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;
        }
开发者ID:ermau,项目名称:Instant,代码行数:12,代码来源:IdentifyingVisitor.cs

示例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;
            }
        }
开发者ID:mortezabarzkar,项目名称:SharpNative,代码行数:23,代码来源:YieldStateGenerator.cs


注:本文中的WhileStatementSyntax类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。