本文整理汇总了C#中Mono.CSharp.ElementAccess类的典型用法代码示例。如果您正苦于以下问题:C# ElementAccess类的具体用法?C# ElementAccess怎么用?C# ElementAccess使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ElementAccess类属于Mono.CSharp命名空间,在下文中一共展示了ElementAccess类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: FallbackSetIndex
public override DynamicMetaObject FallbackSetIndex (DynamicMetaObject target, DynamicMetaObject[] indexes, DynamicMetaObject value, DynamicMetaObject errorSuggestion)
{
if (argumentInfo.Count != indexes.Length + 2) {
if (errorSuggestion == null)
throw new NotImplementedException ();
return errorSuggestion;
}
var ctx = DynamicContext.Create ();
var expr = ctx.CreateCompilerExpression (argumentInfo [0], target);
var args = ctx.CreateCompilerArguments (argumentInfo.Skip (1), indexes);
expr = new Compiler.ElementAccess (expr, args, Compiler.Location.Null);
var source = ctx.CreateCompilerExpression (argumentInfo [indexes.Length + 1], value);
// Same conversion as in SetMemberBinder
if ((flags & CSharpBinderFlags.ValueFromCompoundAssignment) != 0) {
expr = new Compiler.RuntimeExplicitAssign (expr, source);
} else {
expr = new Compiler.SimpleAssign (expr, source);
}
expr = new Compiler.Cast (new Compiler.TypeExpression (ctx.ImportType (ReturnType), Compiler.Location.Null), expr, Compiler.Location.Null);
if ((flags & CSharpBinderFlags.CheckedContext) != 0)
expr = new Compiler.CheckedExpr (expr, Compiler.Location.Null);
var binder = new CSharpBinder (this, expr, errorSuggestion);
binder.AddRestrictions (target);
binder.AddRestrictions (value);
binder.AddRestrictions (indexes);
return binder.Bind (ctx, callingContext);
}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:34,代码来源:CSharpSetIndexBinder.cs
示例2: FallbackGetIndex
public override DynamicMetaObject FallbackGetIndex (DynamicMetaObject target, DynamicMetaObject[] indexes, DynamicMetaObject errorSuggestion)
{
if (argumentInfo.Count != indexes.Length + 1) {
if (errorSuggestion == null)
throw new NotImplementedException ();
return errorSuggestion;
}
var expr = CSharpBinder.CreateCompilerExpression (argumentInfo [0], target);
var args = CSharpBinder.CreateCompilerArguments (argumentInfo.Skip (1), indexes);
expr = new Compiler.ElementAccess (expr, args, Compiler.Location.Null);
expr = new Compiler.Cast (new Compiler.TypeExpression (TypeImporter.Import (ReturnType), Compiler.Location.Null), expr, Compiler.Location.Null);
var binder = new CSharpBinder (this, expr, errorSuggestion);
binder.AddRestrictions (target);
binder.AddRestrictions (indexes);
return binder.Bind (callingContext, target);
}
开发者ID:afaerber,项目名称:mono,代码行数:20,代码来源:CSharpGetIndexBinder.cs
示例3: yyparse
//.........这里部分代码省略.........
case 466:
#line 3267 "cs-parser.jay"
{
yyVal = new Argument ((Expression) yyVals[0+yyTop], Argument.AType.Ref);
}
break;
case 467:
#line 3271 "cs-parser.jay"
{
yyVal = new Argument ((Expression) yyVals[0+yyTop], Argument.AType.Out);
}
break;
case 468:
#line 3275 "cs-parser.jay"
{
yyVal = new Argument (new Arglist ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])));
}
break;
case 469:
#line 3279 "cs-parser.jay"
{
yyVal = new Argument (new Arglist (GetLocation (yyVals[-2+yyTop])));
}
break;
case 470:
#line 3283 "cs-parser.jay"
{
yyVal = new Argument (new ArglistAccess (GetLocation (yyVals[0+yyTop])));
}
break;
case 472:
#line 3294 "cs-parser.jay"
{
yyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop]);
}
break;
case 473:
#line 3298 "cs-parser.jay"
{
/* LAMESPEC: Not allowed according to specification*/
yyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop]);
}
break;
case 474:
#line 3303 "cs-parser.jay"
{
/* So the super-trick is that primary_expression*/
/* can only be either a SimpleName or a MemberAccess. */
/* The MemberAccess case arises when you have a fully qualified type-name like :*/
/* Foo.Bar.Blah i;*/
/* SimpleName is when you have*/
/* Blah i;*/
Expression expr = (Expression) yyVals[-1+yyTop];
if (expr is ComposedCast){
yyVal = new ComposedCast ((ComposedCast)expr, (string) yyVals[0+yyTop]);
} else if (expr is ATypeNameExpression){
/**/
/* So we extract the string corresponding to the SimpleName*/
/* or MemberAccess*/
/* */
yyVal = new ComposedCast ((ATypeNameExpression)expr, (string) yyVals[0+yyTop]);
} else {
Error_ExpectingTypeName (expr);
yyVal = TypeManager.system_object_expr;
}
开发者ID:speier,项目名称:shake,代码行数:67,代码来源:cs-parser.cs
示例4: IndexerAccess
public IndexerAccess (ElementAccess ea, Location loc)
: this (ea.Expr, false, loc)
{
this.arguments = ea.Arguments;
}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:5,代码来源:expression.cs
示例5: ArrayAccess
public ArrayAccess (ElementAccess ea_data, Location l)
{
ea = ea_data;
loc = l;
}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:5,代码来源:expression.cs
示例6: case_489
void case_489()
#line 3356 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
yyVal = new ElementAccess (new BaseThis (GetLocation (yyVals[-3+yyTop])), (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));
}
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:6,代码来源:cs-parser.cs
示例7: case_492
void case_492()
#line 3587 "cs-parser.jay"
{
Error_SyntaxError (yyToken);
yyVal = new ElementAccess (null, null, GetLocation (yyVals[-1+yyTop]));
}
开发者ID:segaman,项目名称:NRefactory,代码行数:6,代码来源:cs-parser.cs
示例8: case_483
void case_483()
#line 3524 "cs-parser.jay"
{
Error_SyntaxError (yyToken);
yyVal = new ElementAccess ((Expression) yyVals[-2+yyTop], null, GetLocation (yyVals[-1+yyTop]));
}
开发者ID:segaman,项目名称:NRefactory,代码行数:6,代码来源:cs-parser.cs
示例9: case_481
void case_481()
#line 3514 "cs-parser.jay"
{
yyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));
}
开发者ID:segaman,项目名称:NRefactory,代码行数:6,代码来源:cs-parser.cs
示例10: case_473
void case_473()
{
Error_SyntaxError (yyToken);
yyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
}
开发者ID:animaonline,项目名称:Portable-Mono.CSharp,代码行数:5,代码来源:cs-parser.cs
示例11: case_472
void case_472()
{
yyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));
}
开发者ID:animaonline,项目名称:Portable-Mono.CSharp,代码行数:5,代码来源:cs-parser.cs
示例12: yyparse
//.........这里部分代码省略.........
case 450:
case_450();
break;
case 451:
case_451();
break;
case 452:
case_452();
break;
case 453:
#line 3311 "cs-parser.jay"
{
yyVal = new Argument ((Expression) yyVals[0+yyTop]);
}
break;
case 457:
case_457();
break;
case 458:
case_458();
break;
case 459:
case_459();
break;
case 460:
case_460();
break;
case 462:
case_462();
break;
case 463:
#line 3356 "cs-parser.jay"
{
yyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
}
break;
case 464:
#line 3360 "cs-parser.jay"
{
yyVal = new ElementAccess ((Expression) yyVals[-2+yyTop], null, GetLocation (yyVals[-1+yyTop]));
}
break;
case 465:
case_465();
break;
case 466:
case_466();
break;
case 467:
case_467();
break;
case 468:
case_468();
break;
case 469:
case_469();
break;
case 470:
#line 3406 "cs-parser.jay"
{
yyVal = new Argument ((Expression) yyVals[0+yyTop]);
}
break;
case 472:
#line 3414 "cs-parser.jay"
{
开发者ID:nylen,项目名称:SharpDevelop,代码行数:67,代码来源:cs-parser.cs
示例13: ArrayAccess
public ArrayAccess (ElementAccess ea_data, Location l)
{
ea = ea_data;
eclass = ExprClass.Variable;
loc = l;
}
开发者ID:emtees,项目名称:old-code,代码行数:6,代码来源:expression.cs
示例14: yyparse
//.........这里部分代码省略.........
}
break;
case 491:
#line 3648 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new Argument ((Expression) yyVals[0+yyTop], Argument.AType.Ref);
lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));
}
break;
case 492:
#line 3653 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new Argument ((Expression) yyVals[0+yyTop], Argument.AType.Out);
lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));
}
break;
case 493:
#line 3658 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new Argument (new Arglist ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])));
lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
}
break;
case 494:
#line 3663 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new Argument (new Arglist (GetLocation (yyVals[-2+yyTop])));
lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));
}
break;
case 496:
#line 3675 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));
}
break;
case 497:
#line 3683 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
var list = new List<Expression> (4);
list.Add ((Expression) yyVals[0+yyTop]);
yyVal = list;
}
break;
case 498:
#line 3689 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
var list = (List<Expression>) yyVals[-2+yyTop];
list.Add ((Expression) yyVals[0+yyTop]);
yyVal = list;
}
break;
case 499:
#line 3694 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
Error_SyntaxError (yyToken);
yyVal = yyVals[-1+yyTop];
}
break;
case 500:
#line 3702 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
Arguments args = new Arguments (4);
args.Add ((Argument) yyVals[0+yyTop]);
yyVal = args;
开发者ID:runefs,项目名称:Marvin,代码行数:67,代码来源:cs-parser.cs
示例15: case_490
void case_490()
#line 3361 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
Error_SyntaxError (yyToken);
yyVal = new ElementAccess (null, null, GetLocation (yyVals[-1+yyTop]));
}
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:6,代码来源:cs-parser.cs
示例16: DoEmitStringSwitch
void DoEmitStringSwitch (LocalTemporary value, EmitContext ec)
{
Label l_initialized = ec.DefineLabel ();
//
// Skip initialization when value is null
//
value.EmitBranchable (ec, null_target, false);
//
// Check if string dictionary is initialized and initialize
//
switch_cache_field.EmitBranchable (ec, l_initialized, true);
string_dictionary.EmitStatement (ec);
ec.MarkLabel (l_initialized);
LocalTemporary string_switch_variable = new LocalTemporary (TypeManager.int32_type);
ResolveContext rc = new ResolveContext (ec.MemberContext);
if (TypeManager.generic_ienumerable_type != null) {
Arguments get_value_args = new Arguments (2);
get_value_args.Add (new Argument (value));
get_value_args.Add (new Argument (string_switch_variable, Argument.AType.Out));
Expression get_item = new Invocation (new MemberAccess (switch_cache_field, "TryGetValue", loc), get_value_args).Resolve (rc);
if (get_item == null)
return;
//
// A value was not found, go to default case
//
get_item.EmitBranchable (ec, default_target, false);
} else {
Arguments get_value_args = new Arguments (1);
get_value_args.Add (new Argument (value));
Expression get_item = new ElementAccess (switch_cache_field, get_value_args, loc).Resolve (rc);
if (get_item == null)
return;
LocalTemporary get_item_object = new LocalTemporary (TypeManager.object_type);
get_item_object.EmitAssign (ec, get_item, true, false);
ec.Emit (OpCodes.Brfalse, default_target);
ExpressionStatement get_item_int = (ExpressionStatement) new SimpleAssign (string_switch_variable,
new Cast (new TypeExpression (TypeManager.int32_type, loc), get_item_object, loc)).Resolve (rc);
get_item_int.EmitStatement (ec);
get_item_object.Release (ec);
}
TableSwitchEmit (ec, string_switch_variable);
string_switch_variable.Release (ec);
}
开发者ID:alisci01,项目名称:mono,代码行数:54,代码来源:statement.cs
示例17: Visit
public virtual object Visit (ElementAccess elementAccessExpression)
{
return null;
}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:4,代码来源:visit.cs
示例18: case_474
void case_474()
{
Error_SyntaxError (yyToken);
yyVal = new ElementAccess ((Expression) yyVals[-2+yyTop], null, GetLocation (yyVals[-1+yyTop]));
}
开发者ID:animaonline,项目名称:Portable-Mono.CSharp,代码行数:5,代码来源:cs-parser.cs
示例19: case_482
void case_482()
#line 3519 "cs-parser.jay"
{
Error_SyntaxError (yyToken);
yyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
}
开发者ID:segaman,项目名称:NRefactory,代码行数:6,代码来源:cs-parser.cs
示例20: case_483
void case_483()
{
yyVal = new ElementAccess (new BaseThis (GetLocation (yyVals[-3+yyTop])), (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));
}
开发者ID:animaonline,项目名称:Portable-Mono.CSharp,代码行数:5,代码来源:cs-parser.cs
注:本文中的Mono.CSharp.ElementAccess类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论