Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        public override void EnterClassBodyDeclaration(JavaParser.ClassBodyDeclarationContext context)
        {
            if (context.memberDeclaration() == null)
            {
                return;
            }
            MemberDeclarationListener memberDeclarationListener =
                new MemberDeclarationListener(parentClass);

            context.memberDeclaration().EnterRule(memberDeclarationListener);
        }
Esempio n. 3
0
        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()));
            }
        }
Esempio n. 4
0
        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));
                }
            }
        }