本文整理汇总了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());
}
示例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:
示例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;
}
示例4: VisitBreakStatement
public virtual void VisitBreakStatement (BreakStatement breakStatement)
{
VisitChildren (breakStatement);
}
示例5: Walk
// BreakStatement
public override bool Walk(BreakStatement node) { return false; }
示例6: Walk
// BreakStatement
protected internal virtual bool Walk(BreakStatement node) { return true; }
示例7: Exit
public override void Exit(BreakStatement node)
{
level--;
}
示例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.
}
示例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.
}
示例10: VisitBreakStatement
public override void VisitBreakStatement(BreakStatement breakStatement)
{
FixSemicolon(breakStatement.SemicolonToken);
}
示例11: VisitBreakStatement
public override void VisitBreakStatement (BreakStatement node)
{
WriteKeyword ("break");
WriteToken (";");
WriteLine ();
}
示例12: VisitBreak
public void VisitBreak(BreakStatement b)
{
throw new NotImplementedException();
}
示例13: VisitBreakStatement
public virtual void VisitBreakStatement(BreakStatement breakStatement)
{
StartNode(breakStatement);
WriteKeyword("break", BreakStatement.BreakKeywordRole);
Semicolon();
EndNode(breakStatement);
}
示例14: VisitBreakStatement
public void VisitBreakStatement(BreakStatement breakStatement)
{
// EMPTY
}
示例15: Walk
public override bool Walk(BreakStatement node)
{
node.Parent = _currentScope;
node.LoopStatement = _loops[_loops.Count - 1];
return base.Walk(node);
}