• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TypeOfExpression类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TypeOfExpression的典型用法代码示例。如果您正苦于以下问题:C# TypeOfExpression类的具体用法?C# TypeOfExpression怎么用?C# TypeOfExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TypeOfExpression类属于命名空间,在下文中一共展示了TypeOfExpression类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: VisitTypeOfExpression

		public sealed override object VisitTypeOfExpression(TypeOfExpression typeOfExpression, object data) {
			BeginVisit(typeOfExpression);
			object result = TrackedVisitTypeOfExpression(typeOfExpression, data);
			EndVisit(typeOfExpression);
			return result;
		}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:6,代码来源:NodeTrackingAstVisitor.cs


示例2: Visit

			public override object Visit(TypeOf typeOfExpression)
			{
				var result = new TypeOfExpression();
				var location = LocationsBag.GetLocations(typeOfExpression);
				result.AddChild(new CSharpTokenNode(Convert(typeOfExpression.Location), TypeOfExpression.TypeofKeywordRole), TypeOfExpression.TypeofKeywordRole);
				if (location != null)
					result.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);
				if (typeOfExpression.TypeExpression != null)
					result.AddChild(ConvertToType(typeOfExpression.TypeExpression), Roles.Type);
				if (location != null && location.Count > 1)
					result.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);
				return result;
			}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:13,代码来源:CSharpParser.cs


示例3: Visit

			public override object Visit (TypeOf typeOfExpression)
			{
				var result = new TypeOfExpression ();
				var location = LocationsBag.GetLocations (typeOfExpression);
				result.AddChild (new CSharpTokenNode (Convert (typeOfExpression.Location), "typeof".Length), TypeOfExpression.Roles.Keyword);
				result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), TypeOfExpression.Roles.LPar);
				result.AddChild ((INode)typeOfExpression.TypeExpression.Accept (this), TypeOfExpression.Roles.ReturnType);
				result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), TypeOfExpression.Roles.RPar);
				return result;
			}
开发者ID:pgoron,项目名称:monodevelop,代码行数:10,代码来源:CSharpParser.cs


示例4: GetTypeOfTooltip

		public TooltipInformation GetTypeOfTooltip (TypeOfExpression typeOfExpression, TypeOfResolveResult resolveResult)
		{
			var result = new TooltipInformation ();
			if (resolveResult == null) {
				result.SignatureMarkup = AmbienceService.EscapeText (typeOfExpression.Type.ToString ());
			} else {
				result.SignatureMarkup = GetTypeMarkup (resolveResult.ReferencedType, true);
			}
			return result;
		}
开发者ID:Chertolom,项目名称:monodevelop,代码行数:10,代码来源:SignatureMarkupCreator.cs


示例5: VisitTypeOfExpression

 public virtual void VisitTypeOfExpression(TypeOfExpression typeOfExpression)
 {
     if (this.ThrowException)
     {
         throw (Exception)this.CreateException(typeOfExpression);
     }
 }
开发者ID:fabriciomurta,项目名称:BridgeUnified,代码行数:7,代码来源:Visitor.Exception.cs


示例6: VisitTypeOfExpression

 public override void VisitTypeOfExpression(TypeOfExpression typeOfExpression)
 {
     new TypeofBlock(this, typeOfExpression).Emit();
     //typeOfExpression.Type.AcceptVisitor(this);
 }
开发者ID:yindongfei,项目名称:bridge.lua,代码行数:5,代码来源:Emitter.Visitor.cs


示例7: VisitTypeOfExpression

 public StringBuilder VisitTypeOfExpression(TypeOfExpression typeOfExpression, int data)
 {
     throw new SLSharpException("SL# does not have reflection.");
 }
开发者ID:hach-que,项目名称:SLSharp,代码行数:4,代码来源:VisitorBase.Illegal.cs


示例8: VisitTypeOfExpression

 public void VisitTypeOfExpression(TypeOfExpression node)
 {
     NotSupported(node);
 }
开发者ID:evanw,项目名称:minisharp,代码行数:4,代码来源:Lower.cs


示例9: VisitTypeOfExpression

			public override void VisitTypeOfExpression (TypeOfExpression typeOfExpression)
			{
				base.VisitTypeOfExpression (typeOfExpression);

				var nt = new ObjectCreateExpression (
					         new SimpleType ("Type"),
					new PrimitiveExpression (GetJsConstructor (typeOfExpression.Type)));

				typeOfExpression.ReplaceWith (nt);
			}
开发者ID:RReverser,项目名称:Netjs,代码行数:10,代码来源:CsToTs.cs


示例10: VisitTypeOfExpression

		public virtual object VisitTypeOfExpression(TypeOfExpression typeOfExpression, object data) {
			throw new global::System.NotImplementedException("TypeOfExpression");
		}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:3,代码来源:NotImplementedAstVisitor.cs


示例11: TypeOfExpressionEmitter

 internal TypeOfExpressionEmitter(TypeOfExpression typeOfExpression,
                                  ILGenerator ilGenerator,
                                  IOpCodeIndexer instructionsIndexer)
     : base(ilGenerator, instructionsIndexer) {
     _typeOfExpression = typeOfExpression;
 }
开发者ID:sagifogel,项目名称:NJection.LambdaConverter,代码行数:6,代码来源:TypeOfExpressionEmitter.cs


示例12: ConvertArgumentValue

		private static Expression ConvertArgumentValue(CustomAttributeArgument parameter)
		{
			var type = parameter.Type.Resolve();
			Expression parameterValue;
			if (type.IsEnum)
			{
				parameterValue = MakePrimitive(Convert.ToInt64(parameter.Value), type);
			}
			else if (parameter.Value is TypeReference)
			{
				parameterValue = new TypeOfExpression()
				{
					Type = ConvertType((TypeReference)parameter.Value),
				};
			}
			else
			{
				parameterValue = new PrimitiveExpression(parameter.Value);
			}
			return parameterValue;
		}
开发者ID:stgwilli,项目名称:ILSpy,代码行数:21,代码来源:AstBuilder.cs


示例13: PrimaryExpr


//.........这里部分代码省略.........
                            {
                                this.ArrayInitializer(out expression);
                                expression4.ArrayInitializer = (ArrayInitializerExpression) expression;
                            }
                        }
                        else
                        {
                            base.SynErr(180);
                        }
                    }
                    else
                    {
                        base.SynErr(0xb5);
                    }
                }
                else if (this.la.kind == 0x72)
                {
                    base.lexer.NextToken();
                    base.Expect(20);
                    if (this.NotVoidPointer())
                    {
                        base.Expect(0x7a);
                        typeReference = new TypeReference("void");
                    }
                    else if (this.StartOf(9))
                    {
                        this.TypeWithRestriction(out typeReference, true, true);
                    }
                    else
                    {
                        base.SynErr(0xb6);
                    }
                    base.Expect(0x15);
                    pexpr = new TypeOfExpression(typeReference);
                }
                else if ((this.la.kind == 0x3e) && (this.Peek(1).kind == 20))
                {
                    base.Expect(0x3e);
                    base.Expect(20);
                    this.Type(out typeReference);
                    base.Expect(0x15);
                    pexpr = new DefaultValueExpression(typeReference);
                }
                else if (this.la.kind == 0x68)
                {
                    base.lexer.NextToken();
                    base.Expect(20);
                    this.Type(out typeReference);
                    base.Expect(0x15);
                    pexpr = new SizeOfExpression(typeReference);
                }
                else if (this.la.kind == 0x39)
                {
                    base.lexer.NextToken();
                    base.Expect(20);
                    this.Expr(out expression);
                    base.Expect(0x15);
                    pexpr = new CheckedExpression(expression);
                }
                else if (this.la.kind == 0x75)
                {
                    base.lexer.NextToken();
                    base.Expect(20);
                    this.Expr(out expression);
                    base.Expect(0x15);
                    pexpr = new UncheckedExpression(expression);
开发者ID:KnowNo,项目名称:test-code-backup,代码行数:67,代码来源:Parser.cs


示例14: VisitTypeOfExpression

		public virtual object VisitTypeOfExpression(TypeOfExpression typeOfExpression, object data) {
			Debug.Assert((typeOfExpression != null));
			Debug.Assert((typeOfExpression.TypeReference != null));
			nodeStack.Push(typeOfExpression.TypeReference);
			typeOfExpression.TypeReference.AcceptVisitor(this, data);
			typeOfExpression.TypeReference = ((TypeReference)(nodeStack.Pop()));
			return null;
		}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:8,代码来源:AbstractAstTransformer.cs


示例15: SimpleNonInvocationExpression


//.........这里部分代码省略.........
				break;
			}
			case 81: case 93: case 204: {

#line  1690 "VBNET.ATG" 
				CastType castType = CastType.Cast; 
				if (la.kind == 93) {
					lexer.NextToken();
				} else if (la.kind == 81) {
					lexer.NextToken();

#line  1692 "VBNET.ATG" 
					castType = CastType.Conversion; 
				} else if (la.kind == 204) {
					lexer.NextToken();

#line  1693 "VBNET.ATG" 
					castType = CastType.TryCast; 
				} else SynErr(259);
				Expect(25);
				Expr(
#line  1695 "VBNET.ATG" 
out expr);
				Expect(12);
				TypeName(
#line  1695 "VBNET.ATG" 
out type);
				Expect(26);

#line  1696 "VBNET.ATG" 
				pexpr = new CastExpression(type, expr, castType); 
				break;
			}
			case 63: case 64: case 65: case 66: case 67: case 68: case 70: case 72: case 73: case 77: case 78: case 79: case 80: case 82: case 83: case 84: {
				CastTarget(
#line  1697 "VBNET.ATG" 
out type);
				Expect(25);
				Expr(
#line  1697 "VBNET.ATG" 
out expr);
				Expect(26);

#line  1697 "VBNET.ATG" 
				pexpr = new CastExpression(type, expr, CastType.PrimitiveConversion); 
				break;
			}
			case 44: {
				lexer.NextToken();
				Expr(
#line  1698 "VBNET.ATG" 
out expr);

#line  1698 "VBNET.ATG" 
				pexpr = new AddressOfExpression(expr); 
				break;
			}
			case 116: {
				lexer.NextToken();
				Expect(25);
				GetTypeTypeName(
#line  1699 "VBNET.ATG" 
out type);
				Expect(26);

#line  1699 "VBNET.ATG" 
				pexpr = new TypeOfExpression(type); 
				break;
			}
			case 205: {
				lexer.NextToken();
				SimpleExpr(
#line  1700 "VBNET.ATG" 
out expr);
				Expect(131);
				TypeName(
#line  1700 "VBNET.ATG" 
out type);

#line  1700 "VBNET.ATG" 
				pexpr = new TypeOfIsExpression(expr, type); 
				break;
			}
			case 122: {
				ConditionalExpression(
#line  1701 "VBNET.ATG" 
out pexpr);
				break;
			}
			}
		} else if (la.kind == 16) {
			lexer.NextToken();
			IdentifierOrKeyword(
#line  1705 "VBNET.ATG" 
out name);

#line  1705 "VBNET.ATG" 
			pexpr = new MemberReferenceExpression(null, name);
		} else SynErr(260);
	}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:101,代码来源:Parser.cs


示例16: VisitTypeOfExpression

 public void VisitTypeOfExpression(TypeOfExpression typeOfExpression)
 {
     JsonObject expression = CreateJsonExpression(typeOfExpression);
     AddKeyword(expression, TypeOfExpression.TypeofKeywordRole);
     expression.AddJsonValue("type-info", GenTypeInfo(typeOfExpression.Type));
     Push(expression);
 }
开发者ID:CompilerKit,项目名称:CodeWalk,代码行数:7,代码来源:AstCsToJson.cs


示例17: AddLinkingAttribute

    /// <summary>
    /// Adds the linking attribute.
    /// </summary>
    /// <param name="contractClass">The contract class.</param>
    private void AddLinkingAttribute(Class contractClass)
    {
      Contract.Requires(contractClass != null, "contractClass must not be null.");

      var typeOfExp = new TypeOfExpression(new TypeReferenceExpression(this.InterfaceName));
      var attribute = new CustomAttribute() { Name = ContractClassFor };
      if (attribute.Arguments != null)
      {
        attribute.Arguments.Add(typeOfExp);
      }

      var section = new AttributeSection();
      if (section.AttributeCollection != null)
      {
        section.AttributeCollection.Add(attribute);
      }

      contractClass.AddAttributeSection(section);
    }
开发者ID:kevinmiles,项目名称:dxcorecommunityplugins,代码行数:23,代码来源:ContractClassBuilder.cs


示例18: VisitTypeOfExpression

		public virtual object VisitTypeOfExpression(TypeOfExpression typeOfExpression, object data) {
			Debug.Assert((typeOfExpression != null));
			Debug.Assert((typeOfExpression.TypeReference != null));
			return typeOfExpression.TypeReference.AcceptVisitor(this, data);
		}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:5,代码来源:AbstractASTVisitor.cs


示例19: Visit

 public override object Visit(TypeOfExpression typeOfExpression, object data)
 {
     return new ReturnType("System.Type");
 }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:4,代码来源:TypeVisitor.cs


示例20: VisitTypeOfExpression

 public override void VisitTypeOfExpression(TypeOfExpression typeOfExpression)
 {
     typeOfExpression.Type.AcceptVisitor(this);
 }
开发者ID:TinkerWorX,项目名称:Bridge,代码行数:4,代码来源:Emitter.Visitor.cs



注:本文中的TypeOfExpression类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TypeOperation类代码示例发布时间:2022-05-24
下一篇:
C# TypeNodeList类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap