当前位置: 首页>>代码示例>>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;未经允许,请勿转载。