public override void EnterConstructor([NotNull] XSharpParser.ConstructorContext context) { var ctor = new XCodeConstructor(); writeTrivia(ctor, context); ctor.Attributes = MemberAttributes.Public; ctor.Parameters.AddRange(GetParametersList(context.ParamList)); if (context.Modifiers != null) { ctor.Attributes = ContextToConstructorModifiers(context.Modifiers); } FillCodeDomDesignerData(ctor, context.Start.Line, context.Start.Column); SaveSourceCode(ctor, context); // write original source for the attributes AddMemberAttributes(ctor, ctor.Attributes, context.Modifiers); this.CurrentType.Members.Add(ctor); }
public override void EnterConstructor([NotNull] XSharpParser.ConstructorContext context) { var ctor = new XCodeConstructor(); writeTrivia(ctor, context); FillCodeDomDesignerData(ctor, context.Start.Line, context.Start.Column); ctor.Attributes = MemberAttributes.Public; ctor.Parameters.AddRange(GetParametersList(context.ParamList)); // if (context.Modifiers != null) { // Get standard Visibilities ctor.Attributes = ContextToConstructorModifiers(context.Modifiers); if (context.Modifiers.STATIC().Length > 0) { ctor.Attributes |= MemberAttributes.Static; } } FillCodeSource(ctor, context, _tokens); this.CurrentClass.Members.Add(ctor); }