本文整理汇总了C#中Mono.CSharp.TryCatch类的典型用法代码示例。如果您正苦于以下问题:C# TryCatch类的具体用法?C# TryCatch怎么用?C# TryCatch使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TryCatch类属于Mono.CSharp命名空间,在下文中一共展示了TryCatch类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartFlowBranching
public FlowBranchingTryCatch StartFlowBranching (TryCatch stmt)
{
FlowBranchingTryCatch branching = new FlowBranchingTryCatch (CurrentBranching, stmt);
current_flow_branching = branching;
return branching;
}
示例2: Visit
public override object Visit(TryCatch tryCatchStatement)
{
var result = new TryCatchStatement();
result.AddChild(new CSharpTokenNode(Convert(tryCatchStatement.loc), TryCatchStatement.TryKeywordRole), TryCatchStatement.TryKeywordRole);
if (tryCatchStatement.Block != null)
result.AddChild((BlockStatement)tryCatchStatement.Block.Accept(this), TryCatchStatement.TryBlockRole);
if (tryCatchStatement.Clauses != null) {
foreach (var ctch in tryCatchStatement.Clauses) {
result.AddChild(ConvertCatch(ctch), TryCatchStatement.CatchClauseRole);
}
}
// if (tryCatchStatement.General != null)
// result.AddChild (ConvertCatch (tryCatchStatement.General), TryCatchStatement.CatchClauseRole);
return result;
}
示例3: Visit
public override object Visit (TryCatch tryCatchStatement)
{
var result = new TryCatchStatement ();
result.AddChild (new CSharpTokenNode (Convert (tryCatchStatement.loc), "try".Length), TryCatchStatement.TryKeywordRole);
result.AddChild ((INode)tryCatchStatement.Block.Accept (this), TryCatchStatement.TryBlockRole);
foreach (Catch ctch in tryCatchStatement.Specific) {
result.AddChild (ConvertCatch (ctch), TryCatchStatement.CatchClauseRole);
}
if (tryCatchStatement.General != null)
result.AddChild (ConvertCatch (tryCatchStatement.General), TryCatchStatement.CatchClauseRole);
return result;
}
示例4: yyparse
//.........这里部分代码省略.........
case 899:
case_899();
break;
case 900:
case_900();
break;
case 901:
case_901();
break;
case 902:
case_902();
break;
case 903:
case_903();
break;
case 904:
case_904();
break;
case 905:
case_905();
break;
case 906:
case_906();
break;
case 907:
case_907();
break;
case 908:
case_908();
break;
case 911:
#line 6082 "cs-parser.jay"
{
yyVal = new TryCatch ((Block) yyVals[-1+yyTop], (List<Catch>) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]), false);
}
break;
case 912:
case_912();
break;
case 913:
case_913();
break;
case 914:
case_914();
break;
case 915:
case_915();
break;
case 916:
case_916();
break;
case 919:
#line 6131 "cs-parser.jay"
{
yyVal = new Catch ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
}
break;
case 920:
case_920();
break;
case 921:
#line 6150 "cs-parser.jay"
{
yyVal = yyVals[-1+yyTop];
}
break;
示例5: case_914
void case_914()
#line 6094 "cs-parser.jay"
{
Error_SyntaxError (1524, yyToken);
yyVal = new TryCatch ((Block) yyVals[-1+yyTop], null, GetLocation (yyVals[-2+yyTop]), false);
}
示例6: Visit
public virtual object Visit (TryCatch tryCatchStatement)
{
return null;
}
示例7: FlowBranchingTryCatch
public FlowBranchingTryCatch (FlowBranching parent, TryCatch stmt)
: base (parent, BranchingType.Block, SiblingType.Try, null, stmt.loc)
{
this.tc = stmt;
}
示例8: yyparse
//.........这里部分代码省略.........
case 810:
case_810();
break;
case 817:
case_817();
break;
case 818:
case_818();
break;
case 819:
case_819();
break;
case 820:
case_820();
break;
case 821:
case_821();
break;
case 822:
case_822();
break;
case 823:
case_823();
break;
case 824:
case_824();
break;
case 825:
case_825();
break;
case 828:
#line 5266 "cs-parser.jay"
{
yyVal = new TryCatch ((Block) yyVals[-1+yyTop], (List<Catch>) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]), false);
}
break;
case 829:
case_829();
break;
case 830:
case_830();
break;
case 831:
case_831();
break;
case 832:
case_832();
break;
case 833:
case_833();
break;
case 836:
#line 5319 "cs-parser.jay"
{
yyVal = new Catch ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
}
break;
case 837:
case_837();
break;
case 838:
#line 5338 "cs-parser.jay"
{
yyVal = yyVals[-1+yyTop];
}
break;
示例9: yyparse
//.........这里部分代码省略.........
}
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);
l.Add ((Catch) yyVals[0+yyTop]);
yyVal = l;
}
break;
case 806:
#line 5181 "cs-parser.jay"
示例10: case_863
void case_863()
{
Error_SyntaxError (1524, yyToken);
yyVal = new TryCatch ((Block) yyVals[-1+yyTop], null, GetLocation (yyVals[-2+yyTop]), false);
}
示例11: case_842
void case_842()
#line 5548 "cs-parser.jay"
{
report.Error (1524, GetLocation (yyVals[-2+yyTop]), "Expected catch or finally");
yyVal = new TryCatch ((Block) yyVals[-1+yyTop], null, GetLocation (yyVals[-2+yyTop]), false);
}
示例12: yyparse
//.........这里部分代码省略.........
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"
{
var l = new List<Catch> (2);
l.Add ((Catch) yyVals[0+yyTop]);
yyVal = l;
}
break;