本文整理汇总了C#中Mono.CSharp.Unsafe类的典型用法代码示例。如果您正苦于以下问题:C# Unsafe类的具体用法?C# Unsafe怎么用?C# Unsafe使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Unsafe类属于Mono.CSharp命名空间,在下文中一共展示了Unsafe类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Visit
public override object Visit(Unsafe unsafeStatement)
{
var result = new UnsafeStatement();
result.AddChild(new CSharpTokenNode(Convert(unsafeStatement.loc), UnsafeStatement.UnsafeKeywordRole), UnsafeStatement.UnsafeKeywordRole);
if (unsafeStatement.Block != null)
result.AddChild((BlockStatement)unsafeStatement.Block.Accept(this), Roles.Body);
return result;
}
示例2: Visit
public override object Visit (Unsafe unsafeStatement)
{
var result = new UnsafeStatement ();
result.AddChild (new CSharpTokenNode (Convert (unsafeStatement.loc), "unsafe".Length), UnsafeStatement.Roles.Keyword);
result.AddChild ((INode)unsafeStatement.Block.Accept (this), UnsafeStatement.Roles.Body);
return result;
}
示例3: yyparse
//.........这里部分代码省略.........
case 920:
case_920();
break;
case 921:
#line 6150 "cs-parser.jay"
{
yyVal = yyVals[-1+yyTop];
}
break;
case 922:
case_922();
break;
case 923:
case_923();
break;
case 924:
#line 6191 "cs-parser.jay"
{
yyVal = new Checked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
}
break;
case 925:
#line 6198 "cs-parser.jay"
{
yyVal = new Unchecked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
}
break;
case 926:
case_926();
break;
case 927:
#line 6208 "cs-parser.jay"
{
yyVal = new Unsafe ((Block) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]));
}
break;
case 928:
case_928();
break;
case 929:
case_929();
break;
case 930:
case_930();
break;
case 931:
case_931();
break;
case 932:
case_932();
break;
case 933:
case_933();
break;
case 934:
case_934();
break;
case 935:
case_935();
break;
case 936:
case_936();
break;
case 937:
case_937();
break;
示例4: Visit
public virtual object Visit (Unsafe unsafeStatement)
{
return null;
}
示例5: yyparse
//.........这里部分代码省略.........
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;
case 839:
case_839();
break;
case 840:
#line 5356 "cs-parser.jay"
{
yyVal = new Checked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
}
break;
case 841:
#line 5363 "cs-parser.jay"
{
yyVal = new Unchecked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
}
break;
case 842:
case_842();
break;
case 843:
#line 5373 "cs-parser.jay"
{
yyVal = new Unsafe ((Block) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]));
}
break;
case 844:
case_844();
break;
case 845:
case_845();
break;
case 846:
case_846();
break;
case 847:
case_847();
break;
case 848:
case_848();
break;
case 849:
case_849();
break;
case 850:
case_850();
break;
case 851:
case_851();
break;
case 852:
#line 5455 "cs-parser.jay"
{
Report.Error (210, lexer.Location, "You must provide an initializer in a fixed or using statement declaration");
}
break;
示例6: yyparse
//.........这里部分代码省略.........
break;
case 811:
#line 5240 "cs-parser.jay"
{ yyVal = null; }
break;
case 813:
#line 5246 "cs-parser.jay"
{
yyVal = new Tuple<FullNamedExpression, Tokenizer.LocatedToken> ((FullNamedExpression)yyVals[-2+yyTop], (Tokenizer.LocatedToken) yyVals[-1+yyTop]);
}
break;
case 814:
#line 5250 "cs-parser.jay"
{
Report.Error (1015, GetLocation (yyVals[-1+yyTop]), "A type that derives from `System.Exception', `object', or `string' expected");
yyVal = null;
}
break;
case 815:
#line 5258 "cs-parser.jay"
{
yyVal = new Checked ((Block) yyVals[0+yyTop]);
}
break;
case 816:
#line 5265 "cs-parser.jay"
{
yyVal = new Unchecked ((Block) yyVals[0+yyTop]);
}
break;
case 817:
#line 5272 "cs-parser.jay"
{
RootContext.CheckUnsafeOption (GetLocation (yyVals[0+yyTop]), Report);
}
break;
case 818:
#line 5274 "cs-parser.jay"
{
yyVal = new Unsafe ((Block) yyVals[0+yyTop]);
}
break;
case 819:
#line 5283 "cs-parser.jay"
{
start_block (lexer.Location);
}
break;
case 820:
#line 5287 "cs-parser.jay"
{
Expression type = (Expression) yyVals[-4+yyTop];
var list = (List<KeyValuePair<Tokenizer.LocatedToken, Expression>>) yyVals[-3+yyTop];
Fixed f = new Fixed (type,
list.ConvertAll (i => {
var v = new KeyValuePair<LocalInfo, Expression> (current_block.AddVariable (type, i.Key.Value, i.Key.Location), i.Value);
if (v.Key != null) {
v.Key.SetReadOnlyContext (LocalInfo.ReadOnlyContext.Fixed);
v.Key.Pinned = true;
}
return v;
}), (Statement) yyVals[0+yyTop], GetLocation (yyVals[-6+yyTop]));
current_block.AddStatement (f);
yyVal = end_block (lexer.Location);
示例7: yyparse
//.........这里部分代码省略.........
case 680:
#line 4753 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = Modifiers.VIRTUAL;
StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));
}
break;
case 681:
#line 4758 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = Modifiers.OVERRIDE;
StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));
}
break;
case 682:
#line 4763 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = Modifiers.EXTERN;
StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));
}
break;
case 683:
#line 4768 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = Modifiers.VOLATILE;
StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));
}
break;
case 684:
#line 4773 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = Modifiers.UNSAFE;
StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));
if (!settings.Unsafe)
Error_UnsafeCodeNotAllowed (GetLocation (yyVals[0+yyTop]));
}
break;
case 685:
#line 4780 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = Modifiers.ASYNC;
StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));
}
break;
case 687:
#line 4789 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
current_container.AddBasesForPart (current_class, (List<FullNamedExpression>) yyVals[0+yyTop]);
}
break;
case 689:
#line 4797 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = yyVals[0+yyTop];
}
break;
case 690:
#line 4801 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
Error_SyntaxError (yyToken);
yyVal = null;
}
break;
case 691:
#line 4809 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{