*/
public class ArgumentDeclaration extends VariableDeclaration {
+ /** The argument is a reference or not. */
public boolean reference;
/**
* Create an argument.
- * @param initialization the initialization
* @param name the name
+ * @param reference the variable is a reference ?
+ * @param initialization the initialization
* @param sourceStart the start point
*/
- public ArgumentDeclaration(char[] name,
- Expression initialization,
- int sourceStart,
- boolean reference) {
- super(name, initialization, sourceStart);
+ 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() {
final StringBuffer buff;
if (reference) {
- buff = new StringBuffer("&$");
+ buff = new StringBuffer("&");
} else {
- buff = new StringBuffer("$");
+ buff = new StringBuffer();
}
- buff.append(name);
+ buff.append(variable.toStringExpression());
if (initialization != null) {
buff.append(" = ");
buff.append(initialization.toStringExpression());