本文整理汇总了C#中Mono.CSharp.SizeOf类的典型用法代码示例。如果您正苦于以下问题:C# SizeOf类的具体用法?C# SizeOf怎么用?C# SizeOf使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SizeOf类属于Mono.CSharp命名空间,在下文中一共展示了SizeOf类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Visit
public override object Visit(SizeOf sizeOfExpression)
{
var result = new SizeOfExpression();
var location = LocationsBag.GetLocations(sizeOfExpression);
result.AddChild(new CSharpTokenNode(Convert(sizeOfExpression.Location), SizeOfExpression.SizeofKeywordRole), SizeOfExpression.SizeofKeywordRole);
if (location != null)
result.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);
if (sizeOfExpression.TypeExpression != null)
result.AddChild(ConvertToType(sizeOfExpression.TypeExpression), Roles.Type);
if (location != null && location.Count > 1)
result.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);
return result;
}
示例2: Visit
public override object Visit (SizeOf sizeOfExpression)
{
var result = new SizeOfExpression ();
var location = LocationsBag.GetLocations (sizeOfExpression);
result.AddChild (new CSharpTokenNode (Convert (sizeOfExpression.Location), "sizeof".Length), TypeOfExpression.Roles.Keyword);
if (location != null)
result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), TypeOfExpression.Roles.LPar);
result.AddChild ((INode)sizeOfExpression.QueriedType.Accept (this), TypeOfExpression.Roles.ReturnType);
if (location != null)
result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), TypeOfExpression.Roles.RPar);
return result;
}
示例3: case_541
void case_541()
#line 3925 "cs-parser.jay"
{
yyVal = new SizeOf ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
}
示例4: case_542
void case_542()
#line 3930 "cs-parser.jay"
{
Error_SyntaxError (yyToken);
yyVal = new SizeOf ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));
}
示例5: Visit
public virtual object Visit (SizeOf sizeOfExpression)
{
return null;
}
示例6: yyparse
//.........这里部分代码省略.........
case 535:
#line 3694 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
MemberName name = (MemberName) yyVals[-3+yyTop];
yyVal = new MemberAccess (name.GetTypeExpression (), lt.Value, (int) yyVals[0+yyTop], lt.Location);
}
break;
case 536:
#line 3704 "cs-parser.jay"
{
if (RootContext.MetadataCompatibilityVersion < MetadataVersion.v2)
Report.FeatureIsNotSupported (GetLocation (yyVals[0+yyTop]), "generics");
else if (RootContext.Version < LanguageVersion.ISO_2)
Report.FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "generics");
yyVal = yyVals[0+yyTop];
}
break;
case 537:
#line 3716 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
if (RootContext.Version == LanguageVersion.ISO_1)
Report.FeatureIsNotAvailable (lt.Location, "namespace alias qualifier");
yyVal = lt;
}
break;
case 538:
#line 3726 "cs-parser.jay"
{
yyVal = new SizeOf ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));
}
break;
case 539:
#line 3733 "cs-parser.jay"
{
yyVal = new CheckedExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));
}
break;
case 540:
#line 3740 "cs-parser.jay"
{
yyVal = new UnCheckedExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));
}
break;
case 541:
#line 3747 "cs-parser.jay"
{
Expression deref;
var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
deref = new Indirection ((Expression) yyVals[-2+yyTop], lt.Location);
yyVal = new MemberAccess (deref, lt.Value);
}
break;
case 542:
#line 3758 "cs-parser.jay"
{
start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
}
break;
case 543:
#line 3762 "cs-parser.jay"
示例7: case_533
void case_533()
{
yyVal = new SizeOf ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
}
示例8: yyparse
//.........这里部分代码省略.........
case 552:
#line 4034 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
var te = ((MemberName) yyVals[-3+yyTop]).GetTypeExpression ();
if (te.HasTypeArguments)
Error_TypeExpected (GetLocation (yyVals[0+yyTop]));
var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
yyVal = new MemberAccess (te, lt.Value, (int) yyVals[0+yyTop], lt.Location);
}
break;
case 553:
#line 4046 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
if (lang_version < LanguageVersion.ISO_2)
FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "generics");
yyVal = yyVals[0+yyTop];
}
break;
case 554:
#line 4056 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
if (lang_version == LanguageVersion.ISO_1)
FeatureIsNotAvailable (lt.Location, "namespace alias qualifier");
yyVal = lt;
}
break;
case 555:
#line 4067 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new SizeOf ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
}
break;
case 556:
#line 4075 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new CheckedExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
}
break;
case 557:
#line 4083 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new UnCheckedExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
}
break;
case 558:
#line 4091 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
yyVal = new MemberAccess (new Indirection ((Expression) yyVals[-3+yyTop], GetLocation (yyVals[-2+yyTop])), lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location);
}
break;
case 559:
#line 4099 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], false, GetLocation (yyVals[-1+yyTop]));
}
break;
case 560:
#line 4103 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
示例9: case_539
void case_539()
#line 3684 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
yyVal = new SizeOf ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
}