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


C# DoWhileStatement类代码示例

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


DoWhileStatement类属于命名空间,在下文中一共展示了DoWhileStatement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VisitDoWhileStatement

		public override void VisitDoWhileStatement(DoWhileStatement doWhileStatement)
		{
            var token = CreateBlock(string.Format("while ({0})", doWhileStatement.Condition.GetText()), SDNodeRole.DoWhileLoop);
            _tokenList.Add(token);

            VisitChildren(token.Statements, doWhileStatement.EmbeddedStatement);
		}
开发者ID:JoeHosman,项目名称:sharpDox,代码行数:7,代码来源:MethodVisitor.cs

示例2: ConvertToWhileLoop

		static void ConvertToWhileLoop(Script script, DoWhileStatement originalStatement)
		{
			script.Replace(originalStatement, new WhileStatement {
				Condition = originalStatement.Condition.Clone(),
				EmbeddedStatement = originalStatement.EmbeddedStatement.Clone()
			});
		}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:7,代码来源:ConvertDoWhileToWhileLoopAction.cs

示例3: ApplyAction

		void ApplyAction(Script script, WhileStatement statement) {
			var doWhile = new DoWhileStatement {
				Condition = statement.Condition.Clone(),
				EmbeddedStatement = statement.EmbeddedStatement.Clone()
			};

			script.Replace(statement, doWhile);
		}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:8,代码来源:ConvertWhileToDoWhileLoopAction.cs

示例4: VisitDoWhileStatement

 public override void VisitDoWhileStatement(DoWhileStatement doWhileStatement)
 {
     bool oldIsInsideLoop = _isInsideLoop;
     try {
         _isInsideLoop = true;
         base.VisitDoWhileStatement(doWhileStatement);
     }
     finally {
         _isInsideLoop = oldIsInsideLoop;
     }
 }
开发者ID:JimmyJune,项目名称:SaltarelleCompiler,代码行数:11,代码来源:VariableGatherer.cs

示例5: VisitDoWhileStatement

 public override object VisitDoWhileStatement(DoWhileStatement doWhileStatement, object data)
 {
     if (doWhileStatement.EmbeddedStatement is BlockStatement)
     {
         foreach (Statement innerstatement in (BlockStatement)doWhileStatement.EmbeddedStatement)
         {
             if (innerstatement is WhileStatement || innerstatement is DoWhileStatement)
                 UnlockWith(doWhileStatement);
         }
     }
     return base.VisitDoWhileStatement(doWhileStatement, data);
 }
开发者ID:cohenw,项目名称:strokes,代码行数:12,代码来源:NestedWhileStatementAchievement.cs

示例6: ReplaceJump

        static BlockStatement ReplaceJump(JumpStatement jump, BlockStatement block)
        {
            if (jump.StartOffset < block.StartOffset)
                throw new ArgumentOutOfRangeException("jump", "jump should be inside the given block");
            if (jump.JumpOffset > block.EndOffset)
                throw new ArgumentOutOfRangeException("jump", "jump should be inside the given block");

            var newBlock = new BlockStatement();
            var doWhileStatement = new DoWhileStatement(jump.Condition, new BlockStatement()){ StartOffset = jump.StartOffset, EndOffset = jump.JumpOffset };
            var inside = false;
            foreach (var statement in block)
            {
                if (statement.StartOffset == jump.JumpOffset)
                {                    
                    ((BlockStatement)doWhileStatement.Statement).AddStatement(statement);
                    inside = true;
                }
                else if (statement.StartOffset == jump.StartOffset)
                {
                    if (doWhileStatement == null)
                        throw new InvalidOperationException("DoWhileStatement can't be null");
                    newBlock.AddStatement(doWhileStatement);
                    doWhileStatement = null;
                    inside = false;
                }
                else if (inside)
                {
                    ((BlockStatement)doWhileStatement.Statement).AddStatement(statement);
                }
                else
                {
                    var lastStatement = newBlock.LastOrDefault();
                    if (lastStatement != null && lastStatement.EndOffset > statement.StartOffset)
                    {
                        throw new NotSupportedException("invalid Statement");
                    }
                    newBlock.AddStatement(statement);
                }
            }
            return newBlock;
        }
开发者ID:scemino,项目名称:nscumm,代码行数:41,代码来源:ReplaceJumpToWhile.cs

示例7: Visit

 public void Visit(DoWhileStatement expression)
 {
     outStream.WriteLine("do {");
     expression.Statement.Accept(this);
     outStream.WriteLine();
     outStream.Write("} while (");
     expression.Condition.Accept(this);
     outStream.Write(")");
 }
开发者ID:reshadi2,项目名称:mcjs,代码行数:9,代码来源:AstWriter.cs

示例8: ParseDoWhile

 private Statement ParseDoWhile(TokenSet followers)
   //^ requires this.currentToken == Token.Do;
   //^ ensures followers[this.currentToken] || this.currentToken == Token.EndOfFile;
 {
   SourceLocationBuilder slb = new SourceLocationBuilder(this.scanner.SourceLocationOfLastScannedToken);
   this.GetNextToken();
   Statement body = this.ParseStatement(followers|Token.While);
   if (body is EmptyStatement)
     this.HandleError(body.SourceLocation, Error.PossibleMistakenNullStatement);
   this.Skip(Token.While);
   Expression condition = this.ParseParenthesizedExpression(false, followers|Token.Semicolon);
   DoWhileStatement result = new DoWhileStatement(body, condition, slb);
   this.SkipSemiColon(followers);
   return result;
 }
开发者ID:hesam,项目名称:SketchSharp,代码行数:15,代码来源:Parser.cs

示例9: VisitDoWhileStatement

		public override void VisitDoWhileStatement(DoWhileStatement doWhileStatement)
		{
			PlaceOnNewLine(policy.PlaceWhileOnNewLine, doWhileStatement.WhileToken);
			FixEmbeddedStatment(policy.StatementBraceStyle, policy.WhileBraceForcement, doWhileStatement.EmbeddedStatement);
		}
开发者ID:txdv,项目名称:monodevelop,代码行数:5,代码来源:AstFormattingVisitor.cs

示例10: VisitDoWhileStatement

 public override void VisitDoWhileStatement(DoWhileStatement doWhileStatement)
 {
     if (findReturn)
     {
         base.VisitDoWhileStatement(doWhileStatement);
     }
 }
开发者ID:TinkerWorX,项目名称:Bridge,代码行数:7,代码来源:LambdaVisitor.cs

示例11: VisitDoWhileStatement

 public void VisitDoWhileStatement(DoWhileStatement doWhileStatement)
 {
     VisitExpression(doWhileStatement.Condition);
     VisitStatement(doWhileStatement.Body);
 }
开发者ID:xuld,项目名称:DocPlus,代码行数:5,代码来源:DocAstVistor.cs

示例12: VisitDoWhileStatement

 public override void VisitDoWhileStatement(DoWhileStatement doWhileStatement)
 {
     new DoWhileBlock(this, doWhileStatement).Emit();
 }
开发者ID:yindongfei,项目名称:bridge.lua,代码行数:4,代码来源:Emitter.Visitor.cs

示例13: VisitDoWhileStatement

			public override void VisitDoWhileStatement (DoWhileStatement doWhileStatement)
			{
				base.VisitDoWhileStatement (doWhileStatement);

				CheckCondition (doWhileStatement.Condition);
			}
开发者ID:Gobiner,项目名称:ILSpy,代码行数:6,代码来源:ConstantConditionIssue.cs

示例14: VisitDoWhileStatement

		public override void VisitDoWhileStatement(DoWhileStatement doWhileStatement) {
			var body = CreateInnerCompiler().Compile(doWhileStatement.EmbeddedStatement);
			var compiledCondition = CompileExpression(doWhileStatement.Condition, CompileExpressionFlags.ReturnValueIsImportant);
			if (compiledCondition.AdditionalStatements.Count > 0)
				body = JsStatement.Block(body.Statements.Concat(compiledCondition.AdditionalStatements));
			_result.Add(JsStatement.DoWhile(compiledCondition.Expression, body));
		}
开发者ID:chenxustu1,项目名称:SaltarelleCompiler,代码行数:7,代码来源:StatementCompiler.cs

示例15: VisitDoWhileStatement

		public virtual void VisitDoWhileStatement (DoWhileStatement doWhileStatement)
		{
			VisitChildren (doWhileStatement);
		}
开发者ID:modulexcite,项目名称:ICSharpCode.Decompiler-retired,代码行数:4,代码来源:DepthFirstAstVisitor.cs


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