/* abc - The AspectBench Compiler * Copyright (C) 2010 Eric Bodden * * This compiler is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This compiler is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this compiler, in the file LESSER-GPL; * if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ aspect Adapter { //implement default attributes for our new syntax nodes eq Dims.getChild().maxPrecedence() = Integer.MAX_VALUE; eq Proceed.getChild().maxPrecedence() = Integer.MAX_VALUE; eq IfPointcutExpr.getChild().maxPrecedence() = Integer.MAX_VALUE; eq BoundMethodAccess.getChild().throwTarget(TypeDecl exn) { throw new UnsupportedOperationException(); } eq CJPAdviceDecl.getBlock().reachable() = true; eq CJPAdviceDecl.getAdviceSpec().proceedSig() { return new MethodSig( soot.Modifier.PUBLIC | soot.Modifier.FINAL | soot.Modifier.STATIC, AbcFactory.AbcClass(hostType().getSootClassDecl()), AbcFactory.AbcType(returnType().getSootType()), proceedName(), getAdviceSpec().aroundSpec().proceedFormals(), new ArrayList(), pos()); } syn TypeDecl CJPAdviceDecl.returnType() = getAdviceSpec().returnType(); syn lazy String CJPAdviceDecl.proceedName() = "proceed" + name().substring(6); syn lazy String CJPAdviceDecl.name() = getAdviceSpec().kind() + "$" + hostType().adviceCounter++; //arrange refinements refine LockedVariableAccess eq VarAccess.decls() to refine IntertypeFieldNameAnalysis eq VarAccess.decls() = targetVariable == null ? refined() : SimpleSet.emptySet.add(targetVariable); }