/** * Collect Variable Declarations. * * @param ast variable token * @param frame current frame */ private static void collectVariableDeclarations(DetailAST ast, LexicalFrame frame) { final String name = ast.findFirstToken(TokenTypes.IDENT).getText(); if (frame instanceof ClassFrame) { final DetailAST mods = ast.findFirstToken(TokenTypes.MODIFIERS); if (ScopeUtils.isInInterfaceBlock(ast) || mods.branchContains(TokenTypes.LITERAL_STATIC)) { ((ClassFrame) frame).addStaticMember(name); } else { ((ClassFrame) frame).addInstanceMember(name); } } else { frame.addName(name); } }
/** * Collects variable declarations. * * @param ast variable token. * @param frame current frame. */ private static void collectVariableDeclarations(DetailAST ast, AbstractFrame frame) { final DetailAST ident = ast.findFirstToken(TokenTypes.IDENT); if (frame.getType() == FrameType.CLASS_FRAME) { final DetailAST mods = ast.findFirstToken(TokenTypes.MODIFIERS); if (ScopeUtils.isInInterfaceBlock(ast) || mods.branchContains(TokenTypes.LITERAL_STATIC)) { ((ClassFrame) frame).addStaticMember(ident); } else { ((ClassFrame) frame).addInstanceMember(ident); } } else { frame.addIdent(ident); } }