本文整理汇总了C#中Mono.CSharp.ComposedCast类的典型用法代码示例。如果您正苦于以下问题:C# ComposedCast类的具体用法?C# ComposedCast怎么用?C# ComposedCast使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ComposedCast类属于Mono.CSharp命名空间,在下文中一共展示了ComposedCast类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: case_383
void case_383()
#line 2922 "cs-parser.jay"
{
MemberName name = (MemberName) yyVals[-1+yyTop];
if (yyVals[0+yyTop] != null) {
yyVal = new ComposedCast (name.GetTypeExpression (), (ComposedTypeSpecifier) yyVals[0+yyTop]);
} else {
if (name.Left == null && name.Name == "var")
yyVal = new VarExpr (name.Location);
else
yyVal = name.GetTypeExpression ();
}
}
开发者ID:Ein,项目名称:monodevelop,代码行数:14,代码来源:cs-parser.cs
示例2: case_381
void case_381()
#line 2898 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
MemberName name = (MemberName) yyVals[-1+yyTop];
if (yyVals[0+yyTop] != null) {
yyVal = new ComposedCast (name.GetTypeExpression (), (ComposedTypeSpecifier) yyVals[0+yyTop]);
} else {
if (name.Left == null && name.Name == "var")
yyVal = new VarExpr (name.Location);
else
yyVal = name.GetTypeExpression ();
}
}
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:14,代码来源:cs-parser.cs
示例3: yyparse
//.........这里部分代码省略.........
case 369:
case_369();
break;
case 370:
case_370();
break;
case 371:
case_371();
break;
case 373:
#line 2872 "cs-parser.jay"
{
yyVal = new TypeExpression (TypeManager.void_type, GetLocation (yyVals[0+yyTop]));
}
break;
case 374:
#line 2879 "cs-parser.jay"
{
lexer.parsing_generic_declaration = true;
}
break;
case 376:
case_376();
break;
case 378:
case_378();
break;
case 380:
case_380();
break;
case 382:
#line 2917 "cs-parser.jay"
{
yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
break;
case 383:
case_383();
break;
case 384:
#line 2937 "cs-parser.jay"
{
yyVal = new ComposedCast (((MemberName) yyVals[-1+yyTop]).GetTypeExpression (), (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
break;
case 385:
case_385();
break;
case 386:
#line 2946 "cs-parser.jay"
{
yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
break;
case 387:
#line 2950 "cs-parser.jay"
{
yyVal = new ComposedCast (new TypeExpression (TypeManager.void_type, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
break;
case 388:
case_388();
break;
case 389:
case_389();
break;
开发者ID:Ein,项目名称:monodevelop,代码行数:67,代码来源:cs-parser.cs
示例4: case_788
void case_788()
#line 5314 "cs-parser.jay"
{
ATypeNameExpression expr = yyVals[-1+yyTop] as ATypeNameExpression;
if (expr != null) {
yyVal = new ComposedCast (expr, (ComposedTypeSpecifier) yyVals[0+yyTop]);
} else {
Error_ExpectingTypeName ((Expression)yyVals[-1+yyTop]);
yyVal = expr;
}
}
开发者ID:segaman,项目名称:NRefactory,代码行数:12,代码来源:cs-parser.cs
示例5: Visit
public override object Visit(ComposedCast composedCast)
{
var result = new ComposedType();
result.AddChild(ConvertToType(composedCast.Left), Roles.Type);
var spec = composedCast.Spec;
while (spec != null) {
if (spec.IsNullable) {
result.AddChild(new CSharpTokenNode(Convert(spec.Location), ComposedType.NullableRole), ComposedType.NullableRole);
} else if (spec.IsPointer) {
result.AddChild(new CSharpTokenNode(Convert(spec.Location), ComposedType.PointerRole), ComposedType.PointerRole);
} else {
var aSpec = new ArraySpecifier();
aSpec.AddChild(new CSharpTokenNode(Convert(spec.Location), Roles.LBracket), Roles.LBracket);
var location = LocationsBag.GetLocations(spec);
if (location != null)
aSpec.AddChild(new CSharpTokenNode(Convert(spec.Location), Roles.RBracket), Roles.RBracket);
result.AddChild(aSpec, ComposedType.ArraySpecifierRole);
}
spec = spec.Next;
}
return result;
}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:24,代码来源:CSharpParser.cs
示例6: case_379
void case_379()
#line 3092 "cs-parser.jay"
{
if (yyVals[0+yyTop] != null) {
yyVal = new ComposedCast ((ATypeNameExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);
} else {
var sn = yyVals[-1+yyTop] as SimpleName;
if (sn != null && sn.Name == "var")
yyVal = new VarExpr (sn.Location);
else
yyVal = yyVals[-1+yyTop];
}
}
开发者ID:segaman,项目名称:NRefactory,代码行数:13,代码来源:cs-parser.cs
示例7: case_786
void case_786()
#line 5268 "cs-parser.jay"
{
if (yyVals[-1+yyTop] is VarExpr)
yyVals[-1+yyTop] = new SimpleName ("var", ((VarExpr) yyVals[-1+yyTop]).Location);
yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
开发者ID:segaman,项目名称:NRefactory,代码行数:8,代码来源:cs-parser.cs
示例8: case_374
void case_374()
{
if (yyVals[0+yyTop] != null)
yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
开发者ID:animaonline,项目名称:Portable-Mono.CSharp,代码行数:5,代码来源:cs-parser.cs
示例9: case_736
void case_736()
{
if (yyVals[-1+yyTop] is VarExpr)
yyVals[-1+yyTop] = new SimpleName ("var", ((VarExpr) yyVals[-1+yyTop]).Location);
yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
开发者ID:animaonline,项目名称:Portable-Mono.CSharp,代码行数:7,代码来源:cs-parser.cs
示例10: yyparse
//.........这里部分代码省略.........
yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop]));
}
break;
case 384:
#line 3213 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
lexer.parsing_generic_declaration = true;
}
break;
case 386:
#line 3224 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), report);
yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop]));
}
break;
case 388:
#line 3233 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), report);
yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop]));
}
break;
case 390:
#line 3242 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
report.Error (1536, GetLocation (yyVals[0+yyTop]), "Invalid parameter type `void'");
yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop]));
}
break;
case 392:
#line 3251 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
break;
case 393:
#line 3258 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
MemberName name = (MemberName) yyVals[-1+yyTop];
if (yyVals[0+yyTop] != null) {
yyVal = new ComposedCast (name.GetTypeExpression (), (ComposedTypeSpecifier) yyVals[0+yyTop]);
} else {
if (name.Left == null && name.Name == "var")
yyVal = new VarExpr (name.Location);
else
yyVal = name.GetTypeExpression ();
}
}
break;
case 394:
#line 3271 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new ComposedCast (((MemberName) yyVals[-1+yyTop]).GetTypeExpression (), (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
break;
case 395:
#line 3275 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
if (yyVals[0+yyTop] != null)
yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
break;
case 396:
#line 3280 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
开发者ID:runefs,项目名称:Marvin,代码行数:67,代码来源:cs-parser.cs
示例11: LookupType
//
// Creates the type of the array
//
bool LookupType (EmitContext ec)
{
StringBuilder array_qualifier = new StringBuilder (rank);
//
// `In the first form allocates an array instace of the type that results
// from deleting each of the individual expression from the expression list'
//
if (num_arguments > 0) {
array_qualifier.Append ("[");
for (int i = num_arguments-1; i > 0; i--)
array_qualifier.Append (",");
array_qualifier.Append ("]");
}
//
// Lookup the type
//
Expression array_type_expr;
array_type_expr = new ComposedCast (requested_base_type, array_qualifier.ToString (), loc);
type = ec.DeclSpace.ResolveType (array_type_expr, false, loc);
if (type == null)
return false;
underlying_type = type;
if (underlying_type.IsArray)
underlying_type = TypeManager.TypeToCoreType (underlying_type.GetElementType ());
dimensions = type.GetArrayRank ();
return true;
}
开发者ID:emtees,项目名称:old-code,代码行数:35,代码来源:expression.cs
示例12: case_734
void case_734()
#line 4693 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
if (yyVals[0+yyTop] == null)
yyVal = yyVals[-1+yyTop];
else
yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:8,代码来源:cs-parser.cs
示例13: case_733
void case_733()
#line 4682 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
ATypeNameExpression expr = yyVals[-1+yyTop] as ATypeNameExpression;
if (expr != null) {
yyVal = new ComposedCast (expr, (ComposedTypeSpecifier) yyVals[0+yyTop]);
} else {
Error_ExpectingTypeName ((Expression)yyVals[-1+yyTop]);
yyVal = expr;
}
}
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:12,代码来源:cs-parser.cs
示例14: case_731
void case_731()
#line 4636 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
if (yyVals[-1+yyTop] is VarExpr)
yyVals[-1+yyTop] = new SimpleName ("var", ((VarExpr) yyVals[-1+yyTop]).Location);
yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:8,代码来源:cs-parser.cs
示例15: Visit
public virtual object Visit (ComposedCast composedCast)
{
return null;
}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:4,代码来源:visit.cs
示例16: case_739
void case_739()
{
if (yyVals[0+yyTop] == null)
yyVal = yyVals[-1+yyTop];
else
yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
开发者ID:animaonline,项目名称:Portable-Mono.CSharp,代码行数:7,代码来源:cs-parser.cs
示例17: yyparse
//.........这里部分代码省略.........
case 365:
case_365();
break;
case 366:
case_366();
break;
case 367:
case_367();
break;
case 369:
#line 3042 "cs-parser.jay"
{
yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop]));
}
break;
case 370:
#line 3049 "cs-parser.jay"
{
lexer.parsing_generic_declaration = true;
}
break;
case 372:
case_372();
break;
case 374:
case_374();
break;
case 376:
case_376();
break;
case 378:
#line 3087 "cs-parser.jay"
{
yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
break;
case 379:
case_379();
break;
case 380:
#line 3106 "cs-parser.jay"
{
yyVal = new ComposedCast ((ATypeNameExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
break;
case 381:
case_381();
break;
case 382:
#line 3115 "cs-parser.jay"
{
yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
break;
case 383:
#line 3119 "cs-parser.jay"
{
yyVal = new ComposedCast (new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
break;
case 384:
case_384();
break;
case 385:
case_385();
break;
开发者ID:segaman,项目名称:NRefactory,代码行数:67,代码来源:cs-parser.cs
示例18: ResolveArrayType
//
// Resolved the type of the array
//
bool ResolveArrayType (ResolveContext ec)
{
if (requested_base_type == null) {
ec.Report.Error (622, loc, "Can only use array initializer expressions to assign to array types. Try using a new expression instead");
return false;
}
if (requested_base_type is VarExpr) {
ec.Report.Error (820, loc, "An implicitly typed local variable declarator cannot use an array initializer");
return false;
}
StringBuilder array_qualifier = new StringBuilder (rank);
//
// `In the first form allocates an array instace of the type that results
// from deleting each of the individual expression from the expression list'
//
if (num_arguments > 0) {
array_qualifier.Append ("[");
for (int i = num_arguments-1; i > 0; i--)
array_qualifier.Append (",");
array_qualifier.Append ("]");
}
//
// Lookup the type
//
TypeExpr array_type_expr;
array_type_expr = new ComposedCast (requested_base_type, array_qualifier.ToString (), loc);
array_type_expr = array_type_expr.ResolveAsTypeTerminal (ec, false);
if (array_type_expr == null)
return false;
type = array_type_expr.Type;
array_element_type = TypeManager.GetElementType (type);
dimensions = type.GetArrayRank ();
return true;
}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:43,代码来源:expression.cs
示例19: case_381
void case_381()
#line 3108 "cs-parser.jay"
{
if (yyVals[0+yyTop] != null)
yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);
}
开发者ID:segaman,项目名称:NRefactory,代码行数:6,代码来源:cs-parser.cs
示例20: DoResolveAsTypeStep
protected override TypeExpr DoResolveAsTypeStep (IMemberContext ec)
{
TypeExpr lexpr = left.ResolveAsTypeTerminal (ec, false);
if (lexpr == null)
return null;
Type ltype = lexpr.Type;
if ((dim.Length > 0) && (dim [0] == '?')) {
TypeExpr nullable = new Nullable.NullableType (lexpr, loc);
if (dim.Length > 1)
nullable = new ComposedCast (nullable, dim.Substring (1), loc);
return nullable.ResolveAsTypeTerminal (ec, false);
}
if (dim == "*" && !TypeManager.VerifyUnManaged (ltype, loc))
return null;
if (dim.Length != 0 && dim [0] == '[') {
if (TypeManager.IsSpecialType (ltype)) {
ec.Compiler.Report.Error (611, loc, "Array elements cannot be of type `{0}'", TypeManager.CSharpName (ltype));
return null;
}
if ((ltype.Attributes & Class.StaticClassAttribute) == Class.StaticClassAttribute) {
ec.Compiler.Report.SymbolRelatedToPreviousError (ltype);
ec.Compiler.Report.Error (719, loc, "Array elements cannot be of static type `{0}'",
TypeManager.CSharpName (ltype));
}
}
if (dim != "")
type = TypeManager.GetConstructedType (ltype, dim);
else
type = ltype;
if (type == null)
throw new InternalErrorException ("Couldn't create computed type " + ltype + dim);
if (type.IsPointer && !ec.IsUnsafe){
UnsafeError (ec.Compiler.Report, loc);
}
eclass = ExprClass.Type;
return this;
}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:45,代码来源:expression.cs
注:本文中的Mono.CSharp.ComposedCast类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论