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: package de.uka.ilkd.key.logic;
12:
13: import de.uka.ilkd.key.logic.op.*;
14:
15: import java.util.HashSet;
16:
17: /**
18: * Collects all operators occuring in the traversed term.
19: */
20:
21: public class OpCollector extends Visitor {
22: /** the found operators */
23: private HashSet ops;
24:
25: /** creates the Op collector */
26: public OpCollector() {
27: ops = new HashSet();
28: }
29:
30: public void visit(Term t) {
31: ops.add(t.op());
32: }
33:
34: public boolean contains(Operator op) {
35: return ops.contains(op);
36: }
37:
38: }
|