本文整理汇总了C#中Mono.CSharp.This类的典型用法代码示例。如果您正苦于以下问题:C# This类的具体用法?C# This怎么用?C# This使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
This类属于Mono.CSharp命名空间,在下文中一共展示了This类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: yyparse
//.........这里部分代码省略.........
case 479:
case_479();
break;
case 481:
case_481();
break;
case 482:
case_482();
break;
case 483:
case_483();
break;
case 484:
case_484();
break;
case 485:
case_485();
break;
case 486:
case_486();
break;
case 487:
case_487();
break;
case 488:
#line 3569 "cs-parser.jay"
{
yyVal = new Argument ((Expression) yyVals[0+yyTop]);
}
break;
case 490:
#line 3577 "cs-parser.jay"
{
yyVal = new This (GetLocation (yyVals[0+yyTop]));
}
break;
case 491:
case_491();
break;
case 492:
case_492();
break;
case 493:
#line 3597 "cs-parser.jay"
{
yyVal = new UnaryMutator (UnaryMutator.Mode.PostIncrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop]));
}
break;
case 494:
#line 3604 "cs-parser.jay"
{
yyVal = new UnaryMutator (UnaryMutator.Mode.PostDecrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop]));
}
break;
case 495:
case_495();
break;
case 496:
case_496();
break;
case 497:
case_497();
break;
case 498:
case_498();
break;
开发者ID:segaman,项目名称:NRefactory,代码行数:67,代码来源:cs-parser.cs
示例2: Visit
public override object Visit (This thisExpression)
{
var result = new ThisReferenceExpression ();
result.Location = Convert (thisExpression.Location);
return result;
}
开发者ID:pgoron,项目名称:monodevelop,代码行数:6,代码来源:CSharpParser.cs
示例3: yyparse
//.........这里部分代码省略.........
case 479:
case_479();
break;
case 480:
case_480();
break;
case 482:
case_482();
break;
case 483:
case_483();
break;
case 484:
case_484();
break;
case 485:
case_485();
break;
case 486:
case_486();
break;
case 487:
case_487();
break;
case 488:
#line 3371 "cs-parser.jay"
{
yyVal = new Argument ((Expression) yyVals[0+yyTop]);
}
break;
case 490:
#line 3379 "cs-parser.jay"
{
yyVal = new This (GetLocation (yyVals[0+yyTop]));
}
break;
case 491:
case_491();
break;
case 492:
case_492();
break;
case 493:
#line 3399 "cs-parser.jay"
{
yyVal = new UnaryMutator (UnaryMutator.Mode.PostIncrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop]));
}
break;
case 494:
#line 3406 "cs-parser.jay"
{
yyVal = new UnaryMutator (UnaryMutator.Mode.PostDecrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop]));
}
break;
case 495:
case_495();
break;
case 496:
case_496();
break;
case 497:
case_497();
break;
case 498:
case_498();
break;
开发者ID:Ein,项目名称:monodevelop,代码行数:67,代码来源:cs-parser.cs
示例4: Visit
public virtual object Visit (This thisExpression)
{
return null;
}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:4,代码来源:visit.cs
示例5: EmitFieldInitializers
//
// Emits the instance field initializers
//
public bool EmitFieldInitializers (EmitContext ec)
{
ArrayList fields;
ILGenerator ig = ec.ig;
Expression instance_expr;
if (ec.IsStatic){
fields = initialized_static_fields;
instance_expr = null;
} else {
fields = initialized_fields;
instance_expr = new This (Location.Null).Resolve (ec);
}
if (fields == null)
return true;
foreach (Field f in fields){
Expression e = f.GetInitializerExpression (ec);
if (e == null)
return false;
Location l = f.Location;
FieldExpr fe = new FieldExpr (f.FieldBuilder, l);
fe.InstanceExpression = instance_expr;
Expression a = new Assign (fe, e, l);
a = a.Resolve (ec);
if (a == null)
return false;
if (a is ExpressionStatement)
((ExpressionStatement) a).EmitStatement (ec);
else {
throw new Exception ("Assign.Resolve returned a non ExpressionStatement");
}
}
return true;
}
开发者ID:emtees,项目名称:old-code,代码行数:43,代码来源:class.cs
示例6: yyparse
//.........这里部分代码省略.........
break;
case 186:
#line 1524 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop];
Report.Error (1552, lt.Location, "Array type specifier, [], must appear before parameter name");
yyVal = new Parameter ((FullNamedExpression) yyVals[-3+yyTop], lt.Value, (Parameter.Modifier) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop], lt.Location);
}
break;
case 187:
#line 1533 "cs-parser.jay"
{
Location l = GetLocation (yyVals[0+yyTop]);
CheckIdentifierToken (yyToken, l);
yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], "NeedSomeGeneratorHere", (Parameter.Modifier) yyVals[-2+yyTop], (Attributes) yyVals[-3+yyTop], l);
}
break;
case 188:
#line 1544 "cs-parser.jay"
{
if (RootContext.Version <= LanguageVersion.V_3) {
Report.FeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), "optional parameter");
}
Parameter.Modifier mod = (Parameter.Modifier) yyVals[-4+yyTop];
if (mod != Parameter.Modifier.NONE) {
switch (mod) {
case Parameter.Modifier.REF:
case Parameter.Modifier.OUT:
Report.Error (1741, GetLocation (yyVals[-4+yyTop]), "Cannot specify a default value for the `{0}' parameter",
Parameter.GetModifierSignature (mod));
break;
case Parameter.Modifier.This:
Report.Error (1743, GetLocation (yyVals[-4+yyTop]), "Cannot specify a default value for the `{0}' parameter",
Parameter.GetModifierSignature (mod));
break;
default:
throw new NotImplementedException (mod.ToString ());
}
mod = Parameter.Modifier.NONE;
}
if ((valid_param_mod & ParameterModifierType.DefaultValue) == 0)
Report.Error (1065, GetLocation (yyVals[0+yyTop]), "Optional parameter is not valid in this context");
var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop];
yyVal = new Parameter ((FullNamedExpression) yyVals[-3+yyTop], lt.Value, mod, (Attributes) yyVals[-5+yyTop], lt.Location);
if (yyVals[0+yyTop] != null)
((Parameter) yyVal).DefaultValue = (Expression) yyVals[0+yyTop];
}
break;
case 189:
#line 1580 "cs-parser.jay"
{ yyVal = Parameter.Modifier.NONE; }
break;
case 191:
#line 1586 "cs-parser.jay"
{
yyVal = yyVals[0+yyTop];
}
break;
case 192:
#line 1590 "cs-parser.jay"
{
开发者ID:speier,项目名称:shake,代码行数:67,代码来源:cs-parser.cs
示例7: GetThis
// TODO: Merge with CompilerGeneratedThis
public Expression GetThis (Location loc)
{
This my_this = new This (loc);
my_this.ResolveBase (this);
return my_this;
}
开发者ID:Ein,项目名称:monodevelop,代码行数:7,代码来源:context.cs
示例8: GetThis
// TODO: Merge with CompilerGeneratedThis
public Expression GetThis(Location loc)
{
This my_this;
if (CurrentBlock != null)
my_this = new This (CurrentBlock, loc);
else
my_this = new This (loc);
if (!my_this.ResolveBase (this))
my_this = null;
return my_this;
}
开发者ID:speier,项目名称:shake,代码行数:14,代码来源:context.cs
示例9: yyparse
//.........这里部分代码省略.........
lexer.ConstraintsParsing = true;
}
break;
case 175:
#line 1556 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
lexer.ConstraintsParsing = false;
valid_param_mod = 0;
MemberName name = (MemberName) yyVals[-6+yyTop];
current_local_parameters = (ParametersCompiled) yyVals[-3+yyTop];
GenericMethod generic = null;
if (name.TypeArguments != null) {
generic = new GenericMethod (current_namespace, current_class, name,
(FullNamedExpression) yyVals[-7+yyTop], current_local_parameters);
generic.SetParameterInfo ((List<Constraints>) yyVals[0+yyTop]);
} else if (yyVals[0+yyTop] != null) {
report.Error (80, GetLocation (yyVals[0+yyTop]),
"Constraints are not allowed on non-generic declarations");
}
var modifiers = (Modifiers) yyVals[-8+yyTop];
if((Modifiers.INTERACTION & modifiers) != 0){
modifiers = (modifiers ^ Modifiers.INTERACTION) | Modifiers.PUBLIC;
isInteraction = true;
} else {
isInteraction = false;
}
var method = Method.Create (current_class, generic, (FullNamedExpression) yyVals[-7+yyTop], modifiers,
name, current_local_parameters, (Attributes) yyVals[-9+yyTop], yyVals[0+yyTop] != null);
if(current_container.Kind == MemberKind.Interface && current_extensionContainer != null){
var parameters = new List<Parameter>();
var typeExpression = new TypeExpression (compiler.BuiltinTypes.Object, GetLocation (yyVals[-9+yyTop]));
var parameter = new Parameter(typeExpression, "self", Parameter.Modifier.This, null, GetLocation(yyVals[-9+yyTop]));
parameters.Add(parameter);
parameters.Add(new Parameter(typeExpression, "ctx", Parameter.Modifier.NONE, null, GetLocation(yyVals[-9+yyTop])));
var clone = current_local_parameters.Clone();
for(var i = 0; i < clone.Count; i++){
parameters.Add(clone[i]);
}
var parameterTypeExpressions = parameters.Select(p=>p.TypeExpression).ToList();
var key = current_namespace.NS.Name + "," + name.Name + "," + string.Join(",",parameterTypeExpressions.Select(p => p.ToString()));
if(roleExtensionMethodDummies.Add(key)){
var returnType = (FullNamedExpression) yyVals[-7+yyTop];
var parametersCompiled = new ParametersCompiled(parameters.ToArray(),false);
var dummy = Method.Create (current_extensionContainer, generic, (FullNamedExpression) yyVals[-7+yyTop], Modifiers.PUBLIC | Modifiers.STATIC,
name, parametersCompiled, (Attributes) yyVals[-9+yyTop], yyVals[0+yyTop] != null);
var location = GetLocation(yyVals[-9+yyTop]);
var parameterName = new SimpleName("self", null, location);
var getTypeAccess = new MemberAccess(parameterName, "GetType", null, location);
var getTypeExpression = new Invocation(getTypeAccess, new Arguments(0));
var argCount = parameterTypeExpressions.Count-1;
var argumentsForGetMethod = new Arguments(2);
var stringLiteral = new StringLiteral(compiler.BuiltinTypes,name.Name,location);
argumentsForGetMethod.Add(new Argument(stringLiteral));
var typeName = new SimpleName("Type", null, location);
var types = parameterTypeExpressions.Skip(2)
.Select(t =>(Expression)(t.Type != null
? new TypeOf(t.Type,location)
: new TypeOf(t,location))
).ToList();
var initializer = new ArrayInitializer(types,location);
var parameterTypes = new ImplicitlyTypedArrayCreation (
new ComposedTypeSpecifier (1, location),
initializer,
开发者ID:runefs,项目名称:Marvin,代码行数:67,代码来源:cs-parser.cs
示例10: HoistedThis
public HoistedThis (AnonymousMethodStorey storey, This this_reference)
: base (storey, "<>f__this", this_reference.Type)
{
this.this_reference = this_reference;
}
开发者ID:lewurm,项目名称:benchmarker,代码行数:5,代码来源:anonymous.cs
示例11: CaptureThis
public HoistedThis CaptureThis (EmitContext ec, This t)
{
hoisted_this = new HoistedThis (this, t);
return hoisted_this;
}
开发者ID:lewurm,项目名称:benchmarker,代码行数:5,代码来源:anonymous.cs
注:本文中的Mono.CSharp.This类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论