本文整理汇总了C#中GotoStatement类的典型用法代码示例。如果您正苦于以下问题:C# GotoStatement类的具体用法?C# GotoStatement怎么用?C# GotoStatement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GotoStatement类属于命名空间,在下文中一共展示了GotoStatement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AddLabel
internal void AddLabel(SimpleName label) {
this.labelIndex[label.Name.UniqueKey] = this.cases.Count;
GotoStatement gotoStatement = new GotoStatement(label, SourceDummy.SourceLocation);
List<Statement> statements = new List<Statement>(1);
statements.Add(gotoStatement);
this.cases.Add(new SwitchCase(new CompileTimeConstant(this.cases.Count, label.SourceLocation), statements, SourceDummy.SourceLocation));
}
开发者ID:mestriga,项目名称:Microsoft.CciSamples,代码行数:7,代码来源:TypeDeclarations.cs
示例2: Visit
public void Visit(GotoStatement gotoStatement)
{
}
开发者ID:rainers,项目名称:D_Parser,代码行数:3,代码来源:FunctionEvaluation.cs
示例3: AcceptGoto
public void AcceptGoto(GotoStatement stmt)
{
Check(stmt);
}
开发者ID:venusdharan,项目名称:systemsharp,代码行数:4,代码来源:HierarchyAnalysis.cs
示例4: Visit
public override object Visit (GotoDefault gotoDefault)
{
var result = new GotoStatement (GotoType.CaseDefault);
result.AddChild (new CSharpTokenNode (Convert (gotoDefault.loc), "goto".Length), GotoStatement.Roles.Keyword);
var location = LocationsBag.GetLocations (gotoDefault);
if (location != null) {
result.AddChild (new CSharpTokenNode (Convert (location[0]), "default".Length), GotoStatement.DefaultKeywordRole);
result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), GotoStatement.Roles.Semicolon);
}
return result;
}
开发者ID:pgoron,项目名称:monodevelop,代码行数:12,代码来源:CSharpParser.cs
示例5: VisitGotoStatement
public virtual void VisitGotoStatement (GotoStatement gotoStatement)
{
VisitChildren (gotoStatement);
}
开发者ID:modulexcite,项目名称:ICSharpCode.Decompiler-retired,代码行数:4,代码来源:DepthFirstAstVisitor.cs
示例6: CSharpGrammar
//.........这里部分代码省略.........
{
Keyword = (AstToken) node.Children[0].Result,
Semicolon = (AstToken) node.Children[1].Result
});
var returnStatement = new GrammarDefinition("ReturnStatement",
rule: ToElement(RETURN)
+ expressionOptional
+ ToElement(SEMICOLON),
createNode: node =>
{
var result = new ReturnStatement();
result.ReturnKeyword = (AstToken) node.Children[0].Result;
if (node.Children[1].HasChildren)
result.Value = (Expression) node.Children[1].Result;
result.AddChild(AstNodeTitles.Semicolon, node.Children[2].Result);
return result;
});
var throwStatement = new GrammarDefinition("ThrowStatement",
rule: ToElement(THROW)
+ expressionOptional
+ ToElement(SEMICOLON),
createNode: node =>
{
var result = new ThrowStatement();
result.ThrowKeyword = (AstToken) node.Children[0].Result;
if (node.Children[1].HasChildren)
result.Expression = (Expression) node.Children[1].Result;
result.AddChild(AstNodeTitles.Semicolon, node.Children[2].Result);
return result;
});
var gotoStatement = new GrammarDefinition("GotoStatement",
rule: ToElement(GOTO)
+ identifierInsideBody
+ ToElement(SEMICOLON),
// TODO: goto case and goto default statements.
createNode: node =>
{
var result = new GotoStatement();
result.GotoKeyword = (AstToken) node.Children[0].Result;
result.LabelIdentifier = (Identifier) node.Children[1].Result;
result.AddChild(AstNodeTitles.Semicolon, node.Children[2].Result);
return result;
});
var jumpStatement = new GrammarDefinition("JumpStatement",
rule: breakStatement
| continueStatement
| gotoStatement
| returnStatement
| throwStatement);
var yieldStatement = new GrammarDefinition("YieldStatement",
rule: ToElement(YIELD)
+ ToElement(RETURN)
+ expression
+ ToElement(SEMICOLON),
createNode: node => new YieldStatement()
{
YieldKeyword = (AstToken) node.Children[0].Result,
ReturnKeyword = (AstToken) node.Children[1].Result,
Value = (Expression) node.Children[2].Result
});
开发者ID:JerreS,项目名称:AbstractCode,代码行数:66,代码来源:CSharpGrammar.cs
示例7: VisitGotoStatement
public void VisitGotoStatement(GotoStatement gotoStatement)
{
StartNode(gotoStatement);
WriteKeyword(GotoStatement.GotoKeywordRole);
WriteIdentifier(gotoStatement.GetChildByRole(Roles.Identifier));
Semicolon();
EndNode(gotoStatement);
}
开发者ID:jeremiahyan,项目名称:ILSpy,代码行数:8,代码来源:CSharpOutputVisitor.cs
示例8: Visit
public override object Visit (Goto gotoStatement)
{
var result = new GotoStatement ();
var location = LocationsBag.GetLocations (gotoStatement);
result.AddChild (new CSharpTokenNode (Convert (gotoStatement.loc), "goto".Length), GotoStatement.Roles.Keyword);
var loc = location != null ? Convert (location [0]) : AstLocation.Empty;
result.AddChild (Identifier.Create (gotoStatement.Target, loc), GotoStatement.Roles.Identifier);
if (location != null)
result.AddChild (new CSharpTokenNode (Convert (location [1]), 1), GotoStatement.Roles.Semicolon);
return result;
}
开发者ID:severinh,项目名称:monodevelop-vala-afrodite-update,代码行数:12,代码来源:CSharpParser.cs
示例9: VisitGotoStatement
public override void VisitGotoStatement(GotoStatement gotoStatement) {
new GotoBlock(this, gotoStatement).Emit();
}
开发者ID:yindongfei,项目名称:bridge.lua,代码行数:3,代码来源:Emitter.Visitor.cs
示例10: ParseGoto
private Statement ParseGoto(TokenSet followers)
//^ requires this.currentToken == Token.Goto;
//^ ensures followers[this.currentToken] || this.currentToken == Token.EndOfFile;
{
SourceLocationBuilder slb = new SourceLocationBuilder(this.scanner.SourceLocationOfLastScannedToken);
this.GetNextToken();
Statement result;
switch (this.currentToken) {
case Token.Case:
this.GetNextToken();
Expression caseLabel = this.ParseExpression(followers|Token.Semicolon);
slb.UpdateToSpan(caseLabel.SourceLocation);
result = new GotoSwitchCaseStatement(caseLabel, slb);
break;
case Token.Default:
slb.UpdateToSpan(this.scanner.SourceLocationOfLastScannedToken);
result = new GotoSwitchCaseStatement(null, slb);
this.GetNextToken();
break;
default:
result = new GotoStatement(this.ParseSimpleName(followers), slb);
break;
}
this.SkipSemiColon(followers);
return result;
}
开发者ID:hesam,项目名称:SketchSharp,代码行数:26,代码来源:Parser.cs
示例11: AcceptGoto
public void AcceptGoto(GotoStatement stmt)
{
IsEmpty = false;
}
开发者ID:venusdharan,项目名称:systemsharp,代码行数:4,代码来源:IfStatementBeautifier.cs
示例12: Statement
//.........这里部分代码省略.........
LastParsedObject = s;
if (laKind == (Identifier))
{
Step();
s.Identifier = t.Value;
}
Expect(Semicolon);
s.EndLocation = t.EndLocation;
return s;
}
#endregion
#region Return
else if (laKind == (Return))
{
Step();
var s = new ReturnStatement() { Location = t.Location, Parent = Parent };
LastParsedObject = s;
if (laKind != (Semicolon))
s.ReturnExpression = Expression(Scope);
Expect(Semicolon);
s.EndLocation = t.EndLocation;
return s;
}
#endregion
#region Goto
else if (laKind == (Goto))
{
Step();
var s = new GotoStatement() { Location = t.Location, Parent = Parent };
LastParsedObject = s;
if (laKind == (Identifier))
{
Step();
s.StmtType = GotoStatement.GotoStmtType.Identifier;
s.LabelIdentifier = t.Value;
}
else if (laKind == Default)
{
Step();
s.StmtType = GotoStatement.GotoStmtType.Default;
}
else if (laKind == (Case))
{
Step();
s.StmtType = GotoStatement.GotoStmtType.Case;
if (laKind != (Semicolon))
s.CaseExpression = Expression(Scope);
}
Expect(Semicolon);
s.EndLocation = t.EndLocation;
return s;
}
#endregion
#region WithStatement
else if (laKind == (With))
{
开发者ID:gavin-norman,项目名称:Mono-D,代码行数:67,代码来源:Parser_Impl.cs
示例13: Visit
public override void Visit(GotoStatement s)
{
if(s.StmtType == GotoStatement.GotoStmtType.Identifier &&
s.LabelIdentifierHash == DTokens.IncompleteIdHash) {
prv = new CtrlSpaceCompletionProvider(cdgen, scopedBlock, s, MemberFilter.Labels);
scopedStatement = s;
halt = true;
}
else
base.Visit (s);
}
开发者ID:rainers,项目名称:D_Parser,代码行数:13,代码来源:CompletionProviderVisitor.cs
示例14: GotoStatement
void GotoStatement(
#line 3119 "VBNET.ATG"
out GotoStatement goToStatement) {
#line 3121 "VBNET.ATG"
string label = String.Empty;
Expect(119);
LabelName(
#line 3124 "VBNET.ATG"
out label);
#line 3126 "VBNET.ATG"
goToStatement = new GotoStatement(label);
}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:16,代码来源:Parser.cs
示例15: Process_Goto_Statement
private void Process_Goto_Statement(StringBuilder sb, GotoStatement statement)
{
sb.Append("goto ");
if (statement.Identifier != null)
{
sb.Append(statement.Identifier.Text).Append(";");
}
else if (statement.Expression == null)
{
sb.Append("default;");
}
else
{
sb.Append("case ").Append(FormatExpression(statement.Expression)).Append(";");
}
}
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:17,代码来源:CSharpCodeFormatter.cs
示例16: Visit
public void Visit(GotoStatement expression)
{
outStream.WriteLine("goto {0}", expression.TargetLabel.Name);
}
开发者ID:reshadi2,项目名称:mcjs,代码行数:4,代码来源:AstWriter.cs
示例17: VisitGotoStatement
public virtual void VisitGotoStatement(GotoStatement gotoStatement)
{
if (this.ThrowException)
{
throw (Exception)this.CreateException(gotoStatement);
}
}
开发者ID:fabriciomurta,项目名称:BridgeUnified,代码行数:7,代码来源:Visitor.Exception.cs
示例18: GotoBlock
public GotoBlock(IEmitter emitter, GotoStatement gotoStatement) : base(emitter, gotoStatement) {
gotoStatement_ = gotoStatement;
}
开发者ID:yindongfei,项目名称:bridge.lua,代码行数:3,代码来源:GotoBlock.cs
示例19: VisitGotoStatement
public override void VisitGotoStatement(GotoStatement gotoStatement) {
_result.Add(JsStatement.Goto(gotoStatement.Label));
}
开发者ID:chenxustu1,项目名称:SaltarelleCompiler,代码行数:3,代码来源:StatementCompiler.cs
示例20: VisitGotoStatement
public void VisitGotoStatement(GotoStatement statement)
{
Formatter.StartNode(statement);
Formatter.WriteKeyword("goto");
Formatter.WriteSpace();
statement.LabelIdentifier.AcceptVisitor(this);
WriteSemicolon();
Formatter.EndNode();
}
开发者ID:JerreS,项目名称:AbstractCode,代码行数:11,代码来源:CSharpAstWriter.cs
注:本文中的GotoStatement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论