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    aspect SuppressWarnings {
010      syn boolean VariableDeclaration.hasAnnotationSuppressWarnings(String s) =
011        getModifiers().hasAnnotationSuppressWarnings(s);
012    
013      inh boolean VariableDeclaration.withinSuppressWarnings(String s);
014      inh boolean FieldDeclaration.withinSuppressWarnings(String s);
015      inh boolean AssignSimpleExpr.withinSuppressWarnings(String s);
016      inh boolean CastExpr.withinSuppressWarnings(String s);
017      inh boolean MethodDecl.withinSuppressWarnings(String s);
018      inh boolean MethodAccess.withinSuppressWarnings(String s);
019    
020      syn boolean VariableDeclaration.suppressWarnings(String type) =
021        hasAnnotationSuppressWarnings(type) || withinSuppressWarnings(type);
022      syn boolean FieldDeclaration.suppressWarnings(String type) =
023        hasAnnotationSuppressWarnings(type) || withinSuppressWarnings(type);
024      syn boolean MethodDecl.suppressWarnings(String type) =
025        hasAnnotationSuppressWarnings(type) || withinSuppressWarnings(type);
026    }