本文整理汇总了C#中Mono.CSharp.Goto类的典型用法代码示例。如果您正苦于以下问题:C# Goto类的具体用法?C# Goto怎么用?C# Goto使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Goto类属于Mono.CSharp命名空间,在下文中一共展示了Goto类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Visit
public override object Visit (Goto gotoStatement)
{
var result = new GotoStatement (GotoType.Label);
var location = LocationsBag.GetLocations (gotoStatement);
result.AddChild (new CSharpTokenNode (Convert (gotoStatement.loc), "goto".Length), GotoStatement.Roles.Keyword);
result.AddChild (new Identifier (gotoStatement.Target, Convert (gotoStatement.loc)), GotoStatement.Roles.Identifier);
if (location != null)
result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), GotoStatement.Roles.Semicolon);
return result;
}
示例2: case_898
void case_898()
#line 5974 "cs-parser.jay"
{
var lt = (LocatedToken) yyVals[-1+yyTop];
yyVal = new Goto (lt.Value, GetLocation (yyVals[-2+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));
}
示例3: Visit
public override object Visit(Goto gotoStatement)
{
var result = new GotoStatement();
var location = LocationsBag.GetLocations(gotoStatement);
result.AddChild(new CSharpTokenNode(Convert(gotoStatement.loc), GotoStatement.GotoKeywordRole), GotoStatement.GotoKeywordRole);
var loc = location != null ? Convert(location [0]) : TextLocation.Empty;
result.AddChild(Identifier.Create(gotoStatement.Target, loc), Roles.Identifier);
if (location != null && location.Count > 1)
result.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);
return result;
}
示例4: GotoOrigin
public GotoOrigin (SavedOrigin next, UsageVector vector, Goto stmt)
: base (next, vector)
{
Stmt = stmt;
}
示例5: 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;
}
示例6: AddGotoOrigin
public override bool AddGotoOrigin (UsageVector vector, Goto goto_stmt)
{
string name = goto_stmt.Target;
LabeledStatement s = Block.LookupLabel (name);
if (s != null)
throw new InternalErrorException ("Shouldn't get here");
if (Parent == null) {
Error_UnknownLabel (goto_stmt.loc, name, Report);
return false;
}
int errors = Report.Errors;
Parent.AddGotoOrigin (vector, goto_stmt);
if (errors == Report.Errors)
Report.Error (1632, goto_stmt.loc, "Control cannot leave the body of an anonymous method");
return false;
}
示例7: Visit
public virtual object Visit (Goto gotoStatement)
{
return null;
}
示例8: yyparse
//.........这里部分代码省略.........
}
}
break;
case 782:
#line 5042 "cs-parser.jay"
{
LocalVariableReference v = (LocalVariableReference) yyVals[-1+yyTop];
Location l = GetLocation (yyVals[-8+yyTop]);
if (v != null) {
Foreach f = new Foreach ((Expression) yyVals[-6+yyTop], v, (Expression) yyVals[-3+yyTop], (Statement) yyVals[0+yyTop], l);
current_block.AddStatement (f);
}
yyVal = end_block (lexer.Location);
}
break;
case 789:
#line 5066 "cs-parser.jay"
{
yyVal = new Break (GetLocation (yyVals[-1+yyTop]));
}
break;
case 790:
#line 5073 "cs-parser.jay"
{
yyVal = new Continue (GetLocation (yyVals[-1+yyTop]));
}
break;
case 791:
#line 5080 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
yyVal = new Goto (lt.Value, lt.Location);
}
break;
case 792:
#line 5085 "cs-parser.jay"
{
yyVal = new GotoCase ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));
}
break;
case 793:
#line 5089 "cs-parser.jay"
{
yyVal = new GotoDefault (GetLocation (yyVals[-2+yyTop]));
}
break;
case 794:
#line 5096 "cs-parser.jay"
{
yyVal = new Return ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
}
break;
case 795:
#line 5103 "cs-parser.jay"
{
yyVal = new Throw ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
}
break;
case 796:
#line 5110 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop];
string s = lt.Value;
if (s != "yield"){
示例9: case_847
void case_847()
{
var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
yyVal = new Goto (lt.Value, GetLocation (yyVals[-2+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));
}
示例10: yyparse
//.........这里部分代码省略.........
}
break;
case 842:
#line 5628 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
Foreach f = new Foreach ((Expression) yyVals[-6+yyTop], (LocalVariable) yyVals[-1+yyTop], (Expression) yyVals[-3+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-8+yyTop]));
current_block.AddStatement (f);
lbag.AddStatement (f, GetLocation (yyVals[-7+yyTop]), GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]));
yyVal = end_block (GetLocation (yyVals[-2+yyTop]));
}
break;
case 849:
#line 5651 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new Break (GetLocation (yyVals[-1+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop]));
}
break;
case 850:
#line 5659 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new Continue (GetLocation (yyVals[-1+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop]));
}
break;
case 851:
#line 5667 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
yyVal = new Goto (lt.Value, lt.Location);
lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
}
break;
case 852:
#line 5673 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new GotoCase ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
}
break;
case 853:
#line 5678 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new GotoDefault (GetLocation (yyVals[-2+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));
}
break;
case 854:
#line 5686 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new Return ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop]));
}
break;
case 855:
#line 5694 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new Throw ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop]));
}
break;
case 856:
示例11: case_821
void case_821()
#line 5185 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
yyVal = new Goto (lt.Value, lt.Location);
lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
}