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


C# BreakStatement類代碼示例

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


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

示例1: BreakStatementProducesBreakWithLabel

        public void BreakStatementProducesBreakWithLabel()
        {
            var b = new BreakStatement("a");

            Assert.AreEqual("a", b.Label);
            Assert.AreEqual("break a;", b.ToString());
        }
開發者ID:DaveVdE,項目名稱:adamjsgenerator,代碼行數:7,代碼來源:BreakStatementTests.cs

示例2: Statement


//.........這裏部分代碼省略.........

                    while (laKind != Case && laKind != Default && laKind != CloseCurlyBrace && !IsEOF)
                    {
                        var stmt = Statement(Scope: Scope, Parent: ssds);

                        if (stmt != null)
                        {
                            stmt.Parent = ssds;
                            ssdssl.Add(stmt);
                        }
                    }

                    ssds.ScopeStatementList = ssdssl.ToArray();
                    ssds.EndLocation = t.EndLocation;

                    return ssds;
                case Continue:
                    Step();
                    var cs = new ContinueStatement() { Location = t.Location, Parent = Parent };
                    if (laKind == (Identifier))
                    {
                        Step();
                        cs.Identifier = t.Value;
                    }
                    else if(IsEOF)
                        cs.IdentifierHash = DTokens.IncompleteIdHash;

                    Expect(Semicolon);
                    cs.EndLocation = t.EndLocation;

                    return cs;
                case Break:
                    Step();
                    var bs = new BreakStatement() { Location = t.Location, Parent = Parent };

                    if (laKind == (Identifier))
                    {
                        Step();
                        bs.Identifier = t.Value;
                    }
                    else if(IsEOF)
                        bs.IdentifierHash = DTokens.IncompleteIdHash;

                    Expect(Semicolon);

                    bs.EndLocation = t.EndLocation;

                    return bs;
                case Return:
                    Step();
                    var rs = new ReturnStatement() { Location = t.Location, Parent = Parent };

                    if (laKind != (Semicolon))
                        rs.ReturnExpression = Expression(Scope);

                    Expect(Semicolon);
                    rs.EndLocation = t.EndLocation;

                    return rs;
                case Goto:
                    Step();
                    var gs = new GotoStatement() { Location = t.Location, Parent = Parent };

                    switch(laKind)
                    {
                        case Identifier:
開發者ID:rainers,項目名稱:D_Parser,代碼行數:67,代碼來源:Parser_Impl.cs

示例3: Visit

			public override object Visit (Break breakStatement)
			{
				var result = new BreakStatement ();
				var location = LocationsBag.GetLocations (breakStatement);
				
				result.AddChild (new CSharpTokenNode (Convert (breakStatement.loc), "break".Length), BreakStatement.Roles.Keyword);
				if (location != null)
					result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), BreakStatement.Roles.Semicolon);
				return result;
			}
開發者ID:pgoron,項目名稱:monodevelop,代碼行數:10,代碼來源:CSharpParser.cs

示例4: VisitBreakStatement

		public virtual void VisitBreakStatement (BreakStatement breakStatement)
		{
			VisitChildren (breakStatement);
		}
開發者ID:modulexcite,項目名稱:ICSharpCode.Decompiler-retired,代碼行數:4,代碼來源:DepthFirstAstVisitor.cs

示例5: Walk

 // BreakStatement
 public override bool Walk(BreakStatement node) { return false; }
開發者ID:jxnmaomao,項目名稱:ironruby,代碼行數:2,代碼來源:PythonWalker.Generated.cs

示例6: Walk

 // BreakStatement
 protected internal virtual bool Walk(BreakStatement node) { return true; }
開發者ID:JamesTryand,項目名稱:IronScheme,代碼行數:2,代碼來源:Walker.Generated.cs

示例7: Exit

 public override void Exit(BreakStatement node)
 {
     level--;
 }
開發者ID:buunguyen,項目名稱:bike,代碼行數:4,代碼來源:PrintNodeWalker.cs

示例8: actionPerformed

 /**
  * Call back method that must be called as soon as the given <code>
  * BreakStatement</code> object has been traversed.
  *
  * @param pBreakStatement  The <code>BreakStatement</code> object that has
  *                         just been traversed.
  */
 public void actionPerformed(
      BreakStatement pBreakStatement)
 {
     // Nothing to do.
 }
開發者ID:smartmobili,項目名稱:parsing,代碼行數:12,代碼來源:TraverseActionAdapter.cs

示例9: performAction

 /**
  * Call back method that must be called when the given <code>BreakStatement
  * </code> will become the next <i>traverse candidate</i>.
  *
  * @param pBreakStatement  The <code>BreakStatement</code> object that will
  *                         become the next <i>traverse candidate</i>.
  */
 public void performAction(
      BreakStatement pBreakStatement)
 {
     // Nothing to do.
 }
開發者ID:smartmobili,項目名稱:parsing,代碼行數:12,代碼來源:TraverseActionAdapter.cs

示例10: VisitBreakStatement

		public override void VisitBreakStatement(BreakStatement breakStatement)
		{
			FixSemicolon(breakStatement.SemicolonToken);
		}
開發者ID:txdv,項目名稱:monodevelop,代碼行數:4,代碼來源:AstFormattingVisitor.cs

示例11: VisitBreakStatement

		public override void VisitBreakStatement (BreakStatement node)
		{
			WriteKeyword ("break");
			WriteToken (";");
			WriteLine ();
		}
開發者ID:transformersprimeabcxyz,項目名稱:cecil-old,代碼行數:6,代碼來源:CSharpWriter.cs

示例12: VisitBreak

 public void VisitBreak(BreakStatement b)
 {
     throw new NotImplementedException();
 }
開發者ID:uxmal,項目名稱:pytocs,代碼行數:4,代碼來源:PyStatementWriter.cs

示例13: VisitBreakStatement

		public virtual void VisitBreakStatement(BreakStatement breakStatement)
		{
			StartNode(breakStatement);
			WriteKeyword("break", BreakStatement.BreakKeywordRole);
			Semicolon();
			EndNode(breakStatement);
		}
開發者ID:icsharpcode,項目名稱:NRefactory,代碼行數:7,代碼來源:CSharpOutputVisitor.cs

示例14: VisitBreakStatement

 public void VisitBreakStatement(BreakStatement breakStatement)
 {
     // EMPTY
 }
開發者ID:xuld,項目名稱:DocPlus,代碼行數:4,代碼來源:DocAstVistor.cs

示例15: Walk

        public override bool Walk(BreakStatement node)
        {
            node.Parent = _currentScope;
            node.LoopStatement = _loops[_loops.Count - 1];

            return base.Walk(node);
        }
開發者ID:TerabyteX,項目名稱:main,代碼行數:7,代碼來源:PythonNameBinder.cs


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