Exemple #1
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;
 }
Exemple #2
0
 public static DynamicInvocation CreateSpecialNameInvoke(ATypeNameExpression member, Arguments args, Location loc)
 {
     return(new DynamicInvocation(member, args, loc)
     {
         flags = CSharpBinderFlags.InvokeSpecialName
     });
 }
Exemple #3
0
 public DynamicInvocation(ATypeNameExpression member, Arguments args, Location loc)
     : base(null, args, loc)
 {
     base.binder = this;
     this.member = member;
 }
			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);
			}
			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]), 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);
			}
		public static DynamicInvocation CreateSpecialNameInvoke (ATypeNameExpression member, Arguments args, Location loc)
		{
			return new DynamicInvocation (member, args, loc) {
				flags = CSharpBinderFlags.InvokeSpecialName
			};
		}
		public DynamicInvocation (ATypeNameExpression member, Arguments args, Location loc)
			: base (null, args, loc)
		{
			base.binder = this;
			this.member = member;
		}
Exemple #8
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;
 }
		public UsingAliasNamespace (SimpleMemberName alias, ATypeNameExpression expr, Location loc)
			: base (expr, loc)
		{
			this.alias = alias;
		}
		public UsingType (ATypeNameExpression expr, Location loc)
			: base (expr, loc)
		{
		}
		public UsingNamespace (ATypeNameExpression expr, Location loc)
		{
			this.expr = expr;
			this.loc = loc;
		}
Exemple #12
0
			void AddTypeArguments(ATypeNameExpression texpr, AstType result)
			{
				var unbound = texpr.TypeArguments as UnboundTypeArguments;
				if (unbound != null) {
					TextLocation ll = Convert (texpr.Location);
					result.AddChild(new CSharpTokenNode(ll, Roles.LChevron), Roles.LChevron);
					ll = new TextLocation (ll.Line, ll.Column + 1);
					for (int j = 0; j < unbound.Count; j++) {
						result.AddChild (new SimpleType (), Roles.TypeArgument);
						result.AddChild(new CSharpTokenNode(ll, Roles.LChevron), Roles.Comma);
						ll = new TextLocation (ll.Line, ll.Column + 1);
					}
					result.AddChild(new CSharpTokenNode(ll, Roles.RChevron), Roles.RChevron);
					/*
					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);
			}
Exemple #13
0
 public UsingAliasNamespace(SimpleMemberName alias, ATypeNameExpression expr, Location loc)
     : base(expr, loc)
 {
     this.alias = alias;
 }
Exemple #14
0
 public UsingNamespace(ATypeNameExpression expr, Location loc)
 {
     this.expr = expr;
     this.loc  = loc;
 }
Exemple #15
0
 public DynamicInvocation(ATypeNameExpression member, Arguments args, Type type, Location loc)
     : this(member, args, loc)
 {
     // When a return type is known not to be dynamic
     this.type = type;
 }