X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/VarAssignation.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/VarAssignation.java deleted file mode 100644 index e54de47..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/VarAssignation.java +++ /dev/null @@ -1,96 +0,0 @@ -package net.sourceforge.phpdt.internal.compiler.ast; - -/** - * A Variable assignation. - * $varname = initializer - * @author Matthieu Casanova - */ -public class VarAssignation extends Expression { - - public static final int EQUAL = 0; - public static final int PLUS_EQUAL = 1; - public static final int MINUS_EQUAL = 2; - public static final int STAR_EQUAL = 3; - public static final int SLASH_EQUAL = 4; - public static final int AND_EQUAL = 5; - public static final int OR_EQUAL = 6; - public static final int XOR_EQUAL = 7; - public static final int DOT_EQUAL = 8; - public static final int REM_EQUAL = 9; - public static final int TILDE_EQUAL = 10; - public static final int LSHIFT_EQUAL = 11; - public static final int RSIGNEDSHIFT_EQUAL = 12; - - public char[] variableName; - public Expression initializer; - public int operator; - - /** - * Create a new variable assignation. - * @param variableName the name of the variable - * @param initializer the expression in initializer - * @param operator the operator of assignation - * @param sourceStart the sourceStart - * @param sourceEnd the sourceEnd - */ - public VarAssignation(final char[] variableName, - final Expression initializer, - final int operator, - final int sourceStart, - final int sourceEnd) { - super(sourceStart, sourceEnd); - this.variableName = variableName; - this.initializer = initializer; - this.operator = operator; - } - - /** - * Return the operator as String. - * @return the operator - */ - public final String operatorToString() { - switch (operator) { - case EQUAL: - return "="; //$NON-NLS-1$ - case PLUS_EQUAL: - return "+="; //$NON-NLS-1$ - case MINUS_EQUAL: - return "-="; //$NON-NLS-1$ - case STAR_EQUAL: - return "*="; //$NON-NLS-1$ - case SLASH_EQUAL: - return "/="; //$NON-NLS-1$ - case AND_EQUAL: - return "<="; //$NON-NLS-1$ - case OR_EQUAL: - return "|=";//$NON-NLS-1$ - case XOR_EQUAL: - return "^=";//$NON-NLS-1$ - case DOT_EQUAL: - return ".="; //$NON-NLS-1$ - case REM_EQUAL: - return "%="; //$NON-NLS-1$ - case TILDE_EQUAL: - return " ="; //$NON-NLS-1$ - case LSHIFT_EQUAL: - return "<<="; //$NON-NLS-1$ - case RSIGNEDSHIFT_EQUAL: - return ">>="; //$NON-NLS-1$ - } - return " unknown operator ";//$NON-NLS-1$ - } - - /** - * Return the expression as String. - * @return the expression - */ - public String toStringExpression() { - final StringBuffer buff = new StringBuffer("$"); - buff.append(variableName); - buff.append(" ");//$NON-NLS-1$ - buff.append(operatorToString()); - buff.append(" ");//$NON-NLS-1$ - buff.append(initializer.toStringExpression()); - return buff.toString(); - } -}