+++ /dev/null
-package net.sourceforge.phpdt.internal.compiler.ast;
-
-
-/**
- * An argument declaration.
- *
- * @author Matthieu Casanova
- */
-public final class ArgumentDeclaration extends VariableDeclaration {
-
- /**
- * Create an argument.
- *
- * @param name the name
- * @param reference the variable is a reference ?
- * @param initialization the initialization
- * @param sourceStart the start point
- */
- public ArgumentDeclaration(final Variable name,
- final boolean reference,
- final Expression initialization,
- final int sourceStart) {
- super(name, initialization, VariableDeclaration.EQUAL, sourceStart);
- this.reference = reference;
- }
-
- /**
- * Create an argument.
- *
- * @param name the name
- * @param reference the variable is a reference ?
- * @param sourceStart the start point
- */
- public ArgumentDeclaration(final Variable name,
- final boolean reference,
- final int sourceStart) {
- super(name, sourceStart);
- this.reference = reference;
- }
-
- /**
- * Return the expression as String.
- *
- * @return the expression
- */
- public String toStringExpression() {
- if (initialization == null) {
- if (reference) {
- return '&' + variable.toStringExpression();
- } else {
- return variable.toStringExpression();
- }
- } else {
- final String variableString = variable.toStringExpression();
- final String initializationString = initialization.toStringExpression();
- final StringBuffer buff = new StringBuffer(4 +
- variableString.length() +
- initializationString.length());
- if (reference) {
- buff.append('&');
- }
- buff.append(variableString);
- buff.append(" = ");
- buff.append(initializationString);
- return buff.toString();
- }
- }
-}