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


C# CSharp.While类代码示例

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


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

示例1: Visit

			public override object Visit(While whileStatement)
			{
				var result = new WhileStatement();
				var location = LocationsBag.GetLocations(whileStatement);
				result.AddChild(new CSharpTokenNode(Convert(whileStatement.loc), WhileStatement.WhileKeywordRole), WhileStatement.WhileKeywordRole);
				
				if (location != null)
					result.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);
				if (whileStatement.expr != null)
					result.AddChild((Expression)whileStatement.expr.Accept(this), Roles.Condition);
				if (location != null && location.Count > 1)
					result.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);
				if (whileStatement.Statement != null)
					result.AddChild((Statement)whileStatement.Statement.Accept(this), Roles.EmbeddedStatement);
				return result;
			}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:16,代码来源:CSharpParser.cs

示例2: Visit

			public override object Visit (While whileStatement)
			{
				var result = new WhileStatement (WhilePosition.Begin);
				var location = LocationsBag.GetLocations (whileStatement);
				result.AddChild (new CSharpTokenNode (Convert (whileStatement.loc), "while".Length), WhileStatement.WhileKeywordRole);
				
				if (location != null)
					result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), WhileStatement.Roles.LPar);
				result.AddChild ((INode)whileStatement.expr.Accept (this), WhileStatement.Roles.Condition);
				if (location != null)
					result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), WhileStatement.Roles.RPar);
				result.AddChild ((INode)whileStatement.Statement.Accept (this), WhileStatement.Roles.EmbeddedStatement);
				
				return result;
			}
开发者ID:pgoron,项目名称:monodevelop,代码行数:15,代码来源:CSharpParser.cs

示例3: case_856

void case_856()
#line 5693 "cs-parser.jay"
{
		if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
			Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
	  
		yyVal = new While ((BooleanExpression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));
		lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));
	  }
开发者ID:segaman,项目名称:NRefactory,代码行数:9,代码来源:cs-parser.cs

示例4: case_857

void case_857()
#line 5701 "cs-parser.jay"
{
		Error_SyntaxError (yyToken);
		
		yyVal = new While ((BooleanExpression) yyVals[-1+yyTop], null, GetLocation (yyVals[-3+yyTop]));
		lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]));
	  }
开发者ID:segaman,项目名称:NRefactory,代码行数:8,代码来源:cs-parser.cs

示例5: Visit

		public virtual object Visit (While whileStatement)
		{
			return null;
		}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:4,代码来源:visit.cs

示例6: yyparse


//.........这里部分代码省略.........
#line 4630 "cs-parser.jay"
  {
		ArrayList labels = new ArrayList (4);

		labels.Add (yyVals[0+yyTop]);
		yyVal = labels;
	  }
  break;
case 733:
#line 4637 "cs-parser.jay"
  {
		ArrayList labels = (ArrayList) (yyVals[-1+yyTop]);
		labels.Add (yyVals[0+yyTop]);

		yyVal = labels;
	  }
  break;
case 734:
#line 4647 "cs-parser.jay"
  {
	 	yyVal = new SwitchLabel ((Expression) yyVals[-1+yyTop], (Location) yyVals[-2+yyTop]);
	 }
  break;
case 735:
#line 4651 "cs-parser.jay"
  {
		yyVal = new SwitchLabel (null, (Location) yyVals[0+yyTop]);
	  }
  break;
case 740:
#line 4665 "cs-parser.jay"
  {
		Location l = (Location) yyVals[-4+yyTop];
		yyVal = new While ((Expression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], l);
	  }
  break;
case 741:
#line 4674 "cs-parser.jay"
  {
		Location l = (Location) yyVals[-6+yyTop];

		yyVal = new Do ((Statement) yyVals[-5+yyTop], (Expression) yyVals[-2+yyTop], l);
	  }
  break;
case 742:
#line 4683 "cs-parser.jay"
  {
		Location l = lexer.Location;
		start_block (l);  
		Block assign_block = current_block;

		if (yyVals[-1+yyTop] is DictionaryEntry){
			DictionaryEntry de = (DictionaryEntry) yyVals[-1+yyTop];
			
			Expression type = (Expression) de.Key;
			ArrayList var_declarators = (ArrayList) de.Value;

			foreach (VariableDeclaration decl in var_declarators){

				LocalInfo vi;

				vi = current_block.AddVariable (type, decl.identifier, decl.Location);
				if (vi == null)
					continue;

				Expression expr = decl.expression_or_array_initializer;
开发者ID:lewurm,项目名称:benchmarker,代码行数:67,代码来源:cs-parser.cs

示例7: case_806

void case_806()
{
		Error_SyntaxError (yyToken);
		
		yyVal = new While ((BooleanExpression) yyVals[-1+yyTop], null, GetLocation (yyVals[-3+yyTop]));
		lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]));
	  }
开发者ID:animaonline,项目名称:Portable-Mono.CSharp,代码行数:7,代码来源:cs-parser.cs

示例8: yyparse


//.........这里部分代码省略.........

		labels.Add ((SwitchLabel) yyVals[0+yyTop]);
		yyVal = labels;
	  }
  break;
case 815:
#line 5476 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		var labels = (List<SwitchLabel>) (yyVals[-1+yyTop]);
		labels.Add ((SwitchLabel) yyVals[0+yyTop]);

		yyVal = labels;
	  }
  break;
case 816:
#line 5486 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
	 	yyVal = new SwitchLabel ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
	 	lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));
	 }
  break;
case 817:
#line 5491 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		yyVal = new SwitchLabel (null, GetLocation (yyVals[0+yyTop]));
	  }
  break;
case 822:
#line 5505 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
			Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
	  
		yyVal = new While ((BooleanExpression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));
		lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));
	  }
  break;
case 823:
#line 5517 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		yyVal = new Do ((Statement) yyVals[-5+yyTop], (BooleanExpression) yyVals[-2+yyTop], GetLocation (yyVals[-6+yyTop]));
		lbag.AddStatement (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));
	  }
  break;
case 824:
#line 5525 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		start_block (GetLocation (yyVals[0+yyTop]));
		current_block.IsCompilerGenerated = true;
	  }
  break;
case 825:
#line 5530 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		yyVal = yyVals[0+yyTop];
	  }
  break;
case 826:
#line 5541 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
			Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
	  
		For f = new For ((Statement) yyVals[-6+yyTop], (BooleanExpression) yyVals[-4+yyTop], (Statement) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-9+yyTop]));
		current_block.AddStatement (f);
		
开发者ID:runefs,项目名称:Marvin,代码行数:66,代码来源:cs-parser.cs

示例9: case_792

void case_792()
#line 5023 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
		if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
			Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
	  
		yyVal = new While ((BooleanExpression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));
		lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));
	  }
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:9,代码来源:cs-parser.cs


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