01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: //
09: //
10: //
11: //
12:
13: package de.uka.ilkd.key.rule.metaconstruct;
14:
15: import de.uka.ilkd.key.java.ProgramElement;
16: import de.uka.ilkd.key.java.Services;
17: import de.uka.ilkd.key.java.expression.literal.BooleanLiteral;
18: import de.uka.ilkd.key.java.reference.VariableReference;
19: import de.uka.ilkd.key.rule.inst.SVInstantiations;
20:
21: public class IsStatic extends ProgramMetaConstruct {
22:
23: /** creates a typeof ProgramMetaConstruct
24: * @param expr the instance of expression contained by
25: * the meta construct
26: */
27: public IsStatic(ProgramElement pe) {
28: super ("#isstatic", pe);
29: }
30:
31: /** performs the program transformation needed for symbolic
32: * program execution
33: * @param services the Services with all necessary information
34: * about the java programs
35: * @param svInst the instantiations esp. of the inner and outer label
36: * @return the transformed program
37: */
38: public ProgramElement symbolicExecution(ProgramElement pe,
39: Services services, SVInstantiations svInst) {
40: if (pe instanceof VariableReference) {
41: if (((VariableReference) pe).getProgramVariable()
42: .isStatic()) {
43: return BooleanLiteral.TRUE;
44: }
45: }
46: return BooleanLiteral.FALSE;
47: }
48: }
|