public override void EnterClass_member_declaration(CSharpParser.Class_member_declarationContext context) { var cmdecl = context.common_member_declaration(); if (cmdecl == null) { return; } var nm = GetContextName(cmdecl); var parseItem = new CsharpParseItem { Name = nm }; AssignAccessMods(parseItem, context.all_member_modifiers()); AssignAttributes(parseItem, context.attributes()); AssignParameterType2Names(parseItem, cmdecl);; AssignStartAndStop(parseItem, context); AssignNsAndTypeValues(parseItem); Results.TypeMemberBodies.Add(parseItem); }
public static void Parse(this CSharpParser.Class_member_declarationContext context) { if (context.attributes() != null) { throw new NotImplementedException("Attributes not implemented yet"); } Modifiers modifiers = context.all_member_modifiers() != null?context.all_member_modifiers().Parse() : 0; Console.WriteLine("Modifiers " + modifiers); if (context.destructor_definition() != null) { throw new NotImplementedException("Destructors not implemented yet"); } else if (context.common_member_declaration() != null) { context.common_member_declaration().Parse(); } else { throw new NotSupportedException("Unknown member type"); } }