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: package de.uka.ilkd.key.java.recoderext;
11:
12: import recoder.ServiceConfiguration;
13: import recoder.abstraction.PrimitiveType;
14: import recoder.abstraction.Type;
15: import recoder.java.Reference;
16: import recoder.java.declaration.VariableSpecification;
17: import recoder.java.reference.TypeReference;
18: import recoder.java.reference.UncollatedReferenceQualifier;
19:
20: public class SchemaCrossReferenceSourceInfo extends
21: KeYCrossReferenceSourceInfo {
22:
23: protected final PrimitiveType recoderTypeSVType;
24:
25: public SchemaCrossReferenceSourceInfo(ServiceConfiguration config) {
26: super (config);
27: recoderTypeSVType = new PrimitiveType("TypeSV", this );
28: }
29:
30: public void initialize(ServiceConfiguration cfg) {
31: super .initialize(cfg);
32: cfg.getChangeHistory().removeChangeHistoryListener(this );
33: }
34:
35: public Type getType(TypeReference tr) {
36: if (tr instanceof TypeSVWrapper) {
37: return recoderTypeSVType;
38: } else {
39: return super .getType(tr);
40: }
41: }
42:
43: public Type getType(VariableSpecification vs) {
44: if (vs.getExpressionCount() > 0
45: && vs.getExpressionAt(0) instanceof ProgramVariableSVWrapper) {
46: return recoderTypeSVType;
47: } else {
48: return super .getType(vs);
49: }
50: }
51:
52: /** does not resolve the urq, just returns the argument
53: */
54: public Reference resolveURQ(UncollatedReferenceQualifier urq) {
55: return urq;
56: }
57:
58: }
|