• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# WhileStatementSyntax类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中WhileStatementSyntax的典型用法代码示例。如果您正苦于以下问题:C# WhileStatementSyntax类的具体用法?C# WhileStatementSyntax怎么用?C# WhileStatementSyntax使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WhileStatementSyntax类属于命名空间,在下文中一共展示了WhileStatementSyntax类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: VisitWhileStatement

 /// <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 VisitWhileStatement(WhileStatementSyntax node)
 {
     this.VisitStatement(node);
 }
开发者ID:andry-tino,项目名称:Rosetta,代码行数:12,代码来源:ConstructorASTWalker.cs


示例17: VisitWhileStatement

        public override void VisitWhileStatement(WhileStatementSyntax 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


示例18: VisitWhileStatement

            public override void VisitWhileStatement(WhileStatementSyntax node)
            {
                var saveCurrentScope = currentScope;
                currentScope = new DeclarationScope(currentScope);

                Visit(node.Condition);
                VisitPossibleEmbeddedStatement(node.Statement);

                Debug.Assert(currentScope.Parent == saveCurrentScope);
                currentScope = saveCurrentScope;
            }
开发者ID:jerriclynsjohn,项目名称:roslyn,代码行数:11,代码来源:DeclarationExpressionsTests.cs


示例19: HandleWhileStatement

        /// <summary>
        /// Handles the given while statement.
        /// </summary>
        /// <param name="stmt">Statement</param>
        /// <param name="successor">Successor</param>
        private void HandleWhileStatement(WhileStatementSyntax 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 whileNode = new ControlFlowGraphNode(this.Summary);
            this.ISuccessors.Add(whileNode);
            whileNode.IPredecessors.Add(this);

            if (stmt.Statement is BlockSyntax)
            {
                whileNode.Construct((stmt.Statement as BlockSyntax).Statements, 0, false, this);
            }
            else
            {
                whileNode.Construct(new SyntaxList<StatementSyntax> { stmt.Statement }, 0, false, this);
            }
        }
开发者ID:jerickmsft,项目名称:PSharp,代码行数:30,代码来源:ControlFlowGraphNode.cs


示例20: VisitWhileStatement

 public override void VisitWhileStatement(WhileStatementSyntax node)
 {
     _builder.Add(node);
     base.VisitWhileStatement(node);
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:5,代码来源:LocalVariableDeclaratorsCollector.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# LSL_Types.LSLString类代码示例发布时间:2022-05-24
下一篇:
C# WhileStatement类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap