public override void Visit (EventProperty ep) { CustomEventDeclaration newEvent = new CustomEventDeclaration (); AddAttributeSection (newEvent, ep); var location = LocationsBag.GetMemberLocation (ep); AddModifiers (newEvent, location); if (location != null && location.Count > 0) newEvent.AddChild (new CSharpTokenNode (Convert (location [0]), CustomEventDeclaration.EventKeywordRole), CustomEventDeclaration.EventKeywordRole); newEvent.AddChild (ConvertToType (ep.TypeExpression), Roles.Type); AddExplicitInterface (newEvent, ep.MemberName); newEvent.AddChild (Identifier.Create (ep.MemberName.Name, Convert (ep.Location)), Roles.Identifier); if (location != null && location.Count >= 2) newEvent.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.LBrace), Roles.LBrace); if (ep.Add != null) { Accessor addAccessor = new Accessor (); AddAttributeSection (addAccessor, ep.Add); var addLocation = LocationsBag.GetMemberLocation (ep.Add); AddModifiers (addAccessor, addLocation); addAccessor.AddChild (new CSharpTokenNode (Convert (ep.Add.Location), CustomEventDeclaration.AddKeywordRole), CustomEventDeclaration.AddKeywordRole); if (ep.Add.Block != null) addAccessor.AddChild ((BlockStatement)ep.Add.Block.Accept (this), Roles.Body); newEvent.AddChild (addAccessor, CustomEventDeclaration.AddAccessorRole); } if (ep.Remove != null) { Accessor removeAccessor = new Accessor (); AddAttributeSection (removeAccessor, ep.Remove); var removeLocation = LocationsBag.GetMemberLocation (ep.Remove); AddModifiers (removeAccessor, removeLocation); removeAccessor.AddChild (new CSharpTokenNode (Convert (ep.Remove.Location), CustomEventDeclaration.RemoveKeywordRole), CustomEventDeclaration.RemoveKeywordRole); if (ep.Remove.Block != null) removeAccessor.AddChild ((BlockStatement)ep.Remove.Block.Accept (this), Roles.Body); newEvent.AddChild (removeAccessor, CustomEventDeclaration.RemoveAccessorRole); } if (location != null && location.Count >= 3) { newEvent.AddChild (new CSharpTokenNode (Convert (location [2]), Roles.RBrace), Roles.RBrace); } else { // parser error, set end node to max value. newEvent.AddChild (new ErrorNode (), Roles.Error); } typeStack.Peek ().AddChild (newEvent, Roles.TypeMemberRole); }
public virtual void Visit (EventProperty ep) { }
public RemoveDelegateMethod (EventProperty method, Attributes attrs, Location loc) : base (method, RemovePrefix, attrs, loc) { }
protected AEventPropertyAccessor (EventProperty method, string prefix, Attributes attrs, Location loc) : base (method, prefix, attrs, loc) { }
void case_305() #line 2968 "ps-parser.jay" { if (doc_support) { current_event.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } lbag.AppendToMember (current_event, GetLocation (yyVals[-1+yyTop])); current_event = null; current_local_parameters = null; }
void case_303() #line 2950 "ps-parser.jay" { current_event = new EventProperty (current_type, (FullNamedExpression) yyVals[-1+yyTop], (Modifiers) yyVals[-5+yyTop], (MemberName) yyVals[-3+yyTop], (Attributes) yyVals[-6+yyTop]); if (is_config_enabled) { current_type.AddMember (current_event); } is_config_enabled = true; lbag.AddMember (current_event, GetModifierLocations (), GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[0+yyTop])); lexer.EventParsing = true; }