001    /*
002     * JastAddJ is covered by the modified BSD License. You should have received
003     * a copy of the modified BSD license with this compiler.
004     * 
005     * Copyright (c) 2011, Jesper Öqvist <jesper.oqvist@cs.lth.se>
006     * All rights reserved.
007     */
008    
009    
010    /**
011     * Add support for warnings to JastAddJ.
012     */
013    aspect Warnings {
014    
015        /**
016         * The collectErrors method is refined so that it calls
017         * the checkWarnings method on each ASTNode to report
018         * unchecked warnings.
019         */
020        refine ErrorCheck public void ASTNode.collectErrors() {
021                nameCheck();
022                typeCheck();
023                accessControl();
024                exceptionHandling();
025                checkUnreachableStmt();
026                definiteAssignment();
027                checkModifiers();
028                checkWarnings();
029                for(int i = 0; i < getNumChild(); i++) {
030                        getChild(i).collectErrors();
031                }
032        }
033    
034        /**
035         * Checking of the SafeVarargs annotation is only needed for method
036         * declarations.
037         */
038        public void ASTNode.checkWarnings() {
039        }
040    
041    }