本文整理汇总了C#中Mono.CSharp.YieldBreak类的典型用法代码示例。如果您正苦于以下问题:C# YieldBreak类的具体用法?C# YieldBreak怎么用?C# YieldBreak使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
YieldBreak类属于Mono.CSharp命名空间,在下文中一共展示了YieldBreak类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: case_908
void case_908()
#line 6058 "cs-parser.jay"
{
var lt = (LocatedToken) yyVals[-2+yyTop];
string s = lt.Value;
if (s != "yield"){
report.Error (1003, lt.Location, "; expected");
} else if (lang_version == LanguageVersion.ISO_1){
FeatureIsNotAvailable (lt.Location, "iterators");
}
current_block.ParametersBlock.TopBlock.IsIterator = true;
yyVal = new YieldBreak (lt.Location);
lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));
}
示例2: Visit
public override object Visit (YieldBreak yieldBreakStatement)
{
var result = new YieldStatement ();
var location = LocationsBag.GetLocations (yieldBreakStatement);
result.AddChild (new CSharpTokenNode (Convert (yieldBreakStatement.loc), "yield".Length), YieldStatement.YieldKeywordRole);
if (location != null) {
result.AddChild (new CSharpTokenNode (Convert (location[0]), "break".Length), YieldStatement.BreakKeywordRole);
result.AddChild (new CSharpTokenNode (Convert (location[1]), ";".Length), YieldStatement.Roles.Semicolon);
}
return result;
}
示例3: Visit
public virtual object Visit (YieldBreak yieldBreakStatement)
{
return null;
}
示例4: case_899
void case_899()
#line 6010 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop];
string s = lt.Value;
if (s != "yield"){
report.Error (1003, lt.Location, "; expected");
} else if (lang_version == LanguageVersion.ISO_1){
FeatureIsNotAvailable (lt.Location, "iterators");
}
current_block.Explicit.RegisterIteratorYield ();
yyVal = new YieldBreak (lt.Location);
lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));
}
示例5: yyparse
//.........这里部分代码省略.........
Report.Error (1003, lt.Location, "; expected");
yyVal = null;
}
if (RootContext.Version == LanguageVersion.ISO_1){
Report.FeatureIsNotAvailable (lt.Location, "yield statement");
yyVal = null;
}
current_block.Toplevel.IsIterator = true;
yyVal = new Yield ((Expression) yyVals[-1+yyTop], lt.Location);
}
break;
case 797:
#line 5125 "cs-parser.jay"
{
Report.Error (1627, GetLocation (yyVals[-1+yyTop]), "Expression expected after yield return");
yyVal = null;
}
break;
case 798:
#line 5130 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop];
string s = lt.Value;
if (s != "yield"){
Report.Error (1003, lt.Location, "; expected");
yyVal = null;
}
if (RootContext.Version == LanguageVersion.ISO_1){
Report.FeatureIsNotAvailable (lt.Location, "yield statement");
yyVal = null;
}
current_block.Toplevel.IsIterator = true;
yyVal = new YieldBreak (lt.Location);
}
break;
case 801:
#line 5154 "cs-parser.jay"
{
yyVal = new TryCatch ((Block) yyVals[-1+yyTop], (List<Catch>) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]), false);
}
break;
case 802:
#line 5158 "cs-parser.jay"
{
yyVal = new TryFinally ((Statement) yyVals[-2+yyTop], (Block) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop]));
}
break;
case 803:
#line 5162 "cs-parser.jay"
{
yyVal = new TryFinally (new TryCatch ((Block) yyVals[-3+yyTop], (List<Catch>) yyVals[-2+yyTop], GetLocation (yyVals[-4+yyTop]), true), (Block) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));
}
break;
case 804:
#line 5166 "cs-parser.jay"
{
Report.Error (1524, GetLocation (yyVals[-2+yyTop]), "Expected catch or finally");
yyVal = null;
}
break;
case 805:
#line 5174 "cs-parser.jay"
{
var l = new List<Catch> (2);
示例6: yyparse
//.........这里部分代码省略.........
lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop]));
}
break;
case 856:
#line 5702 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop];
string s = lt.Value;
if (s != "yield"){
report.Error (1003, lt.Location, "; expected");
} else if (yyVals[-1+yyTop] == null) {
report.Error (1627, GetLocation (yyVals[0+yyTop]), "Expression expected after yield return");
} else if (lang_version == LanguageVersion.ISO_1){
FeatureIsNotAvailable (lt.Location, "iterators");
}
current_block.ParametersBlock.TopBlock.IsIterator = true;
yyVal = new Yield ((Expression) yyVals[-1+yyTop], lt.Location);
lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
}
break;
case 857:
#line 5718 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop];
string s = lt.Value;
if (s != "yield"){
report.Error (1003, lt.Location, "; expected");
} else if (lang_version == LanguageVersion.ISO_1){
FeatureIsNotAvailable (lt.Location, "iterators");
}
current_block.ParametersBlock.TopBlock.IsIterator = true;
yyVal = new YieldBreak (lt.Location);
lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));
}
break;
case 860:
#line 5740 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new TryCatch ((Block) yyVals[-1+yyTop], (List<Catch>) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]), false);
}
break;
case 861:
#line 5744 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new TryFinally ((Statement) yyVals[-2+yyTop], (Block) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]));
}
break;
case 862:
#line 5749 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new TryFinally (new TryCatch ((Block) yyVals[-3+yyTop], (List<Catch>) yyVals[-2+yyTop], GetLocation (yyVals[-4+yyTop]), true), (Block) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]));
}
break;
case 863:
#line 5754 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
report.Error (1524, GetLocation (yyVals[-2+yyTop]), "Expected catch or finally");
yyVal = null;
}
break;
case 864:
#line 5762 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
示例7: case_827
void case_827()
#line 5236 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop];
string s = lt.Value;
if (s != "yield"){
Report.Error (1003, lt.Location, "; expected");
} else if (lang_version == LanguageVersion.ISO_1){
FeatureIsNotAvailable (lt.Location, "iterators");
}
current_block.ParametersBlock.TopBlock.IsIterator = true;
yyVal = new YieldBreak (lt.Location);
lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));
}