本文整理汇总了C#中Mono.CSharp.ElementAccess类的典型用法代码示例。如果您正苦于以下问题:C# ElementAccess类的具体用法?C# ElementAccess怎么用?C# ElementAccess使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ElementAccess类属于Mono.CSharp命名空间,在下文中一共展示了ElementAccess类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
示例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;
}
示例4: IndexerAccess
public IndexerAccess (ElementAccess ea, Location loc)
: this (ea.Expr, false, loc)
{
this.arguments = ea.Arguments;
}
示例5: ArrayAccess
public ArrayAccess (ElementAccess ea_data, Location l)
{
ea = ea_data;
loc = l;
}
示例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]));
}
示例7: case_492
void case_492()
#line 3587 "cs-parser.jay"
{
Error_SyntaxError (yyToken);
yyVal = new ElementAccess (null, null, GetLocation (yyVals[-1+yyTop]));
}
示例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]));
}
示例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]));
}
示例10: case_473
void case_473()
{
Error_SyntaxError (yyToken);
yyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
}
示例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]));
}
示例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"
{
示例13: ArrayAccess
public ArrayAccess (ElementAccess ea_data, Location l)
{
ea = ea_data;
eclass = ExprClass.Variable;
loc = l;
}
示例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;
示例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]));
}