public override void EnterClassBodyDeclaration(JavaParser.ClassBodyDeclarationContext context) { if (context.memberDeclaration() == null) { return; } MemberDeclarationListener memberDeclarationListener = new MemberDeclarationListener(parentClassName, package, packageFqn); context.memberDeclaration().EnterRule(memberDeclarationListener); if (memberDeclarationListener.MethodInfo != null) { MethodInfos.Add(memberDeclarationListener.MethodInfo); } if (memberDeclarationListener.FieldInfo != null) { FieldInfos.Add(memberDeclarationListener.FieldInfo); } if (memberDeclarationListener.InnerClassInfo != null) { InnerClasses.Add(memberDeclarationListener.InnerClassInfo); } }
public override void EnterClassBodyDeclaration(JavaParser.ClassBodyDeclarationContext context) { if (context.memberDeclaration() == null) { return; } MemberDeclarationListener memberDeclarationListener = new MemberDeclarationListener(parentClass); context.memberDeclaration().EnterRule(memberDeclarationListener); }
public UstNode VisitClassBodyDeclaration(JavaParser.ClassBodyDeclarationContext context) { var block = context.block(); if (block != null) { var blockStatement = (BlockStatement)Visit(block); return(new StatementDeclaration(blockStatement, context.GetTextSpan(), FileNode)); } else { return(Visit(context.memberDeclaration())); } }
public Ust VisitClassBodyDeclaration(JavaParser.ClassBodyDeclarationContext context) { var block = context.block(); if (block != null) { var blockStatement = (BlockStatement)Visit(block); return(new StatementDeclaration(blockStatement, context.GetTextSpan())); } else { var result = Visit(context.memberDeclaration()) as EntityDeclaration; if (result != null) { result.Modifiers = context.modifier().Select(Visit).OfType <ModifierLiteral>().ToList(); return(result); } else { return(VisitChildren(context)); } } }