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: * Times assignment.
21: * @author <TT>AutoDoc</TT>
22: */
23:
24: public class TimesAssignment extends Assignment {
25:
26: /**
27: * Times assignment.
28: */
29:
30: public TimesAssignment() {
31: }
32:
33: /**
34: * Times assignment.
35: * @param lhs an expression.
36: * @param rhs an expression.
37: */
38:
39: public TimesAssignment(Expression lhs, Expression rhs) {
40: super (lhs, rhs);
41: }
42:
43: /**
44: * Constructor for the transformation of COMPOST ASTs to KeY.
45: * The first occurrence of an Expression in the given list is taken as
46: * the left hand side
47: * of the expression, the second occurrence is taken as the right hand
48: * side of the expression.
49: * @param children the children of this AST element as KeY classes.
50: */
51: public TimesAssignment(ExtList children) {
52: super (children);
53: }
54:
55: /**
56: * Get arity.
57: * @return the int value.
58: */
59:
60: public int getArity() {
61: return 2;
62: }
63:
64: /**
65: * Get precedence.
66: * @return the int value.
67: */
68:
69: public int getPrecedence() {
70: return 13;
71: }
72:
73: /**
74: * Get notation.
75: * @return the int value.
76: */
77:
78: public int getNotation() {
79: return INFIX;
80: }
81:
82: /** calls the corresponding method of a visitor in order to
83: * perform some action/transformation on this element
84: * @param v the Visitor
85: */
86: public void visit(Visitor v) {
87: v.performActionOnTimesAssignment(this );
88: }
89:
90: public void prettyPrint(PrettyPrinter p) throws java.io.IOException {
91: p.printTimesAssignment(this);
92: }
93: }
|