コード例 #1
0
 /**
  * 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);
   }
 }
コード例 #2
0
 /**
  * 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);
   }
 }