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.declaration;
012:
013: import de.uka.ilkd.key.java.StatementBlock;
014: import de.uka.ilkd.key.java.abstraction.Constructor;
015: import de.uka.ilkd.key.java.visitor.Visitor;
016: import de.uka.ilkd.key.logic.ProgramElementName;
017: import de.uka.ilkd.key.util.ExtList;
018:
019: /**
020: * The getTypeReference method returns null - constructors do not have
021: * explicite return types. A constructor declaration contains its own
022: * name even though it must match the class name: the name occurs as
023: * syntactical element and hence must be represented.
024: * taken from COMPOST and changed to achieve an immutable structure
025: */
026:
027: public class ConstructorDeclaration extends MethodDeclaration implements
028: Constructor {
029:
030: /**
031: * Constructor declaration.
032: * @parm children an ExtList with the children. May
033: * include:
034: * a TypeReference (as a reference to the return type),
035: * a de.uka.ilkd.key.logic.ProgramElementName (as Name of the
036: * method),
037: * several ParameterDeclaration (as parameters of the declared
038: * method),
039: * a StatementBlock (as body of the declared method),
040: * several Modifier (taken as modifiers of the declaration),
041: * a Comment
042: * @param parentIsInterfaceDeclaration a boolean set true iff
043: * parent is an InterfaceDeclaration
044: */
045: public ConstructorDeclaration(ExtList children,
046: boolean parentIsInterfaceDeclaration) {
047: super (children, parentIsInterfaceDeclaration);
048: }
049:
050: /**
051: * Constructor declaration.
052: * @param modifiers a modifier array.
053: * @param name an identifier.
054: * @param parameters a parameter declaration mutable list.
055: * @param exceptions a throws.
056: * @param body a statement block.
057: * @param parentIsInterfaceDeclaration a boolean set true iff
058: * parent is an InterfaceDeclaration
059: */
060:
061: public ConstructorDeclaration(Modifier[] modifiers,
062: ProgramElementName name, ParameterDeclaration[] parameters,
063: Throws exceptions, StatementBlock body,
064: boolean parentIsInterfaceDeclaration) {
065: super (modifiers, null, name, parameters, exceptions, body,
066: parentIsInterfaceDeclaration);
067: }
068:
069: /**
070: * Constructors are never abstract.
071: */
072:
073: public boolean isAbstract() {
074: return false;
075: }
076:
077: /**
078: * Constructors are never final.
079: */
080:
081: public boolean isFinal() {
082: return false;
083: }
084:
085: /**
086: * Constructors are never native.
087: */
088:
089: public boolean isNative() {
090: return false;
091: }
092:
093: /**
094: * Constructors are never static.
095: */
096:
097: public boolean isStatic() {
098: return false;
099: }
100:
101: /**
102: * Constructors are never strictfp.
103: */
104:
105: public boolean isStrictFp() {
106: return false;
107: }
108:
109: /**
110: * Constructors are never synchronized.
111: */
112:
113: public boolean isSynchronized() {
114: return false;
115: }
116:
117: /** calls the corresponding method of a visitor in order to
118: * perform some action/transformation on this element
119: * @param v the Visitor
120: */
121: public void visit(Visitor v) {
122: v.performActionOnConstructorDeclaration(this);
123: }
124:
125: }
|