01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: //
09: //
10:
11: package de.uka.ilkd.key.java.expression.operator;
12:
13: import de.uka.ilkd.key.java.Expression;
14: import de.uka.ilkd.key.java.PrettyPrinter;
15: import de.uka.ilkd.key.java.expression.Assignment;
16: import de.uka.ilkd.key.java.visitor.Visitor;
17: import de.uka.ilkd.key.util.ExtList;
18:
19: /**
20: * Copy assignment.
21: * @author <TT>AutoDoc</TT>
22: */
23: public class CopyAssignment extends Assignment {
24:
25: /**
26: * Constructor for the transformation of COMPOST ASTs to KeY.
27: * @param children the children of this AST element as KeY classes.
28: */
29: public CopyAssignment(ExtList children) {
30: super (children);
31: }
32:
33: /**
34: * Constructor for the transformation of COMPOST ASTs to KeY.
35: * @param lhs the Expression the value is assigned to
36: * @param rhs the Expression the value which is assigned to <tt>lhs</tt>
37: */
38: public CopyAssignment(Expression lhs, Expression rhs) {
39: super (lhs, rhs);
40: }
41:
42: /**
43: * Get arity.
44: * @return the int value.
45: */
46: public int getArity() {
47: return 2;
48: }
49:
50: /**
51: * Get precedence.
52: * @return the int value.
53: */
54: public int getPrecedence() {
55: return 13;
56: }
57:
58: /**
59: * Get notation.
60: * @return the int value.
61: */
62: public int getNotation() {
63: return INFIX;
64: }
65:
66: /** calls the corresponding method of a visitor in order to
67: * perform some action/transformation on this element
68: * @param v the Visitor
69: */
70: public void visit(Visitor v) {
71: v.performActionOnCopyAssignment(this );
72: }
73:
74: public void prettyPrint(PrettyPrinter p) throws java.io.IOException {
75: p.printCopyAssignment(this);
76: }
77: }
|