當前位置: 首頁>>代碼示例>>C#>>正文


C# CSharp.LabeledStatement類代碼示例

本文整理匯總了C#中Mono.CSharp.LabeledStatement的典型用法代碼示例。如果您正苦於以下問題:C# LabeledStatement類的具體用法?C# LabeledStatement怎麽用?C# LabeledStatement使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


LabeledStatement類屬於Mono.CSharp命名空間,在下文中一共展示了LabeledStatement類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Visit

			public override object Visit (LabeledStatement labeledStatement)
			{
				var result = new LabelStatement ();
				result.AddChild (new Identifier (labeledStatement.Name, Convert (labeledStatement.loc)), LabelStatement.Roles.Identifier);
				return result;
			}
開發者ID:pgoron,項目名稱:monodevelop,代碼行數:6,代碼來源:CSharpParser.cs

示例2: StartFlowBranching

		public FlowBranchingLabeled StartFlowBranching (LabeledStatement stmt)
		{
			FlowBranchingLabeled branching = new FlowBranchingLabeled (CurrentBranching, stmt);
			current_flow_branching = branching;
			return branching;
		}
開發者ID:KAW0,項目名稱:Alter-Native,代碼行數:6,代碼來源:context.cs

示例3: case_783

void case_783()
#line 5255 "cs-parser.jay"
{
		var lt = (LocatedToken) yyVals[-1+yyTop];
		LabeledStatement labeled = new LabeledStatement (lt.Value, current_block, lt.Location);
		lbag.AddLocation (labeled, GetLocation (yyVals[0+yyTop]));
		current_block.AddLabel (labeled);
		current_block.AddStatement (labeled);
	  }
開發者ID:segaman,項目名稱:NRefactory,代碼行數:9,代碼來源:cs-parser.cs

示例4: Visit

			public override object Visit(LabeledStatement labeledStatement)
			{
				var result = new LabelStatement();
				result.AddChild(Identifier.Create(labeledStatement.Name, Convert(labeledStatement.loc)), Roles.Identifier);
				var location = LocationsBag.GetLocations(labeledStatement);
				if (location != null)
					result.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Colon), Roles.Colon);
				return result;
			}
開發者ID:0xb1dd1e,項目名稱:NRefactory,代碼行數:9,代碼來源:CSharpParser.cs

示例5: Visit

		public virtual object Visit (LabeledStatement labeledStatement)
		{
			return null;
		}
開發者ID:KAW0,項目名稱:Alter-Native,代碼行數:4,代碼來源:visit.cs

示例6: FlowBranchingLabeled

		public FlowBranchingLabeled (FlowBranching parent, LabeledStatement stmt)
			: base (parent, BranchingType.Labeled, SiblingType.Conditional, null, stmt.loc)
		{
			this.stmt = stmt;
			CurrentUsageVector.MergeOrigins (stmt.JumpOrigins);
			actual = CurrentUsageVector.Clone ();

			// stand-in for backward jumps
			CurrentUsageVector.ResetBarrier ();
		}
開發者ID:yayanyang,項目名稱:monodevelop,代碼行數:10,代碼來源:flowanalysis.cs

示例7: AddLabel

		public void AddLabel (string name, LabeledStatement label)
		{
			if (labels == null)
				labels = new Dictionary<string, object> ();

			object value;
			if (!labels.TryGetValue (name, out value)) {
				labels.Add (name, label);
				return;
			}

			LabeledStatement existing = value as LabeledStatement;
			List<LabeledStatement> existing_list;
			if (existing != null) {
				existing_list = new List<LabeledStatement> ();
				existing_list.Add (existing);
				labels[name] = existing_list;
			} else {
				existing_list = (List<LabeledStatement>) value;
			}

			//
			// A collision checking between labels
			//
			for (int i = 0; i < existing_list.Count; ++i) {
				existing = existing_list[i];
				Block b = existing.Block;

				// Collision at same level
				if (label.Block == b) {
					Report.SymbolRelatedToPreviousError (existing.loc, name);
					Report.Error (140, label.loc, "The label `{0}' is a duplicate", name);
					break;
				}

				// Collision with parent
				b = label.Block;
				while ((b = b.Parent) != null) {
					if (existing.Block == b) {
						Report.Error (158, label.loc,
							"The label `{0}' shadows another label by the same name in a contained scope", name);
						i = existing_list.Count;
						break;
					}
				}

				// Collision with with children
				b = existing.Block;
				while ((b = b.Parent) != null) {
					if (label.Block == b) {
						Report.Error (158, label.loc,
							"The label `{0}' shadows another label by the same name in a contained scope", name);
						i = existing_list.Count;
						break;
					}
				}
			}

			existing_list.Add (label);
		}
開發者ID:alisci01,項目名稱:mono,代碼行數:60,代碼來源:statement.cs

示例8: SetResolvedTarget

		public void SetResolvedTarget (LabeledStatement label)
		{
			this.label = label;
			label.AddReference ();
		}
開發者ID:alisci01,項目名稱:mono,代碼行數:5,代碼來源:statement.cs

示例9: AddLabel

		/// <summary>
		///   Adds a label to the current block. 
		/// </summary>
		///
		/// <returns>
		///   false if the name already exists in this block. true
		///   otherwise.
		/// </returns>
		///
		public bool AddLabel (LabeledStatement target)
		{
			if (switch_block != null)
				return switch_block.AddLabel (target);

			string name = target.Name;

			Block cur = this;
			while (cur != null) {
				LabeledStatement s = cur.DoLookupLabel (name);
				if (s != null) {
					Toplevel.Report.SymbolRelatedToPreviousError (s.loc, s.Name);
					Toplevel.Report.Error (140, target.loc, "The label `{0}' is a duplicate", name);
					return false;
				}

				if (this == Explicit)
					break;

				cur = cur.Parent;
			}

			while (cur != null) {
				if (cur.DoLookupLabel (name) != null) {
					Error_158 (name, target.loc);
					return false;
				}

				if (children != null) {
					foreach (Block b in children) {
						LabeledStatement s = b.DoLookupLabel (name);
						if (s == null)
							continue;

						Toplevel.Report.SymbolRelatedToPreviousError (s.loc, s.Name);
						Error_158 (name, target.loc);
						return false;
					}
				}

				cur = cur.Parent;
			}

			Toplevel.CheckError158 (name, target.loc);

			if (labels == null)
				labels = new Dictionary<string, LabeledStatement> ();

			labels.Add (name, target);
			return true;
		}
開發者ID:tgiphil,項目名稱:mono,代碼行數:60,代碼來源:statement.cs

示例10: case_728

void case_728()
#line 4643 "cs-parser.jay"
{
		var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
		LabeledStatement labeled = new LabeledStatement (lt.Value, current_block, lt.Location);

		current_block.AddLabel (labeled);
		current_block.AddStatement (labeled);
	  }
開發者ID:Ein,項目名稱:monodevelop,代碼行數:9,代碼來源:cs-parser.cs

示例11: yyparse


//.........這裏部分代碼省略.........
		}
	  }
  break;
case 689:
#line 4506 "cs-parser.jay"
  {
		current_block.AddStatement ((Statement) yyVals[0+yyTop]);
	  }
  break;
case 718:
#line 4547 "cs-parser.jay"
  {
		  Report.Error (1023, GetLocation (yyVals[0+yyTop]), "An embedded statement may not be a declaration or labeled statement");
		  yyVal = null;
	  }
  break;
case 719:
#line 4552 "cs-parser.jay"
  {
		  Report.Error (1023, GetLocation (yyVals[0+yyTop]), "An embedded statement may not be a declaration or labeled statement");
		  yyVal = null;
	  }
  break;
case 720:
#line 4560 "cs-parser.jay"
  {
		yyVal = new EmptyStatement (GetLocation (yyVals[0+yyTop]));
	  }
  break;
case 721:
#line 4567 "cs-parser.jay"
  {
		var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
		LabeledStatement labeled = new LabeledStatement (lt.Value, lt.Location);

		if (current_block.AddLabel (labeled))
			current_block.AddStatement (labeled);
	  }
  break;
case 723:
#line 4579 "cs-parser.jay"
  {
		if (yyVals[-1+yyTop] != null){
			var de = (Tuple<FullNamedExpression, List<object>>) yyVals[-1+yyTop];
			yyVal = declare_local_variables (de.Item1, de.Item2, de.Item1.Location);
		}
	  }
  break;
case 724:
#line 4587 "cs-parser.jay"
  {
		if (yyVals[-1+yyTop] != null){
			var de = (Tuple<FullNamedExpression, List<object>>) yyVals[-1+yyTop];

			yyVal = declare_local_constants (de.Item1, de.Item2);
		}
	  }
  break;
case 725:
#line 4604 "cs-parser.jay"
  { 
		/* FIXME: Do something smart here regarding the composition of the type.*/

		/* Ok, the above "primary_expression" is there to get rid of*/
		/* both reduce/reduce and shift/reduces in the grammar, it should*/
		/* really just be "type_name".  If you use type_name, a reduce/reduce*/
開發者ID:speier,項目名稱:shake,代碼行數:67,代碼來源:cs-parser.cs

示例12: case_733

void case_733()
{
		var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
		LabeledStatement labeled = new LabeledStatement (lt.Value, current_block, lt.Location);
		lbag.AddLocation (labeled, GetLocation (yyVals[0+yyTop]));
		current_block.AddLabel (labeled);
		current_block.AddStatement (labeled);
	  }
開發者ID:animaonline,項目名稱:Portable-Mono.CSharp,代碼行數:8,代碼來源:cs-parser.cs

示例13: yyparse


//.........這裏部分代碼省略.........
  break;
case 750:
#line 5057 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		  report.Error (1023, GetLocation (yyVals[0+yyTop]), "An embedded statement may not be a declaration or labeled statement");
		  yyVal = null;
	  }
  break;
case 751:
#line 5062 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		  report.Error (1023, GetLocation (yyVals[0+yyTop]), "An embedded statement may not be a declaration or labeled statement");
		  yyVal = null;
	  }
  break;
case 752:
#line 5067 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		Error_SyntaxError (yyToken);
		yyVal = new EmptyStatement (GetLocation (yyVals[0+yyTop]));
	  }
  break;
case 753:
#line 5075 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		/* Uses lexer.Location because semicolon location is not kept in quick mode*/
		yyVal = new EmptyStatement (lexer.Location);
	  }
  break;
case 754:
#line 5083 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
		LabeledStatement labeled = new LabeledStatement (lt.Value, current_block, lt.Location);

		current_block.AddLabel (labeled);
		current_block.AddStatement (labeled);
	  }
  break;
case 757:
#line 5096 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		if (yyVals[-1+yyTop] is VarExpr)
			yyVals[-1+yyTop] = new SimpleName ("var", ((VarExpr) yyVals[-1+yyTop]).Location);
	  
		yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);
	  }
  break;
case 758:
#line 5112 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  { 
		/* Ok, the above "primary_expression" is there to get rid of*/
		/* both reduce/reduce and shift/reduces in the grammar, it should*/
		/* really just be "type_name".  If you use type_name, a reduce/reduce*/
		/* creeps up.  If you use namespace_or_type_name (which is all we need*/
		/* really) two shift/reduces appear.*/
		/* */

		/* So the super-trick is that primary_expression*/
		/* can only be either a SimpleName or a MemberAccess. */
		/* The MemberAccess case arises when you have a fully qualified type-name like :*/
		/* Foo.Bar.Blah i;*/
		/* SimpleName is when you have*/
		/* Blah i;*/
		
		Expression expr = (Expression) yyVals[-1+yyTop];
開發者ID:runefs,項目名稱:Marvin,代碼行數:67,代碼來源:cs-parser.cs

示例14: case_728

void case_728()
#line 4623 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
		var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
		LabeledStatement labeled = new LabeledStatement (lt.Value, current_block, lt.Location);

		current_block.AddLabel (labeled);
		current_block.AddStatement (labeled);
	  }
開發者ID:RainsSoft,項目名稱:MonoCompilerAsAService,代碼行數:9,代碼來源:cs-parser.cs


注:本文中的Mono.CSharp.LabeledStatement類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。