001: // This file is part of KeY - Integrated Deductive Software Design
002: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
003: // Universitaet Koblenz-Landau, Germany
004: // Chalmers University of Technology, Sweden
005: //
006: // The KeY system is protected by the GNU General Public License.
007: // See LICENSE.TXT for details.
008: //
009: //
010:
011: package de.uka.ilkd.key.java.recoderext;
012:
013: import recoder.java.*;
014: import recoder.java.reference.ReferencePrefix;
015: import recoder.java.reference.ThisReference;
016: import recoder.java.reference.TypeReference;
017:
018: public class SpecialReferenceWrapper extends ThisReference implements
019: Expression, KeYRecoderExtension, ReferencePrefix {
020:
021: protected TypeReference typeRef;
022: protected ReferencePrefix myprefix;
023:
024: protected StatementContainer statementParent = null;
025:
026: public SpecialReferenceWrapper() {
027: expressionParent = null;
028: }
029:
030: public SpecialReferenceWrapper(TypeReference typeRef,
031: ReferencePrefix myprefix) {
032: this .typeRef = typeRef;
033: this .myprefix = myprefix;
034: expressionParent = null;
035: }
036:
037: protected SpecialReferenceWrapper(SpecialReferenceWrapper proto) {
038: super (proto);
039: expressionParent = null;
040: }
041:
042: /**
043: Make parent role valid.
044: */
045: public void makeParentRoleValid() {
046: }
047:
048: /**
049: Get AST parent.
050: @return the non terminal program element.
051: */
052: public NonTerminalProgramElement getASTParent() {
053: return expressionParent;
054: }
055:
056: /**
057: Get expression container.
058: @return the expression container.
059: */
060: public ExpressionContainer getExpressionContainer() {
061: return expressionParent;
062: }
063:
064: /**
065: Set expression container.
066: @param c an expression container.
067: */
068: public void setExpressionContainer(ExpressionContainer c) {
069: expressionParent = c;
070: }
071:
072: //don't think we need it
073: public void accept(SourceVisitor v) {
074: }
075:
076: public Object deepClone() {
077: return new SpecialReferenceWrapper(typeRef, myprefix);
078: }
079:
080: /**
081: Get statement container.
082: @return the statement container.
083: */
084: public StatementContainer getStatementContainer() {
085: return statementParent;
086: }
087:
088: /**
089: Set statement container.
090: @param c a statement container.
091: */
092: public void setStatementContainer(StatementContainer c) {
093: statementParent = c;
094: }
095:
096: public TypeReference getTypeReference() {
097: return typeRef;
098: }
099:
100: /**
101: Set type reference
102:
103: */
104: public void setTypeReference(TypeReference ref) {
105: this .typeRef = ref;
106: }
107:
108: public ReferencePrefix getReferencePrefix() {
109: return myprefix;
110: }
111:
112: /**
113: Set reference suffix.
114: @param myprefix a reference prefix.
115: */
116: public void setReferencePrefix(ReferencePrefix myprefix) {
117: this.myprefix = myprefix;
118: }
119: }
|