Ejemplo n.º 1
0
			void AddTypeArguments (ATypeNameExpression texpr, AstType result)
			{
				if (!texpr.HasTypeArguments)
					return;
				foreach (var arg in texpr.TypeArguments.Args) {
					result.AddChild (ConvertToType (arg), AstType.Roles.TypeArgument);
				}
			}
Ejemplo n.º 2
0
			void AddTypeArguments (ATypeNameExpression texpr, AstType result)
			{
				if (texpr.TypeArguments == null || texpr.TypeArguments.Args == null)
					return;
				var loc = LocationsBag.GetLocations (texpr.TypeArguments);
				if (loc != null && loc.Count >= 2)
					result.AddChild (new CSharpTokenNode (Convert (loc [loc.Count - 2]), 1), AstType.Roles.LChevron);
				int i = 0;
				foreach (var arg in texpr.TypeArguments.Args) {
					result.AddChild (ConvertToType (arg), AstType.Roles.TypeArgument);
					if (loc != null && i < loc.Count - 2)
						result.AddChild (new CSharpTokenNode (Convert (loc [i++]), 1), AstType.Roles.Comma);
				}
				if (loc != null && loc.Count >= 2)
					result.AddChild (new CSharpTokenNode (Convert (loc [loc.Count - 1]), 1), AstType.Roles.RChevron);
			}
Ejemplo n.º 3
0
 public DynamicInvocation(ATypeNameExpression member, Arguments args, Location loc)
     : base(null, args, loc)
 {
     base.binder = this;
     this.member = member;
 }
Ejemplo n.º 4
0
			void AddTypeArguments(AstNode parent, ATypeNameExpression memberName)
			{
				if (memberName == null || !memberName.HasTypeArguments)
					return;
				var chevronLocs = LocationsBag.GetLocations(memberName.TypeArguments);
				if (chevronLocs != null)
					parent.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 2]), Roles.LChevron), Roles.LChevron);
				
				for (int i = 0; i < memberName.TypeArguments.Count; i++) {
					var arg = memberName.TypeArguments.Args [i];
					if (arg == null)
						continue;
					parent.AddChild(ConvertToType(arg), Roles.TypeArgument);
					if (chevronLocs != null && i < chevronLocs.Count - 2)
						parent.AddChild(new CSharpTokenNode(Convert(chevronLocs [i]), Roles.Comma), Roles.Comma);
				}
				
				if (chevronLocs != null)
					parent.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 1]), Roles.RChevron), Roles.RChevron);
			}
Ejemplo n.º 5
0
			void AddTypeArguments(ATypeNameExpression texpr, AstType result)
			{
				var unbound = texpr.TypeArguments as UnboundTypeArguments;
				if (unbound != null) { 
					var loc2 = LocationsBag.GetLocations(texpr.TypeArguments);
					if (loc2 == null)
						return;
					int j = 0;
					if (j < loc2.Count)
						result.AddChild(new CSharpTokenNode(Convert(loc2 [j++]), Roles.LChevron), Roles.LChevron);
					while (j < loc2.Count - 1) {
						result.AddChild (new SimpleType (), Roles.TypeArgument);
						result.AddChild(new CSharpTokenNode(Convert(loc2 [j++]), Roles.LChevron), Roles.Comma);
					}
					if (j < loc2.Count) {
						result.AddChild (new SimpleType (), Roles.TypeArgument);
						result.AddChild(new CSharpTokenNode(Convert(loc2 [j++]), Roles.RChevron), Roles.RChevron);
					}
					return;
				}
				if (texpr.TypeArguments == null || texpr.TypeArguments.Args == null)
					return;
				var loc = LocationsBag.GetLocations(texpr.TypeArguments);
				if (loc != null && loc.Count >= 2)
					result.AddChild(new CSharpTokenNode(Convert(loc [loc.Count - 2]), Roles.LChevron), Roles.LChevron);
				int i = 0;
				foreach (var arg in texpr.TypeArguments.Args) {
					result.AddChild(ConvertToType(arg), Roles.TypeArgument);
					if (loc != null && i < loc.Count - 2)
						result.AddChild(new CSharpTokenNode(Convert(loc [i++]), Roles.Comma), Roles.Comma);
				}
				if (loc != null && loc.Count >= 2)
					result.AddChild(new CSharpTokenNode(Convert(loc [loc.Count - 1]), Roles.RChevron), Roles.RChevron);
			}
Ejemplo n.º 6
0
			void AddTypeArguments (ATypeNameExpression texpr, DomReturnType result)
			{
				if (!texpr.HasTypeArguments)
					return;
				foreach (var arg in texpr.TypeArguments.Args) {
					result.AddTypeParameter (ConvertReturnType (arg));
				}
			}
Ejemplo n.º 7
0
 public UsingType(ATypeNameExpression expr, Location loc)
     : base(expr, loc)
 {
 }
Ejemplo n.º 8
0
 public UsingClause(ATypeNameExpression expr, Location loc)
 {
     this.expr = expr;
     this.loc = loc;
 }
Ejemplo n.º 9
0
		public DynamicInvocation (ATypeNameExpression member, Arguments args, Location loc)
			: base (null, args, loc)
		{
			base.binder = this;
			this.member = member;
			this.IsMemberAccess = (member is MemberAccess) || (member is SimpleName);
		}
Ejemplo n.º 10
0
		public DynamicInvocation (ATypeNameExpression member, Arguments args, bool conditionalAccessReceiver, Location loc)
			: base (null, args, loc)
		{
			base.binder = this;
			this.member = member;
			this.conditional_access_receiver = conditionalAccessReceiver;
		}
Ejemplo n.º 11
0
		//
		// When a return type is known not to be dynamic
		//
		public DynamicInvocation (ATypeNameExpression member, Arguments args, TypeSpec type, Location loc)
			: this (member, args, loc)
		{
			this.type = type;
		}
Ejemplo n.º 12
0
		TypeSpec ResolvePossibleAttributeType (ATypeNameExpression expr, ref bool is_attr)
		{
			TypeExpr te = ResolveAsTypeTerminal (expr, context);
			if (te == null)
				return null;

			TypeSpec t = te.Type;
			if (t.IsAttribute) {
				is_attr = true;
			} else {
				Report.SymbolRelatedToPreviousError (t);
				Report.Error (616, Location, "`{0}': is not an attribute class", TypeManager.CSharpName (t));
			}
			return t;
		}
Ejemplo n.º 13
0
		public GlobalAttribute (NamespaceEntry ns, string target, ATypeNameExpression expression,
					Arguments[] args, Location loc, bool nameEscaped):
			base (target, expression, args, loc, nameEscaped)
		{
			this.ns = ns;
		}
Ejemplo n.º 14
0
		public Attribute (string target, ATypeNameExpression expr, Arguments[] args, Location loc, bool nameEscaped)
		{
			this.expression = expr;
			if (args != null) {
				PosArguments = args [0];
				NamedArguments = args [1];				
			}
			this.loc = loc;
			ExplicitTarget = target;
			this.nameEscaped = nameEscaped;
		}
Ejemplo n.º 15
0
 public DynamicInvocation(ATypeNameExpression member, Arguments args, TypeSpec type, Location loc)
     : this(member, args, loc)
 {
     // When a return type is known not to be dynamic
     this.type = type;
 }
Ejemplo n.º 16
0
 public static DynamicInvocation CreateSpecialNameInvoke(ATypeNameExpression member, Arguments args, Location loc)
 {
     return new DynamicInvocation (member, args, loc) {
         flags = CSharpBinderFlags.InvokeSpecialName
     };
 }
Ejemplo n.º 17
0
 public UsingAliasNamespace(SimpleMemberName alias, ATypeNameExpression expr, Location loc)
     : base(expr, loc)
 {
     this.alias = alias;
 }