void AddTypeArguments (ATypeNameExpression texpr, AstType result) { if (!texpr.HasTypeArguments) return; foreach (var arg in texpr.TypeArguments.Args) { result.AddChild (ConvertToType (arg), AstType.Roles.TypeArgument); } }
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); }
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) { 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); }
void AddTypeArguments (ATypeNameExpression texpr, DomReturnType result) { if (!texpr.HasTypeArguments) return; foreach (var arg in texpr.TypeArguments.Args) { result.AddTypeParameter (ConvertReturnType (arg)); } }
public UsingType(ATypeNameExpression expr, Location loc) : base(expr, loc) { }
public UsingClause(ATypeNameExpression expr, Location loc) { this.expr = expr; this.loc = loc; }
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); }
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; }
// // 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; }
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; }
public GlobalAttribute (NamespaceEntry ns, string target, ATypeNameExpression expression, Arguments[] args, Location loc, bool nameEscaped): base (target, expression, args, loc, nameEscaped) { this.ns = ns; }
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; }
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; }
public static DynamicInvocation CreateSpecialNameInvoke(ATypeNameExpression member, Arguments args, Location loc) { return new DynamicInvocation (member, args, loc) { flags = CSharpBinderFlags.InvokeSpecialName }; }
public UsingAliasNamespace(SimpleMemberName alias, ATypeNameExpression expr, Location loc) : base(expr, loc) { this.alias = alias; }